{"id":89,"date":"2008-05-28T05:40:56","date_gmt":"2008-05-28T12:40:56","guid":{"rendered":"http:\/\/thesmithfam.org\/blog\/?p=89"},"modified":"2019-08-12T07:15:58","modified_gmt":"2019-08-12T13:15:58","slug":"using-procmail-to-filter-out-cyrillic-emails","status":"publish","type":"post","link":"https:\/\/thesmithfam.org\/blog\/2008\/05\/28\/using-procmail-to-filter-out-cyrillic-emails\/","title":{"rendered":"Using procmail to filter out Russian emails"},"content":{"rendered":"<p>Lots of the spam I get uses the Cyrillic alphabet. I believe it&#8217;s Russian. I don&#8217;t correspond with anyone using the Cyrillic alphabet, so I&#8217;ve come up with a procmail recipe to filter this email out. But first some background.<\/p>\n<p>It seems that the subject lines of many (all?) Cyrillic emails look something like this:<\/p>\n<blockquote><p><code>Subject: =?koi8-r?B?7e\/06ffh4+nxIPTy9eTh?=<\/code><\/p><\/blockquote>\n<p>Which appears like this in your email reader:<\/p>\n<blockquote><p>\u00d0\u0153\u00d0\u017e\u00d0\u00a2\u00d0\u02dc\u00d0\u2019\u00d0\u0090\u00d0\u00a6\u00d0\u02dc\u00d0\u00af \u00d0\u00a2\u00d0\u00a0\u00d0\u00a3\u00d0\u201d\u00d0\u0090<\/p><\/blockquote>\n<p>The &#8220;KOI8-R&#8221; you see in the above Subject line refers to a popular Cyrillic encoding and indicates to the mail client that the rest of the text is thusly encoded. For more info, Wikipedia has a nice <a href=\"http:\/\/en.wikipedia.org\/wiki\/KOI8-R\">article on KOI8-R<\/a>. There is another encoding, called windows-1251 that is also used to encode Cyrillic, albeit less commonly than KOI8-R.<\/p>\n<p>To filter out these messages, I added two super simple procmail recipes to my .procmailrc file:<\/p>\n<blockquote><p><code>:0:<br \/>\n* Subject:.*koi8-r<br \/>\n$HOME\/Maildir\/.crap\/<\/code><\/p>\n<p><code>:0:<br \/>\n* Subject:.*windows-1251<br \/>\n$HOME\/Maildir\/.crap\/<\/code><\/p><\/blockquote>\n<p>Keep in mind that for these recipes to work, the Cyrillic stuff has to appear in the email subject, which most of my spam seems to do. I haven&#8217;t done extensive testing, but will let this run for the coming weeks and report how it worked.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lots of the spam I get uses the Cyrillic alphabet. I believe it&#8217;s Russian. I don&#8217;t correspond with anyone using the Cyrillic alphabet, so I&#8217;ve come up with a procmail recipe to filter this email out. But first some background. It seems that the subject lines of many (all?) Cyrillic emails look something like this: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-code-and-cruft"],"_links":{"self":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":1,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":1562,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/89\/revisions\/1562"}],"wp:attachment":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}