emersion / go-message

✉️ A streaming Go library for the Internet Message Format and mail messages
MIT License
382 stars 111 forks source link

Add function to set Message-ID hostname manually #143

Closed jugendhacker closed 2 years ago

jugendhacker commented 2 years ago

Usually the hostname of the local machine tends to be not unique nor a FQDN. This brings multiple problems with it when sending messages using such Message-ID.

First of all this makes go-message more compliant to RFC5322 [1] because it recommends to use a FQDN on the right handed side of the @ in the Message-ID. Second this also improves the situation with spam filters, because some of them (for example rspamd) give a bad score for messages without a FQDN in the Message-ID.

[1] https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6.4

jugendhacker commented 2 years ago

@emersion anything I need to do here, to get a review or at least a comment on my PR?