To where goes bounce mails, From or Reply-to - email

We are having a system that sends mail on behalf of the user (the user provide his own mail address).
The mails are send via our server and are set up to with our company mail address as From (as many of our clients have disallowed third party to send mails withe their address as From) and with the users mail address in the Reply-to.
Is it true that bounce mails are going to the Reply-to address rather than to the "From" address.

No, bounces will go to the reverse-path address in the SMTP envelope, which is usually (if you did not specify otherwise) the same as the From address supplied in the mail headers. Because you (correctly) use your company address as a reverse-path, bounces will be sent to your company. See Sender Rewriting Scheme for an example how it is possible to send bounces to the original user.

Related

sending an email to GitHub no-reply email ID

I was looking for the email address of a few profiles on GitHub and came across the no-reply email IDs. I know that these email IDs are created to make our personal email private, but I was wondering what happens if we mail to that no-reply address, I tried to mail me with my friend's email account and didn't receive any error neither did I receive the mail in my inbox. So what happened to that mail?
If you try to send mail to that domain, it will be returned as undeliverable.
In order to send mail to a domain, that domain must have either one or more MX records that provide the names of hosts to which mail can be delivered, or one or more A or AAAA records pointing to hosts which have a mail server running. In this case, users.noreply.github.com has no MX records, and it is a CNAME for github.github.io, which points to hosts which do not run a mail server.
When you attempt to send a mail to a server and it can't be delivered immediately, it is usually queued by your mail server, and if it remains undeliverable after some time (by default five days), it will bounce. Normally, you will receive a bounce message from your mail server indicating that the mail wasn't able to be delivered.
The point of those addresses is to allow users to attribute their commits to the correct account without having to receive emails. It wouldn't be very useful to prevent people from sending spam (or, in some cases, hostile or abusive emails) if the addresses weren't totally undeliverable.

How to specify mail bounce address when using SMTP server

