NYCPHP Meetup

NYPHP.org

[nycphp-talk] bounced email and Mail::send()

Allen Shaw ashaw at polymerdb.org
Mon Oct 17 13:34:16 EDT 2005


Thanks, Anirudh.  I'll look into this some more.  To pass the -f flag to 
the PHP mail() function might work, but also I am trying to do this with 
PEAR Mail::send(), so I will dig deeper into that codebase to look for 
clues.

Still mystified,
Allen

Anirudh Zala wrote:
> Normally you do not require to set header "Return-path" because return 
> path address is automatically taken by Sendmail as the user who sends 
> emails. Hence in your case it is "apache" when when sending mail from 
> web and "shell user" while sending mail from shell.
> 
> Hence now you have only 2 options. To set above header in desired way, 
> do not pass "Return-path" header while sending email. Instead in mail 
> function use 5th arguments like below.
> 
> mail('To mail', 'Subject', 'Message', 'All required header', '-f 
> bounce at someone.some');
> 
> This fifth parameter (was added in PHP 4.0.5) is your Return-Path. Here 
> "bounce at someone.some" is your bounce mail address. Alternatively you can 
> set permanent address in your php.ini or httpd.conf like below.
> 
> /usr/sbin/sendmail -f 'bounce at someone.some'
> 
> Please note that I have not tested above, so you have to try. But it 
> will work most probably or you may have to change syntax according to 
> php.ini or httpd.conf.
> 
> And sending mail from shell, invoke sendail command by using "-f" option 
> and specify bounced email adress. See below.
> 
> [...]# /usr/sbin/sendmail -f 'bounce at someone.some' REST OF ARGUMENTS
> 
> Thanks
> 
> Anirudh Zala
> 
> ---------------------------------
> Anirudh Zala (Production Manager)
> Ph: +91 281 245 1894
> anirudh at aspl.in
> http://www.aspl.in
> ---------------------------------
> 

-- 
Allen Shaw
Polymer (http://polymerdb.org)



More information about the talk mailing list