diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-31 10:36:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-31 10:36:36 +0100 |
commit | aa7679b9dfc18ba4c5f41d2b4c781d79cc48d4d5 (patch) | |
tree | d4c07cbb5959b5193238f8d92ec51b485ac7b35a /src/libserver/milter.c | |
parent | ad067ecbaeb0d8085c64a30740e4a6a397016bd3 (diff) | |
download | rspamd-aa7679b9dfc18ba4c5f41d2b4c781d79cc48d4d5.tar.gz rspamd-aa7679b9dfc18ba4c5f41d2b4c781d79cc48d4d5.zip |
[Minor] Add workaround for Postfix hostname
Diffstat (limited to 'src/libserver/milter.c')
-rw-r--r-- | src/libserver/milter.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c index d739a9d5e..6d2c7508b 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -290,6 +290,11 @@ rspamd_milter_process_command (struct rspamd_milter_session *session, guchar proto; guint16 port; + /* + * Important notice: Postfix do NOT use this command to pass + * client's info (e.g. hostname is not really here) + * Sendmail will pass it here + */ if (session->hostname == NULL) { session->hostname = rspamd_fstring_new_init (pos, zero - pos); } @@ -1185,6 +1190,13 @@ rspamd_milter_macro_http (struct rspamd_milter_session *session, rspamd_http_message_add_header_len (msg, USER_HEADER, found->begin, found->len); } + + if (!session->hostname || session->hostname->len == 0) { + IF_MACRO("{client_name}") { + rspamd_http_message_add_header_len (msg, HOSTNAME_HEADER, + found->begin, found->len); + } + } } struct rspamd_http_message * |