<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hello,<div><br></div><div>We have recently started to block incoming emails with a zip file attachment.</div><div><br></div><div>Here's the bit from our amavisd.conf file:</div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">%banned_rules = (</font></div><div><font face="monospace, monospace"> 'BLOCK_ALL' => new_RE(</font></div><div><font face="monospace, monospace"> [ qr'^text/plain$'i => 0 ],</font></div><div><font face="monospace, monospace"> [ qr'^\.[a-zA-Z0-9]*$' => 1 ] ),</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> 'BLOCK_ZIP' => new_RE(</font></div><div><font face="monospace, monospace"> [ qr'^\.zip$' ],</font></div><div><font face="monospace, monospace"> ),</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> 'DEFAULT' => $banned_filename_re,</font></div><div><font face="monospace, monospace">);</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">@banned_filename_maps = ({</font></div><div><font face="monospace, monospace"> '.<a href="http://domain1.co.uk" target="_blank">domain1.co.uk</a>' => 'BLOCK_ZIP',</font></div><div><font face="monospace, monospace"> '.<a href="http://domain2.com" target="_blank">domain2.com</a>' => 'BLOCK_ZIP',</font></div><div><font face="monospace, monospace"> '.<a href="http://domain3.net" target="_blank">domain3.net</a>' => 'BLOCK_ZIP',</font></div><div><font face="monospace, monospace"> '.<a href="http://domain4.co.uk" target="_blank">domain4.co.uk</a>' => 'BLOCK_ZIP',</font></div><div><font face="monospace, monospace"> '.<a href="http://domain5.co.uk" target="_blank">domain5.co.uk</a>' => 'BLOCK_ZIP',</font></div><div><font face="monospace, monospace"> '.' => 'DEFAULT',</font></div><div><font face="monospace, monospace">});</font></div></div><div><br></div><div>However, naturally now we need to make exceptions. I realise that we can set the above based on recipients' email addresses. But ideally I would like to know if we can make exceptions based on headers (as sender can be easily spoofed).<br></div><div><br></div><div>Something like if email appears to be from <a href="http://smtp.example.com">smtp.example.com</a> allow zip file attachments.</div><div><br></div><div>Does anyone know if this is possible or have any recommendations we can try?</div><div><br></div><div>Many thanks,</div><div>Alex</div></div>
</div><br></div>