if (need_recv_correction && !(task->flags & RSPAMD_TASK_FLAG_NO_IP)
&& task->from_addr) {
msg_debug_task ("the first received seems to be"
- " not ours, replace it with fake one");
+ " not ours, prepend it with fake one");
trecv = rspamd_mempool_alloc0 (task->task_pool,
sizeof (struct received_header));
trecv->real_ip = rspamd_mempool_strdup (task->task_pool,
rspamd_inet_address_to_string (task->from_addr));
trecv->from_ip = trecv->real_ip;
+ trecv->by_hostname = rspamd_mempool_get_variable (task->task_pool,
+ RSPAMD_MEMPOOL_MTA_NAME);
trecv->addr = rspamd_inet_address_copy (task->from_addr);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t)rspamd_inet_address_free,
#define RSPAMD_MEMPOOL_HEADERS_HASH "headers_hash"
#define RSPAMD_MEMPOOL_SETTINGS_HASH "settings_hash"
#define RSPAMD_MEMPOOL_MTA_TAG "MTA-Tag"
+#define RSPAMD_MEMPOOL_MTA_NAME "MTA-Name"
#define RSPAMD_MEMPOOL_CACHED_REPLY "cached_reply"
#define RSPAMD_MEMPOOL_SPF_DOMAIN "spf_domain"
#define RSPAMD_MEMPOOL_PRINCIPAL_RECIPIENT "principal_recipient"
mta_tag, NULL);
debug_task ("read MTA-Tag header, value: %s", mta_tag);
}
+ IF_HEADER (MTA_NAME_HEADER) {
+ gchar *mta_name;
+ mta_name = rspamd_mempool_ftokdup (task->task_pool, hv_tok);
+ rspamd_mempool_set_variable (task->task_pool,
+ RSPAMD_MEMPOOL_MTA_NAME,
+ mta_name, NULL);
+ debug_task ("read MTA-Name header, value: %s", mta_name);
+ }
break;
default:
debug_task ("unknown header: %V", hn);
#define PROFILE_HEADER "Profile"
#define TLS_CIPHER_HEADER "TLS-Cipher"
#define TLS_VERSION_HEADER "TLS-Version"
-
+#define MTA_NAME_HEADER "MTA-Name"
#endif //RSPAMD_PROTOCOL_INTERNAL_H