is there any chance of rfc5703 (mime support/extension) being added to pigeonhole? I am trying to filter mail with .exe and .zip attachments, to no success. I have tried *header :contains "x-attached" [".zip", ".exe"] *but emails i'm getting don't have x-attached. a sample snippet is below. Subject: testa1 Content-Type: multipart/mixed; boundary="------------020304040002050407030900" This is a multi-part message in MIME format. --------------020304040002050407030900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit this has a compressed file added a1 --------------020304040002050407030900 Content-Type: application/x-zip-compressed; name="pinglog.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="pinglog.zip" I have tried *header :contains ["Content-Type","name","filename"] ["application/x-zip-compressed",".zip",".exe"]* but that doesn't work either. I can't use body because that doesn't include the mime headers, so the only way I can see is to use mime (aka rfc5703) I am using dovecot 2.1.8 with pigeonhole 0.3.3 (and am about to use dovecot 2.2.9 with pigeonhole 0.4.2 on another server) If I'm just missing the point, or there is already support, please point me in the right direction.
Hi, On 1/30/2014 7:50 PM, Tim Dickson wrote:> is there any chance of rfc5703 (mime support/extension) being added to > pigeonhole?There are plans for that, but there is no concrete timeline.> I am trying to filter mail with .exe and .zip attachments, to no success. > > I can't use body because that doesn't include the mime headers, so the > only way I can see is to use mime (aka rfc5703) > I am using dovecot 2.1.8 with pigeonhole 0.3.3 (and am about to use > dovecot 2.2.9 with pigeonhole 0.4.2 on another server) > If I'm just missing the point, or there is already support, please > point me in the right direction.You only need to test for the existence of certain attachments: require "body"; require "relational"; require "fileinto"; if body :count "gt" :content "application/x-zip-compressed" "0" { fileinto "Zip"; } else { fileinto "NoZip"; } This tests whether there are more than zero message parts with content-type "application/x-zip-compressed". Regards, Stephan.
On 30 Jan 2014, at 11:50 , Tim Dickson <dickson.tim at googlemail.com> wrote:> I am trying to filter mail with .exe and .zip attachments, to no success.Are you using postfix with dovecot? $ cat mime_headers.pcre /^\s*Content-(Disposition|Type).*name\s*=\s*"?(.*\.(ade|adp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|hlp|hta|inf|ins|isp|js|jse|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|nws|ops|pcd|pif|prf|reg|scf|scr\??|sct|shb|shs|shm|swf|vb[esx]?|vxd|wsc|wsf|wsh))(\?=)?"?\s*(;|$)/x REJECT Attachment name "$2" may not end with ".$3? $ grep mime main.cf mime_header_checks = pcre:$config_directory/mime_headers.pcre -- "Conservatives want live babies so they can raise them to be dead soldiers" ~Carlin