0

I have a web server (CentOS 5) that I need to be able to send mail from using PHP mail() function.

I have the PHP mail() function working properly. The Sendmail configuration is what I need to tweak.

I need to configure sendmail on the server to send "From" "[email protected]".

I know, if you go to the sendmail FAQ, it will say "We discuss this in detail in the MASQUERADING AND RELAYING ( http://www.sendmail.org/m4/masquerading.html ) section" but I've been through that section over and over and over and still my mail log shows something like this:

Aug 4 15:11:11 tdbb sendmail[30582]: n73Mngeq028343: to=, ctladdr= (48/48), delay=20:21:29, xdelay=00:00:01, mailer=esmtp, pri=2129764, relay=smtp.easydns.com. [64.68.200.52], dsn=2.0.0, stat=Sent (Ok: queued as 6120181E4C)

I would rather it said:

Aug 4 15:11:11 tdbb sendmail[30582]: n73Mngeq028343: to=, ctladdr= (48/48), delay=20:21:29, xdelay=00:00:01, mailer=esmtp, pri=2129764, relay=smtp.easydns.com. [64.68.200.52], dsn=2.0.0, stat=Sent (Ok: queued as 6120181E4C)

Note the ctladdr part.

Here is what I've done:

In /etc/mail/sendmail.mc

I have enabled the line:

MASQUERADE_AS(`mydomain.com')dnl

and

FEATURE(masquerade_envelope)dnl

Other than those two lines, I don't think I've changed anything from the default configuration.

Of course, I go to /etc/mail and run 'make', 'make restart' when I'm finished with the configuration file.

1 Answer 1

1

Ensure those settings have changed the sendmail.cf file. I have had to battle sendmail configurations before and it takes some patience and understanding. I usually m4 the files for it to regenerate the cf file then restart the sendmail service.

Try these as well:

MASQUERADE_AS(`mydomain.com')dnl
MASQUERADE_DOMAIN(`mydomain.com')dnl
FEATURE(`masquerade_envelope')dnl

Those usually work for me. Good luck.

2
  • Thanks but I've got these set and they're not working for me. :( I'll keep playing and post results if I get it working. Aug 4, 2009 at 22:07
  • After some jogging of files, I think this is working properly now. Along the way, I also found an option to put the FROM address in the /etc/php.ini file as an argument to sendmail. (-f) Then, you also have to make sure you disable the warnings if they show up in your log as per: wincent.com/a/knowledge-base/archives/2006/03/… Aug 5, 2009 at 4:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .