Override Sendmail server Return path ( Centos, Sendmail) (not windows server)
Posted on 2012-04-13
I know that From php , I can override the Return path of a mail server. but let me explain to you where is the problem :
We have Server A , which has Apache + sendmail + php
Server B , our mailserver(exim)
In Server A, i am using smarthost to forward all the email to Server B . (which is fine)
Now problem is : when sendmail is forwarding the email From Server A to SErer B, its putting return path as domain.Companydomain.lan
In server A , when its sending to Server b (smarthost) we get like this (sendmail log)
Apr 13 15:03:03 posrep sendmail: q3DE33pL030599: from=<email@example.com>, size=403, class=0, nrcpts=1, msgid=<201204131403.q3DE33gJ030596@posrep.domain.lan>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Apr 13 15:03:04 posrep sendmail: q3DE33pL030599: to=<firstname.lastname@example.org>, ctladdr=<email@example.com> (2/2), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120403, relay=smarthost.domain.lan. [22.214.171.124], dsn=2.0.0, stat=Sent (OK id=1SIh5b-0004iC-T4)
When SErver B send email outside:
When Server B is receing email from Server A , its getting like this ..
2012-04-13 15:03:04 1SIh5c-0004iG-2L <= firstname.lastname@example.org H=posrep.localdomain.lan [192.0.0.xx] P=esmtp S=831 id=201204131403.q3DE33kT030602@posrep.localdomain.lan
and when SErber B is sending email outside world, its keeping the same return address which is : email@example.com
now my question is :
is there any way, to override some configuration in sendmail.mc
so that when it will sent , it will take Return path from php ??
note : I cant set the sendmail_from path in php.ini as sendmail from can be different email address, so no hardcoded ..