[BlueOnyx:07853] Re: php mail function issue

Mark McGavin markmcgavin at ip-action.co.uk
Tue Jul 26 05:29:43 -05 2011


Hi

Chris at Virtbiz got things running for me by coding
sendmail_path = /usr/sbin/sendmail -t -i -f postmaster at mydomainname.co.uk 
into php.ini

I have two other boxes with BO installed and this has never been needed to 
get the php mail function running before hence my confusion. Thank you for 
eveyones input.

still have an issue with squirrel mail which is less critical but still 
needs sorting

Email delivery error
Server replied: 65 Can't execute command 
'/usr/sbin/sendmail -i -t -fusername at localhost'.

is this a simple coding error in a script should it  not be

 command '/usr/sbin/sendmail -i -t -f username at localhost'.

where shoud i be looking to correct that please?




Mark



----- Original Message ----- 
From: "Jeffrey Pellin" <jeffrey at px2co.net>
To: "BlueOnyx General Mailing List" <blueonyx at mail.blueonyx.it>
Sent: Tuesday, July 26, 2011 10:04 AM
Subject: [BlueOnyx:07852] Re: php mail function issue


>
> 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.
> _______________________________________________
> Blueonyx mailing list
> Blueonyx at mail.blueonyx.it
> http://mail.blueonyx.it/mailman/listinfo/blueonyx 




More information about the Blueonyx mailing list