Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Precedence: header in email

Tags:

email

header

My web application sends email fairly often, and it sends 3 kinds of emails: initiated by user, in response to an event in the system, and in automatic response to an email received by the application.

I would like to make sure that the third type of email does not get stuck in an endless loop of auto-responders talking to each other. Currently, I use the header:

Precedence: junk 

but Yahoo! mail is treating these messages as spam. This is obviously not ideal, because we would like SOMEBODY to read our auto-response and make a decision on it, just not an out-of-office reply.

What is the best way to send an email without triggering either junk filters or auto-responders?

Precedence: junk?  Precedence: bulk?  Precedence: list?  X-Priority: 2? 
like image 600
Jacob Krall Avatar asked Sep 30 '08 20:09

Jacob Krall


People also ask

What are the headers of an email?

An email header is the area in which you enter important information above the email content area. The information in the header includes such things as the recipient, the sender, and a subject line with the option of sending copies to additional recipients.

What are the four parts of an email header?

The header (internet header) is the section of your mail that includes information like the sender details, receiver details, subject, and date. Other technical details like the Return Path, Reply-To Field, and Message ID are also included in an email header.

What comes first in the message header of email writing?

In an e-mail, the body (content text) is always preceded by header lines that identify particular routing information of the message, including the sender, recipient, date and subject. Some headers are mandatory, such as the FROM, TO and DATE headers. Others are optional, but very commonly used, such as SUBJECT and CC.

What is bulk email header?

The "Precedence: Bulk" header lets them know that you did intend to send an email to multiple subscribers at a time.


2 Answers

There is a RFC 3834 dedicated for automated email responses.

In short, it recommends:

  1. Send auto-responses only to address contained in the Return-Path header of an incoming message, if it is valid email address. Particularly "<>" (null address) in the Return-Path of the message means that auto-responses must not be sent for this message.

  2. When sending auto-response, MAIL FROM smtp command must contain "<>" (null address). This would lead to Return-Path:<> when message will be delivered.

  3. Use Auto-Submitted header with value other than "no" to explicitly indicate automated response.

One note: it is not worth to explicitly set Return-Path header in outgoing message, as this header must be rewritten by envelop address (from MAIL FROM smtp command) during delivery.

like image 108
user38936 Avatar answered Sep 25 '22 10:09

user38936


RFC 2076 discourages the use of the precedence header. as you have noted, many clients will just filter that off (especially the precedence: junk variety). it may be better to use a null path to avoid auto responder wars:

Return-Path: <> 

Ultimately you could use priority to try to get around this, but this seems like going against the spirit of the header. i'd suggest just using the return-path header for this, and avoiding precedence. in some cases you may have to write in some way to drop auto-responders in your application (to avoid getting into a responder war), but i can't remember a situation in which this happened using an appropriate return-path. (most auto responder wars i recall having to deal with were the result of very badly formed emails)

Note: the Return-Path header is, in short, the destination for notifications (bounces, delay delivery, etc...), and is described in RFC 2821 -- because it's required by SMTP. It's also one method to drop bad mail (as theoretically all good mail will set an appropriate return-path).

like image 21
Owen Avatar answered Sep 23 '22 10:09

Owen