{"id":193,"date":"2013-05-14T14:37:18","date_gmt":"2013-05-14T12:37:18","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=193"},"modified":"2013-05-19T16:54:22","modified_gmt":"2013-05-19T14:54:22","slug":"avoid-the-spam-on-the-gentoo-org-mail-with-procmail","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2013\/05\/14\/avoid-the-spam-on-the-gentoo-org-mail-with-procmail\/","title":{"rendered":"Avoid the spam on the gentoo.org mail with procmail"},"content":{"rendered":"<p>I use it since a long time, so since it works pretty good for me, I want to share how to handle the spam for your @gentoo.org address with procmail.<\/p>\n<p>First, you need to say that procmail will filter your email(s):<br \/>\n<code>echo \"| \/usr\/bin\/procmail\" &gt; \/home\/${USER}\/.forward<\/code><\/p>\n<p>Then create a simple \/home\/${USER}\/.procmailrc with this content:<br \/>\n<code>:0:<br \/>\n* ^X-Spam-Status: Yes<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^X-Spam-Level: \\*\\*\\*<br \/>\n\/dev\/null\/<\/p>\n<p>:0:<br \/>\n* ! ^List-Id<br \/>\n* ^X-Spam-Level: \\*\\*<br \/>\n\/dev\/null\/<\/p>\n<p>:0:<br \/>\n* ^Subject:.*viagra*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*cialis*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*money*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*rolex*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*scount*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*Viagra*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*Cialis*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*Marketing*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*marketing*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*Money*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*Rolex*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*Scount*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*glxgug*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*offizielle sieger*<br \/>\n\/dev\/null<\/p>\n<p>:0:<br \/>\n* ^Subject:.*educational*<br \/>\n\/dev\/null<\/p>\n<p>:0 B:<br \/>\n* $ content-[^:]+:${WS}*.+(\\&lt;)*(file)?name${WS}*=${WS}*\\\/.+\\.(pif|scr|com|cpl|vbs|mim|hqx|bhx|uue|uu|b64)\\&quot;?$<br \/>\n\/dev\/null<\/p>\n<p>:0 B:<br \/>\n* ^Content-Type: .*;$[  ]*(file)?name=\\&quot;?.*\\.(pif|scr|com|cpl|vbs)\\&quot;?$<br \/>\n\/dev\/null<\/p>\n<p>:0 B:<br \/>\n* ^Content-Type: .*; [  ]*(file)?name=\\&quot;?.*\\.(pif|scr|com|cpl|vbs)\\&quot;?$<br \/>\n\/dev\/null<\/code><\/p>\n<p>With the filter for <em>X-Spam-Status<\/em> and <em>X-Spam-Level<\/em> you will avoid the majority of the incoming spam.<br \/>\nSome mails that does not have any Spam flag, contains subject like viagra, cialis ( which I absolutely don&#8217;t need \ud83d\ude00 ), rolex and scount.<br \/>\nYes, I could you the <em>(c|C)ase<\/em> syntax, but I had problems, so I prefer to write twice the rules instead of have any sort of troubles.<br \/>\nNote: with this email address I&#8217;m not subscribed to any newsletter or any sort of offers\/catalogs so I filtered <em>scount, markerting, money<\/em>.<\/p>\n<p>Sometimes I receive mails from people that are not spammer, with the X-Spam-Level flag with one star, so I decided to move these email into a folder, they will be double-checked with naked eye:<\/p>\n<p><code>:0:<br \/>\n* ^X-Spam-Level: \\*<br \/>\n\/home\/ago\/.maildir\/.INBOX.pspam\/<\/code><\/p>\n<p>To avoid confusion I always prefer to use a complete path here.<\/p>\n<p>After a stabilization you will always see the annoying mail from the bugzilla which contains ${arch} stable, so if you want to drop them:<\/p>\n<p><code>:0 B<br \/>\n* ^*(alpha|amd64|arm|hppa|ia64|m68k|ppc|ppc64|s390|sh|sparc|x86) stable*<br \/>\n\/dev\/null<\/code><\/p>\n<p>Now, if you are using more email clients, on more computers, you may need to set the filters here instead of on all clients you are using, so for example:<\/p>\n<p><code>:0<br \/>\n* ^From.*bugzilla-daemon@gentoo.org<br \/>\n* ^TO.*amd64@gentoo.org<br \/>\n\/home\/ago\/.maildir\/.INBOX.amd64\/<\/code><\/p>\n<p>And so on&#8230;.<br \/>\nThese, hints obviously are valid on all postfix-based mailserver; if you are using e.g. qmail, you need to move the .procmailrc, but this is still valid.<br \/>\nI hope this will help \ud83d\ude42<\/p>\n<p>EDIT:<br \/>\nIf you need a particular set of rules, you can write it if you take a look at the source\/header of the message, so If for example I don&#8217;t like to see the mails from bugzilla of the bugs that I reported:<\/p>\n<p>the header says: <code>X-Bugzilla-Reporter: ago@gentoo.org<\/code><br \/>\nso:<\/p>\n<p><code>:0<br \/>\n* ^From.*bugzilla-daemon@gentoo.org<br \/>\n* ^X-Bugzilla-Reporter.*ago@gentoo.org<br \/>\n\/dev\/null<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use it since a long time, so since it works pretty good for me, I want to share how to handle the spam for your @gentoo.org address with procmail. First, you need to say that procmail will filter your &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2013\/05\/14\/avoid-the-spam-on-the-gentoo-org-mail-with-procmail\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2EaBc-37","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/193"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":8,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/193\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}