muquit / mailsend-go

mailsend-go is a multi-platform command line tool to send mail via SMTP protocol
Other
168 stars 16 forks source link

No Message-ID header #51

Open rojer opened 2 years ago

rojer commented 2 years ago

mailsend-go (and mailsend, for that matter) does not generate the Message-ID header, which is mandatory. GMail recently began rejecting messages without it[1], so when sending to Gmail wither directly to mx or via a relay that is not kind enough to add it[2], the message bounces.

[1] 550-5.7.1 [...] Messages missing a valid messageId header are not 550 5.7.1 accepted [2] e.g. Postfix does not, by default, but can be made to by setting always_add_missing_headers = yes

rojer commented 2 years ago

https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4

muquit commented 2 years ago

I did not add it, because there is no guarantee that SMTP server will accept it. It's the job of SMTP server to add that header and a lot of server will over-write it if specified by mail user agent like mailsend. I will think about adding an option. In the meantime you can use header command to add a customer Message-ID. Example:

 header -name "Message-ID" -value "<1234@local.machine.example>"

Thanks.

rojer commented 2 years ago

as long as it follows the format specified in the RFC, it should. i think mailsend should at least try. in my case i was dropping things on the floor because of this (i had mailsend submit directly to gmail, then changed to my own relay only to find that postfix won't add it by default either).

SirHumphreyAppleby commented 2 years ago

You may get different results in Postix using port 587 vs 25. A submission server may add a message-id (bad client), but a relay is prohibited from doing so. RFC5321.