I installed Exim on centos 6, it was in the base configuration, changed only the user authorization method to the passwd file:

login: driver = plaintext public_name = LOGIN server_prompts = "Username:: : Password::" server_set_id = $auth1 server_condition = "${if exists{/etc/exim/passwd}{${lookup{$1}lsearch{/etc/exim/passwd}\ {${if crypteq{$auth2}{\\\{md5\\\}${extract{1}{:}{$value}{$value}fail}} {true}{false} }}}}}" 

login is a complete email, i.e. user@domain.ru

I send the letter and see these headers:

 Return-Path: "noreply@domain.ru"@mx.domain.ru X-Yandex-Front: mxfront7j.mail.yandex.net X-Yandex-TimeMark: 1497685386 Authentication-Results: mxfront7j.mail.yandex.net; dkim=pass header.i=@domain.ru X-Yandex-Spam: 4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=domain.ru; s=dkim; h=Sender:Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Subject:From:To:Date:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=p0SNRwx0/U6/74oIfNiicXPYOf7JujdEfLl4DGWrp80=; b=FgUdR2zgRykXn+FRhc3m9AkgGA kBvtwhfemijDQo9mW4sz33oRQjCZXr80GtjfAqVJKVrLKmHdIfChYM73x+hdd3ClzDgT+o9dlAAil dgqNOmiHaOsIvQxVg1olW9wQpqaqMYTjc53QIPv6rYJSHk07mJnH9fw2MEc4fhaipdrE=; Received: from [127.0.0.1] (helo=www.domain.ru) by mx.domain.ru with esmtpa (Exim 4.89) (envelope-from <"noreply@domain.ru"@mx.domain.ru>) id 1dM8Nu-0000ip-32 for user@yandex.ru; Sat, 17 Jun 2017 10:43:06 +0300 www.domain.ru - хостнейм domain.ru - сам домен mx.domain.ru - почтовый сервер(MX запись в DNS) user@yandex.ru - получатель 

In the header, return-path and envelope-from are substituted by the machine itself by Exim, and it is set incorrectly, as I understand it, it forms them as login @ hostname (my login is a complete email with the host), because of this letter they go directly to spam , and some mailers do not accept them at all.

Tell me how to fix it, I can not find anywhere to find out how to solve this problem ...

  • In general, this information is indicated by the program that forms the message, and not the smtp-server that received the message. - aleksandr barakin
  • corrected the post on the comments ... The send script (phpmailer) do not add this data. If you try to set these headers directly in the script, they are ignored and are rewritten to those above. - Eugene
  • so, have you decided which program generates messages and substitutes information that is confusing you? - aleksandr barakin
  • Try executing the command on behalf of your user (substituting actual addresses): $ echo -e 'subject: test\n\ntest body' | /usr/sbin/sendmail -f '<noreply@domain.ru>' user@yandex.ru $ echo -e 'subject: test\n\ntest body' | /usr/sbin/sendmail -f '<noreply@domain.ru>' user@yandex.ru and see what will be specified in from, return-path and envelope-from - aleksandr barakin

1 answer 1

According to the documentation, the value of the envelope from field and the from: and return-path: headers affect (at a minimum) three configuration parameters:

  • local_from_check ( true by default)
  • local_sender_retain ( false by default)
  • untrusted_set_sender (default is empty)

/etc/exim4/conf.d/main/02_exim4-config_options is a line in the /etc/exim4/conf.d/main/02_exim4-config_options file with the debian gnu / linux distribution kit:

 .ifndef MAIN_FORCE_SENDER local_from_check = false local_sender_retain = true untrusted_set_sender = * .endif 

and, since the parameter MAIN_FORCE_SENDER is not defined by default, the three parameters mentioned above are overwritten, which allows (by default) the program generating the message to specify an arbitrary return address. for example:

 $ echo -e 'subject: test\n\ntest body' | /usr/sbin/sendmail -f noreply@domain.ru user@yandex.ru 

and noreply@domain.ru falls both in the envelope from and in the headers from: and return-path:


judging by the contents of the etc/exim/exim.conf from the https://download.fedoraproject.org/pub/epel/6/x86_64/exim-4.89-1.el6.x86_64.rpm file, these three above-mentioned parameters are not redefined ( they are not found in the file).

therefore, if you want the sender information sent by the program that generates the messages to be taken into account (rather than ignored) by Exim , try adding the same lines as in the debian configuration file:

 local_from_check = false local_sender_retain = true untrusted_set_sender = * 
  • Yes, thanks, it helped. - Eugene