Skip to content

Commit

Permalink
Updated FAQ to clarify/add the recommendation to set AutoSubmitted if…
Browse files Browse the repository at this point in the history
… needed (#1821)

---------

Co-authored-by: Jeffrey Stedfast <[email protected]>
  • Loading branch information
rklec and jstedfast authored Oct 2, 2024
1 parent 2a42387 commit 1489237
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,8 @@ the same way you'd create any other message. There are only a few slight differe
3. You will want to copy the original message's `References` header into the reply message's
`References` header and then append the original message's `Message-Id` header.
4. You will probably want to "quote" the original message's text in the reply.
5. If you are generating an automatic reply, you should also follow [RFC3834](https://www.rfc-editor.org/rfc/rfc3834)
and set the `Auto-Submitted` value to `auto-replied`.

If this logic were to be expressed in code, it might look something like this:

Expand Down Expand Up @@ -1163,6 +1165,9 @@ public static MimeMessage Reply (MimeMessage message, MailboxAddress from, bool
reply.References.Add (message.MessageId);
}

// if this is an automatic reply, be sure to specify this using the Auto-Submitted header in order to avoid (infinite) mail loops
reply.Headers.Add (HeaderId.AutoSubmitted, "auto-replied");

// quote the original message text
using (var quoted = new StringWriter ()) {
var sender = message.Sender ?? message.From.Mailboxes.FirstOrDefault ();
Expand Down

0 comments on commit 1489237

Please sign in to comment.