I am sending a newsletter via Gmail's SMTP (actually, the SMTP depends on the mail's content, but let's use Gmail for this question).
My problem is, that bounced mails shall not return to the GMail account, but to another address. This address includes some VERP data to automatically detect outdated addresses.
What I know so far:
Gmail restricts the FROM header (which is perfectly fine for me, we do not want to spoof anything).
According to the SMTP specs, Gmail changes the Return-Path (or better: adds another one).
The Error-to header is deprecated
Using PHPMailer, I already have set the envelope sender ($mail->Sender property), which is correctly sent during SMTP communication
2014-06-11 13:59:51 CLIENT -> SERVER: MAIL FROM:<mailer+P=49276#myserver.de>
2014-06-11 13:59:51 SERVER -> CLIENT: 250 2.1.0 OK ey16sm6579150wid.14 - gsmtp
So ... is there any other option to tell the receiving mailserver to send bounces to another address? And/or tell the Gmail SMTP server to send the bounces there, if they are directly generated by the SMTP server?
UPDATE
It seems that disregarding my envelope sender goes along with the known Gmail protocol violation of changing the From header (http://lee-phillips.org/gmailRewriting/). When trying the same with GMX, the email is simply refused until the envelope sender matches the GMX mail address corresponding to the login.
Does that mean, I have no chance to alter the address that bounces are sent to?

Is there a way to prevent mail clients from caching an email address?

We have an application that allows users exchange messages, and delivers the message through email. But we don't reveal sender's email, instead; every time a message is sent out a new email address gets generated for the "From" field. Something similar to the way Facebook or LinkedIn send out messages.
Everything works fine, except the recipient's email client caches all these email addresses.
For instance, if Jack sends two messages to Jill, the sender's addresses can be: a123#FakeEmail.com and a456#FakeEmail.com, so next time Jill composes a new message and starts typing Jack's name, the email client suggests two addresses for Jack.
So my question is, how we can prevent email caching on client's machine? Is there something similar to HTTP header Pragma: no-cache for SMTP?
Thanks
Nivresh
OK, here is what I ended up doing. To prevent Outlook and other mail clients from suggesting several dummy email addresses generated for the same contact name, I add a special character to the beginning of the sender's name. This can be a space or if you use Unicode, you can add a zero-width space (\u200B) to the beginning of the name.
So in my example, the email is sent from "\u200BJack" which will be shown as "Jack". The dummy email address will be saved in mail client under the name of "\u200BJack" and when the recipient later on tries to send an email to Jack, email client won't suggest this address.
Hope this helps someone.

What is the behavior difference between return-path, reply-to and from?

On our mailing application we are sending emails with the following header:
FROM: marketing#customer.com
TO: subscriber1#domain1.example
Return-PATH: bouncemgmt#ourcompany.example
The problem that we are facing is that some email servers will bounce back a message immediately and use the from or reverse path (marketing#customer.example) instead to our bounce mgmt server. We want to know if we modify in the header the reply-to to be the same as the return-path if we will be able to catch all bounces.
Any other ideas are welcome?
We are using the following documents as references:
VERP
RFC
Bounce Messages
SMTP Log Parsing to get Bounces
EDIT 1: A few more bits of information to see if we can get this resolve.
We want to know at what point the email server relaying the message will choose to use the reply-to versus the return-path. We have notice that when the first SMTP server relaying the message gets rejected it sends it to the reply-to, but when it happens after one hop it sends it to the return-path.
Let's start with a simple example. Let's say you have an email list, that is going to send out the following RFC2822 content.
From: <coolstuff#mymailinglist.example>
To: <you#example.com>
Subject: Super simple email
Reply-To: <coolstuff-threadId=123#mymailinglist.example>
This is a very simple body.
Now, let's say you are going to send it from a mailing list, that implements VERP (or some other bounce tracking mechanism that uses a different return-path). Lets say it will have a return-path of coolstuff-you=yourcompany.com#mymailinglist.example. The SMTP session might look like:
{S}220 workstation1 Microsoft ESMTP MAIL Service
{C}HELO workstation1
{S}250 workstation1 Hello [127.0.0.1]
{C}MAIL FROM:<coolstuff-you=yourcompany.com#mymailinglist.example>
{S}250 2.1.0 me#mycompany.com....Sender OK
{C}RCPT TO:<you#example.com>
{S}250 2.1.5 you#example.com
{C}DATA
{S}354 Start mail input; end with <CRLF>.<CRLF>
{C}From: <coolstuff#mymailinglist.example>
To: <you#example.com>
Subject: Super simple email
Reply-To: <coolstuff-threadId=123#mymailinglist.example>
This is a very simple body.
.
{S}250 Queued mail for delivery
{C}QUIT
{S}221 Service closing transmission channel
Where {C} and {S} represent Client and Server commands, respectively.
The recipient's mail would look like:
Return-Path: coolstuff-you=yourcompany.com#mymailinglist.example
From: <coolstuff#mymailinglist.example>
To: <you#example.com>
Subject: Super simple email
Reply-To: <coolstuff-threadId=123#mymailinglist.example>
This is a very simple body.
Now, let's describe the different "FROM"s.
The return path (sometimes called the reverse path, envelope sender, or envelope from — all of these terms can be used interchangeably) is the value used in the SMTP session in the MAIL FROM command. As you can see, this does not need to be the same value that is found in the message headers. Only the recipient's mail server is supposed to add a Return-Path header to the top of the email. This records the actual Return-Path sender during the SMTP session. If a Return-Path header already exists in the message, then that header is removed and replaced by the recipient's mail server.
All bounces that occur during the SMTP session should go back to the Return-Path address. Some servers may accept all email, and then queue it locally, until it has a free thread to deliver it to the recipient's mailbox. If the recipient doesn't exist, it should bounce it back to the recorded Return-Path value.
Note, not all mail servers obey this rule; Some mail servers will bounce it back to the FROM address.
The FROM address is the value found in the FROM header. This is supposed to be who the message is FROM. This is what you see as the "FROM" in most mail clients. If an email does not have a Reply-To header, then all human (mail client) replies should go back to the FROM address.
The Reply-To header is added by the sender (or the sender's software). It is where all human replies should be addressed too. Basically, when the user clicks "reply", the Reply-To value should be the value used as the recipient of the newly composed email. The Reply-To value should not be used by any server. It is meant for client-side (MUA) use only.
However, as you can tell, not all mail servers obey the RFC standards or recommendations.
Hopefully this should help clear things up. However, if I missed anything, let me know, and I'll try to answer.
Another way to think about Return-Path vs Reply-To is to compare it to snail mail.
When you send an envelope in the mail, you specify a return address. If the recipient does not exist or refuses your mail, the postmaster returns the envelope back to the return address. For email, the return address is the Return-Path.
Inside of the envelope might be a letter and inside of the letter it may direct the recipient to "Send correspondence to example address". For email, the example address is the Reply-To.
In essence, a Postage Return Address is comparable to SMTP's Return-Path header and SMTP's Reply-To header is similar to the replying instructions contained in a letter.
for those who got here because the title of the question:
I use Reply-To: address with webforms. when someone fills out the form, the webpage sends an automatic email to the page's owner. the From: is the automatic mail sender's address, so the owner knows it is from the webform. but the Reply-To: address is the one filled in in the form by the user, so the owner can just hit reply to contact them.
I had to add a Return-Path header in emails send by a Redmine instance.
I agree with greatwolf only the sender can determine a correct (non default) Return-Path.
The case is the following:
E-mails are send with the default email address: admin#example.com
But we want that the real user initiating the action receives the bounce emails, because he will be the one knowing how to fix wrong recipients emails (and not the application adminstrators that have other cats to whip :-) ).
We use this and it works perfectly well with exim on the application server and zimbra as the final company mail server.

What's the best way to allow a web based e-mail system send replies and bounces to the sender's personal e-mail address?

I have a web app that only registered users can use, therefore I should have a valid e-mail address for the creator of the message.
One part of this web app will allow a user to create and send a e-mail message to an e-mail address that the user enters. My web server will be creating and sending the e-mail, however if there is a delivery problem with the e-mail I would like the bounce to go to the user's e-mail address instead of the server. This will allow the user to know that there was a problem delivering the message and they can take the appropriate action.
Would setting the "return-path" attribute to the user's e-mail address handle this?
As RFC2821 says:
The primary purpose of the Return-path is to designate the address to which messages indicating non-delivery or other mail system failures are to be sent. For this to be unambiguous, exactly one return path SHOULD be present when the message is delivered.
So yes, all standard compliant servers should account for the Return-path you set.
You could set up windows service on your server to periodically check BadMail folder and parse the bounced messages and resend them to the original sender. This solution would work in most cases. I don't think return-path would help in every instance (if it would at all), because different mail servers handle bounces differently.