[Dovecot] Sieve mails with decoded subject

Johannes Bauer dfnsonfsduifb at gmx.de
Thu Dec 10 20:34:00 EET 2009


Dear all,

I accidently posted this message to dovecot-news and want to apologize
for any trouble I may have caused. Here it is again to the correct
mailing list:

Recently I'm getting a ton of porn/viagra/diet/casino spam mails which I
tried to filter with sieve:

if header :contains "Subject" [ "[SPAM]",
		"Bett",
		"Schlafzimmer",
		"Spielen",
		"Luder",
		"abhenmen",
		"poppen",
		"Casino",
		"Bonus",
		"abnehmen",
		"Gewinn",
		"Potenz" ] {
	addflag "\\seen";
	fileinto "Spam";
	stop;
}

Sadly, this didn't work - taking a closer look upon one of the spam
mails, it seems the spamming rats have encoded the subject:

Subject: =?US-ASCII?B?RW5kbGljaCBtZWhyIGVuZ2FnZW1lbnQgaW0gQmV0dGNoZW4=?=
(reads: "Endlich mehr engagement im Bettchen")

I'm thinking about filtering all such encoded subjects (as there's no
reason to encode them US-ASCII), but suppose it were UTF-8 or something:
how can I filter on the actual content, not the encoded subject? Surely
someone has solved that problem already?

Kind regards,
Johannes


More information about the dovecot mailing list