NYCPHP Meetup

NYPHP.org

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

Allen Shaw ashaw at polymerdb.org
Sat Oct 15 07:30:23 EDT 2005


Anirudh Zala wrote:
> You already have paramater "Return-path" in your header so it should 
> work. Do you use proper syntex in writing your all headers? Moreover try 
> to add 1 more parameter "Errors-To" to your header string and then check 
> whether it works or not. I have not tested it, but normally it works.
> 
> Thanks
> 
> Zala

Well, after further review, it appears it *did* work after all, but not 
in the way I expected.  Bounced mail came back into my CLI user's 
mailbox (let's call it "shell_PHP_user at example.com"), not the one marked 
in the headers ("me at example.com"). In fact, the headers on most of this 
bounced mail show the original message as coming from 
"shell_PHP_user at localhost".

I'm guessing there's some sendmail tweaking to be done here. But still, 
shouldn't the headers I pass to Mail::send() be the same headers that 
get attached to the mail?

For the sake of detail, here are the first few header lines of the email 
that's being sent -- notice that 'shell_PHP_user' is being used on the 
lines above, while 'me' is being used on the lower lines:
> From - Sat Oct 15 06:12:13 2005
> X-Account-Key: account3
> X-UIDL: 4350e40d00000001
> X-Mozilla-Status: 0001
> X-Mozilla-Status2: 10400000
> Return-Path: <shell_PHP_user at example.com > Received: (from shell_PHP_user at localhost)
> 	by example.com (8.11.6/8.11.6) id j9FBC7J03635;
> 	Sat, 15 Oct 2005 06:12:08 -0500
> Date: Sat, 15 Oct 2005 06:12:08 -0500
> Message-Id: <200510151112.j9FBC7J03635 at example.com>
> To: badaddress at other.example.com, me at example.com
> Subject: test email
> MIME-Version: 1.0
> From: <me at example.com>
> Reply-To: <me at example.com>
> Return-Receipt-To: <me at example.com>
> Errors-To: <me at example.com>
> Content-Type: multipart/mixed;
> 	boundary="=_24450f0ce176f5580ea337c3fe3ec778"
> Status:   

That's when I run the script from the command line.  If I run it through 
the Web, it's all the same except 'apache' is used instead of 
'shell_PHP_user'.  In any case, somehow the user name is being used 
instead of the values passed to $mime->headers().  Odd, right?

At this point it's academic, as I've found the bounced mail and know 
where it's going, but why the heck isn't this mail using the headers I 
give it?

I'll keep looking and post any answers here as a follow-up.

- Allen

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



More information about the talk mailing list