Set bounce address with ActionMailer::ARMailer

Hi all. I send out mails using ActionMailer::ARMailer, via an exim mailserver. Is there some header/field that i can set so that the reply field is (eg) webmaster@ourdomain.com but bounced (ie undeliverable) mails get sent back to (eg) noreply@ourdomain.com?

thanks, max

Hi all. I send out mails using ActionMailer::ARMailer, via an exim mailserver. Is there some header/field that i can set so that the reply field is (eg) webmas...@ourdomain.com but bounced (ie undeliverable) mails get sent back to (eg) nore...@ourdomain.com?

isn't that the difference between return-path and reply-to ?

Fred

Frederick Cheung wrote in post #987560:

Frederick Cheung wrote in post #987560:

>> Hi all. I send out mails using ActionMailer::ARMailer, via an exim >> mailserver. Is there some header/field that i can set so that the reply >> field is (eg) webmas...@ourdomain.com but bounced (ie undeliverable) >> mails get sent back to (eg) nore...@ourdomain.com?

> isn't that the difference between return-path and reply-to ?

> Fred

Hi fred - i'm not sure what you mean. Do you mean i should be setting reply-to (or is it "Reply-To"?) to "nore...@charanga.com" as well? Or instead of Return-Path?

it was my understanding that reply-to is what gets used when the user tries to reply to one of your emails, but that return-path is used for bounces (I may of course be wrong)

Fred

Frederick Cheung wrote in post #989568:

> Fred

Hi fred - i'm not sure what you mean. Do you mean i should be setting reply-to (or is it "Reply-To"?) to "nore...@charanga.com" as well? Or instead of Return-Path?

it was my understanding that reply-to is what gets used when the user tries to reply to one of your emails, but that return-path is used for bounces (I may of course be wrong)

Fred

That's what i thought, but it's not working for me: currently i'm doing this

'From' = "webmaster@ourdomain.com" 'Return-Path' = "noreply@ourdomain.com" 'To' = "lkajsdkjhkljshdkljhsdflkjhkljhkljhlkjlskjh@gmail.com"

This should get bounced back by gmail, and i'd think it would get bounced back to the noreply address. But, the noreply mailbox doesn't get anything back.

Frederick Cheung wrote in post #989568:

>> > Fred

>> Hi fred - i'm not sure what you mean. Do you mean i should be setting >> reply-to (or is it "Reply-To"?) to "nore...@charanga.com" as well? Or >> instead of Return-Path?

> it was my understanding that reply-to is what gets used when the user > tries to reply to one of your emails, but that return-path is used for > bounces (I may of course be wrong)

> Fred

That's what i thought, but it's not working for me: currently i'm doing this

'From' = "webmas...@ourdomain.com" 'Return-Path' = "nore...@ourdomain.com" 'To' = "lkajsdkjhkljshdkljhsdflkjhkljhkljhlkjls...@gmail.com"

This should get bounced back by gmail, and i'd think it would get bounced back to the noreply address. But, the noreply mailbox doesn't get anything back.

Make sure that nothing is overwriting your Return-Path, I've come across mail servers that would rewrite that sort of stuff for you. (eg send a mail to an address you can read and check that the return path is the one you specified)

Fred

Frederick Cheung wrote in post #989578:

Make sure that nothing is overwriting your Return-Path, I've come across mail servers that would rewrite that sort of stuff for you. (eg send a mail to an address you can read and check that the return path is the one you specified)

Ok, i just stripped out any extra headers (so i'm just setting to, from, subject, and body) and then sent a mail with the from field set to my yahoo email and the from field set to my gmail email.

Changing the addresses to protect the innocent, let's say that i set it up as follows:

From: my-yahoo-address@yahoo.co.uk To: my-gmail-address@gmail.com Subject: "Hello dummy" Body: "Hello dummy\n"

So, i sent that out, recieved it in gmail and inspected it, to see the following:

Delivered-To: my-gmail-address@gmail.com Received: by 10.52.156.164 with SMTP id wf4cs20192vdb;          Mon, 28 Mar 2011 05:29:27 -0700 (PDT) Received: by 10.227.163.133 with SMTP id a5mr3664403wby.73.1301315366670;          Mon, 28 Mar 2011 05:29:26 -0700 (PDT) Return-Path: <my-yahoo-address@yahoo.co.uk> Received: from uk1w2c0067.eechost.net (uk1w2c0067.eechost.net [217.69.46.42])          by mx.google.com with ESMTP id u2si6545764wbd.60.2011.03.28.05.29.26;          Mon, 28 Mar 2011 05:29:26 -0700 (PDT) Received-SPF: neutral (google.com: 217.69.46.42 is neither permitted nor

denied by best guess record for domain of my-yahoo-address@yahoo.co.uk) client-ip=217.69.46.42;

Authentication-Results: mx.google.com; spf=neutral (google.com: 217.69.46.42

is neither permitted nor denied by best guess record for domain of my-yahoo-address@yahoo.co.uk) smtp.mail=my-yahoo-address@yahoo.co.uk

Received: from ec2 ([75.101.135.251]) by uk1w2c0067.eechost.net with Microsoft

SMTPSVC(6.0.3790.4675);

    Mon, 28 Mar 2011 13:30:03 +0100 Received: from localhost ([127.0.0.1] helo=ir.charanga.com)    by ec2 with esmtp (Exim 4.63)    (envelope-from <my-yahoo-address@yahoo.co.uk>)    id 1Q4BZV-00032m-Fq    for my-gmail-address@gmail.com; Mon, 28 Mar 2011 13:29:25 +0100 Date: Mon, 28 Mar 2011 13:28:39 +0100 From: my-yahoo-address@yahoo.co.uk To: Dummy User <my-gmail-address@gmail.com> Subject: Hello dummy Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-Id: <E1Q4BZV-00032m-Fq@ec2> Return-Path: my-yahoo-address@yahoo.co.uk X-OriginalArrivalTime: 28 Mar 2011 12:30:03.0500 (UTC)

FILETIME=[DCE862C0:01CBED43]

Hello dummy

I tried again, setting the 'Return-Path' header when building the email, but the "Return-Path" header in the received mail is still set to be the same as the from address.

Yahoo may be forcing the return path (eg so that you can't spam people by sending email you know will bounce and setting the return-path to be the victim's email address, thus getting someone else's mail server to send the spam message)

Fred

Frederick Cheung wrote in post #989604:

Frederick Cheung wrote in post #989604:

>> I tried again, setting the 'Return-Path' header when building the email, >> but the "Return-Path" header in the received mail is still set to be the >> same as the from address.

> Yahoo may be forcing the return path (eg so that you can't spam people > by sending email you know will bounce and setting the return-path to > be the victim's email address, thus getting someone else's mail server > to send the spam message)

ah...in that case (assuming other mail servers will do the same thing) then i'm screwed, right? As far as having a bounce address which is different to the from address goes anyway.

I don't think it will be true of all mail servers, although it may well be true of most services like yahoo, gmail etc.

Fred

Just thought of something - we can see that it's NOT yahoo changing the return path: in the original mail, forwarded on as part of the bounce, the return path is set to be the same as the from address. So it looks like it is something that happens as part of the sending process - right?