Fix message to avoid classification as spam
It contains two changes that should help to avoid classification of notification messages as spam.
- It replaces a domain extracted from the
user_notify.smtp.from
variable (it almost never contains a domain) by theturris_email_domain
(i.e.,notify.turris.cz
). This should prevent theINVALID_MSGID
spam flag caused byMessage-ID
containing no domain. - It adds the
Content-Transfer-Encoding
header set to8bit
. This should prevent theCTE_8BIT_MISMATCH
spam flag caused by the combination of the (default) 7bit transfer encoding with 8bit message bodies.
Reported by @mbehun (originally from IRC):
19:51:14 gps │ I do not think anyone from Turris team monitors this channel anymore, but a quick post since mail notifications sent by Turris are being tagged as spam by SpamAssassin:
19:51:27 gps │ 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS
19:51:29 gps │ [172.59.212.76 listed in zen.spamhaus.org]
19:51:41 gps │ 1.2 INVALID_MSGID Message-Id is not valid, according to RFC 2822
19:51:43 gps │ 1.0 CTE_8BIT_MISMATCH Header says 7bits but body disagrees
19:52:52 gps │ All of that should be fixed/addressed by Turris team.
19:56:04 gps │ I guess if a home network IP (IP above is not my home) is on a blocklist of consumer ISP IPs, that will be flagged.
Edited by Lukas Jelinek