Sendgrid and MailChimp are the two biggest sources of spam captured in my spam-folder. I'd like to block them before they get there.
Fortunately, in an effort to appear "legitimate" the spammers gracefully identify themselves. Sendgrid in particular inserts two special headers: X-SG-EID
and X-SG-ID
.
What's the best way to block on the sendmail level -- before it even hits procmail and/or IMAP-server?
I'm thinking of a header-database (such as /etc/mail/SPAM-HEADERS
) and a LOCAL_CONFIG
section with a header-rule like:
F{SpamHeaders} /etc/mail/SPAM-HEADERS
H*: $>CheckHdr
SCheckHdr
... ??? ...
Note, I don't care for the header's value -- as long as the header itself is present, I want to reject the message. Preferably -- with a header-specific condemnation. For example, if the SPAM-HEADERS
database contains line
X-SG-ID We love getting spam from SendGrid, just not today
I'd like sendmail to reply to any message with X-SG-ID
among headers with 553 We love getting spam from SendGrid, just not today
.
abuse@
.