On Mon, Oct 06, 2014 at 02:08:42PM +0200, Bata Degen wrote:
> I am sending mail from a PHP script. I have checked that it's really
> sent by Exim. The From-Header I add in the script is, I guess,
> overwritten by Exim. The scripts looks like this (excerpt).
> 
> $headers  =  "From: Display Name <[email protected]>\r\n";
> $headers = "Content-Type: text/plain; charset=\"utf-8\"" . "\r\n";

 You overwrite your "From:" header field by the second PHP assignment.
 The $headers variable must be appended, not overwritten.

> $subject = "=?UTF-8?B?".base64_encode("The subject")."?=";
> if(mail("[email protected]",$subject,"TEST",$headers)){
>     echo "true";
> } else {
>     echo "false";
> }
> 
> It works BUT the From-Header is overwritten to something like this:
> From:  www-data <[email protected]>. The domain3.com is also legit on
> this server but not the domain I want to be used.

 "From:" field is added by Exim, because it is absent on submission.

> Above all, I need to know from where Exim possibly retrieves domain
> names. I've already checked /etc/mailname and /etc/hostname. They are
> IMHO okay!

 On Debian-based distributions /etc/mailname is used by default.
 But it may be set explicitly somewhere in configuration file.
-- 
 Eugene Berdnikov

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to