listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

RFC 5322 message header compliance

Open nosliwneb opened this issue 2 years ago • 4 comments

Version:

  • listmonk: v2.2.0
  • OS: Debian

Description of the bug and steps to reproduce: Listmonk generates Message-ID's that look like: ID@hostname, but RFC 5322 and most email providers seem to want a fully qualified domain name, i.e. [email protected].

Currently there doesn't appear to be any way to override this except by changing the host name of the machine running Listmonk to match the sending domain.

FWIW, I also have a spam filter complaining about 'Mime-Version' being used instead of 'MIME-Version'

Screenshots: N/A

nosliwneb avatar Aug 27 '22 01:08 nosliwneb

RFC 5322 does not explicitly say that Message-Id should have a valid domain, right? This is a message ID from a Cloudflare mail for example: <[email protected]>.

Also, haven't seen any reports of the message ID being a problem with any of the popular providers (or with acceptance when sent from self-hosted SMTP servers).

knadh avatar Aug 28 '22 07:08 knadh

The text from the spec says the domain version is RECOMMENDED

3.6.4 Note: As with addr-spec, a liberal syntax is given for the right- hand side of the "@" in a msg-id. However, later in this section, the use of a domain for the right-hand side of the "@" is RECOMMENDED. Again, the syntax of domain constructs is specified by and used in other protocols (e.g., [RFC1034], [RFC1035], [RFC1123], [RFC5321]). It is therefore incumbent upon implementations to conform to the syntax of addresses for the context in which they are used.

I have a listmonk installation that hasn't been able to get out of the spam folder (primarily gmail) for months despite only sending opt-in confirmations. When I send virtually the same message from a regular email client it does reach the gmail inbox and then subsequent emails from listmonk start landing in the inbox for that particular recipient. All of these messages are going through the same self-hosted SMTP server that passes SPF/DKIM/DMARC. When looking at the headers the only difference I saw was the Message-ID format, so I assumed that was part of the issue.

If you search on the internet you can find a few places that say you'll land in the spam folder if the Message-ID doesn't use the domain, but it's unclear if they are saying that based on direct observations. I'm not totally sure, but it's possible that the expectation is headers generated by a MUA should use the host name and a Message-ID added later by the SMTP server might use the domain.

I've since renamed the host running the listmonk installation to match the domain name (causing the Message-IDs generated by listmonk to use the domain) and the problem still persists. I'm stumped at this point and grasping at straws.

The only other weirdness I can see is Google postmaster tools reports everything is great, except it reports the SPF rate is 0% (despite every other tool on the internet saying it's fine, including the headers on mail received to gmail inboxes).

Message ID: @.***>

nosliwneb avatar Aug 28 '22 11:08 nosliwneb

hm, that's unfortunate. We operate multiple installations (with self hosted SMTP servers) and have never faced this issue. Haven't heard of this from other users either.

Assuming that everything else is in order, maybe it's the IP that's ended up on some blackbox list?

knadh avatar Aug 28 '22 12:08 knadh

We aren't on any blacklists. The domain is about 8 months old at this point and we've been sending emails for a while.

Since emails sent from other clients seem to go through without issues I'm inclined to think it's something related to Listmonk or the way I have it configured, but I can't figure out what.

nosliwneb avatar Aug 28 '22 13:08 nosliwneb