| |||||||||||
| |||||||||||
PHP & sendmail frustration Posted by John_Moylan (jfp), 14 August 2003 I have to buld send emails out, and need an elegant way of handling the bounce backs.So I thought reset the return path...anyway <Email headers> From: this works fine Subject: this works fine Reply-to: this works fine Return-path; THIS FAILS </Email headers> The return path is always set to: <admin@myserveraccount.com> when I query the bounced email I have tried setting the return path in php.ini to: sendmail_path = /usr/sbin/sendmail -t -f bounce@somedomain.co.uk Still no joy, anyone got the Return-path to work? jfp Posted by Chris_Isaac (Chris Isaac), 14 August 2003 HiI've never actually tried using sendmail, so I'm kind of weeing in the wind, but an example I've seen had the line down as: Code:
only difference I could see from yours was the capital P in path and colon rather than semi, may be worth a try? regards Chris Posted by John_Moylan (jfp), 14 August 2003 Well I managed it in the end,. The semi colon in my example was my typo while inputting here.Anyway, the php.ini version worked in the end, don't know what it was cos I broke a rule and changed a couple of things at once...naughty. But at least I now bounce to where I want. thanks for the reply Charles. Has anyone got this to work without resorting to a php.ini config change? jfp Posted by admin (Graham Ellis), 15 August 2003 I'm coming to this one a bit late, but I just did a bit of testing ... sending out emails to myself with return path set in the mail function. I looked at the full headers when the message reached me, and found that the return path had been changed. Conclusion (perhaps one the rest of you have reached already!) is that you can't change the return path in the mail function as it'll get over-ridden (on many systems at least).I also checked various manuals - no direct reference, but on the php web site I did find a user posted script which sidesteps the mail function (in order to send out multiple mails in a single connection) and it specifies a return path. Considering the jfp is looking to send out multiple emails, the script may be useful to him for other reasons too - see http://uk2.php.net/manual/en/ref.mail.php and search in the page for greywyvern Posted by John_Moylan (jfp), 16 August 2003 yes Graham, it was a conclusion that I finally came too.The only way to do this is as an arg to sendmail itself, and not via a php function. (Though I haven't tested the fifth arg to the mail() function I recently found out about which may do this) I did this in the end in my php.ini Code:
Thinks: Could always bypass the mail() function and pipe to sendmail and add the -f option there, probably makes more sense to do it that way. jfp This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |