[BlueOnyx:07852] Re: php mail function issue

Jeffrey Pellin jeffrey at px2co.net
Tue Jul 26 04:04:57 -05 2011


Hey guys,

Michael, I hear what you say, but didn't Mark mention that not even the
bundled SquirrelMail works, which should not be the case.

Mark, 

Did you want to check that the mbox (and in fact everything in the users
folder belongs to that user. If it doesn't then I could see it being
impossible to send email and I do recall seeing a similar problem before.

Regards

Jeffrey


On Tue, 26 Jul 2011 00:33:34 +0200, Michael Stauber <mstauber at blueonyx.it>
wrote:
> Hi Chris,
> 
>> While I understand why the "wrong" solution here is wrong, it would also
>> be "wrong" to try to force / educate every site owner on the box to use
>> WordPress in a way that is different from the vast majority of the
>> world's installations.   So how can I make it "right?"
> 
> I've just seen your offlist email and already replied to that. Here is my

> answer that I emailed you offlist, just for the list archives:
> 
> By default the PHP mail() function doesn't really let you set a sender.
> Which 
> is just a major "Doh!"
> 
> After all, any MTA expects a working sender address as the origin of your

> message, right? And you certainly would like that the recipient of the
> message 
> can reply back to you, too.
> 
> So PHP and ultimately Apache will just assume some defaults for you,
which 
> often do not work. After all, why should they? Especially if you have a
> dozen 
> sites on the server, then there certainly is no default sender address
that
> 
> works for all of them, right?
> 
> You can get around this by two ways:
> 
> In /etc/php.ini (for Solarspeed PHP that's
> /home/solarspeed/php/etc/php.ini) 
> you find this line:
> 
> sendmail_path = /usr/sbin/sendmail -t -i
> 
> ... and change it to this:
> 
> sendmail_path = /usr/sbin/sendmail -t -i -f working at email.address
> 
> ... where "working at email.address" is a working and valid email address
that
> is 
> used as new default sender for all emails sent with the mail() function.
> 
> However, with that you are back at "square one": All scripts that use the

> mail() function will use this sender address. Which may not really be
what 
> you're looking for.
> 
> Another way is to put this into your PHP script, somewhere above the code

> where you use the mail() function:
> 
> ini_set("SMTP","smtp.example.com" );
> ini_set('sendmail_from', 'user at example.com'); 
> 
> That then overrides (or sets) the settings in php.ini to the ones you've 
> specified in the script.
> 
> Of course you'd replace "smtp.example.com" and  'user at example.com' with
> stuff 
> that works for you.



More information about the Blueonyx mailing list