[KLUG Members] Mail from PHP -- solved

Adam Tauno Williams members@kalamazoolinux.org
Mon, 19 Apr 2004 14:14:55 -0400


> Thanks to all who gave tips and pointers. I was following a different 
> approach in my efforts, Tand got something to work early this morning.
> It seems that the crux of this problem is that someone (Apache PHP 
> module? Apache? PHP itself?) takes the hostname part of the mail address
> from the first dotted name that appears in /etc/hosts. I switched around 
> that file so that it looks
> like...
> xx.yy.zz.tt	hostname.mydomain.com
> 127.0.0.1       localhost localhost.locldomain lo
> ....
> And the mail was then sent out by apache@hostname.mydomain.com. Since
> I used a name there that was properly configured in DNS, charter.net
> accepted it.

Naughty!  That really seems disturbed.

> Note to Adam: Mail had been sent from this server to other MTA's before
> this whole thing came up. Apparently those are not doing the sort of 
> checking that charter.net is doing.

Are you masqurading?  The envelope or just the source?  I've found envelope
maquerading to be better at penetrating stupid filters.

> Note to Bill H:  I will try your suggestions since they look more 
> stable than my solution, which works ok, but is not too general and
> seems a bit flakey.

Yep, that was a pretty nice write-up on the whole apache/php/mail mess.