Gmail says: Yes to angle brackets in the Message-ID


Here's a quick reminder for anyone building their own email messages: Gmail wants your Message-ID header to be properly formatted, which means that the message-ID value must be enclosed in angle brackets, aka less than/greater than symbols.

Correct: Message-ID: <abc123@mail.example.com>
Not Correct; Message-ID: abc123@mail.example.com

A raw value with no angle brackets is wrong, according to RFC 5322, section 3.6.4.

Over on the Mailop list, email senders have reported that Gmail will drop (discard) messages entirely if the Message-ID header is missing the brackets. In my own testing, though, I found that Gmail wasn't discarding, at least for me (YMMV). Instead, I found that it strips out the broken header, adds its own, and tags the new one with SMTPIN_ADDED_BROKEN. It also keeps the original value in a new X-Google-Original-Message-ID email header.

No matter what happens, you don't want this.

Luckily, Gmail seems to be careful not to invalidate DKIM signatures based on this issue. If the header was rewritten before DKIM signature validation, messages would then fail those check(s), and then DMARC, if the sender included Message-ID in their list of headers covered by the hash and signature, and most folks do.

That'd be a lethal impediment to deliverability success. While not technically an issue with Gmail, you still should never rely on somebody else to fix your broken mess, and you can't assume that other mailbox providers will be similarly kind.

TL;DR: Message-ID angle brackets are not optional.

(Fun fact: Can you include "friendly from"-like text in your Message-ID field? Yes, the RFC allows it, but nobody seems to do anything with this, so why bother?)
Post a Comment

Comments