Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify/add the recommendation to set AutoSubmitted if needed #1821

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading