Am 16.09.2014 um 22:28 schrieb Viktor Dukhovni:
> On Tue, Sep 16, 2014 at 10:15:03PM +0200, li...@rhsoft.net wrote:
> 
>> I removed all comments AFAIK
>> that are 3 single lines without any break not added by the mail-client
> 
> I've copied the rule below into my test file, and it works:
> 
>     $ postmap -q 'Content-Type: name="test.exe"; charset=us-ascii' 
> pcre:/tmp/foo.pcre
>     REJECT 554 Attachment Blocked (Rule 0)
> 
> You've not posted your test input or postmap -q invocation with output.

i just created a new empty file, named it "test.exe" and attached it to
a mail in Tunderbird, only Rule 3 hits - hence the numbering

your input does not contain what thunderbird passes

no idea what the ? is for in the log, i just can't reproduce only
Rule 3 hitting like with using the MUA

Sep 16 22:13:02 mail-gw postfix/cleanup[16214]: 3hyFxB6g0cz1y: reject: header 
Content-Type:
application/octet-stream;? name="test.exe" from *.*.*.*; from=<***> to=<***> 
proto=ESMTP
helo=<srv-rhsoft.rhsoft.net>: 5.7.1 554 Attachment Blocked (Rule 3)

[root@mail-gw:~]$ postmap -q 'Content-Type: name="test.exe"; charset=us-ascii' 
pcre:/etc/postfix/mime_header_checks.cf
REJECT 554 Attachment Blocked (Rule 0)
[root@mail-gw:~]$ postmap -q 'Content-Type: application/octet-stream;? 
name="test.exe"'
pcre:/etc/postfix/mime_header_checks.cf
REJECT 554 Attachment Blocked (Rule 1)
[root@mail-gw:~]$ postmap -q 'Content-Type: application/octet-stream; 
name="test.exe"'
pcre:/etc/postfix/mime_header_checks.cf
REJECT 554 Attachment Blocked (Rule 0)

>> # Reject Attachment Extensions
>>
>> /^Content-(?:Disposition|Type):
>>   (?:.*?;)? \s*
>>   (?:file)?name \s* = \s*"?
>>    (
>>    .*?(\.|=2E)
>>      
>> (386|acm|ade|adp|awx|ax|bas|bat|bin|cdf|chm|cmd|cnv|com|cpl|crt|csh|dll|dlo|drv|exe|hlp|hta|inf|ins|isp|jse|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|nws|ocx|ops|pcd|pif|pl|prf|reg|scf|scr|script|sct|sh|shb|shm|shs|so|sys|tlb|vb|vbe|vbs|vbx|vxd|wiz|wll|wpc|wsc|wsf|wsh)
>>    )
>>    (?:\?=)?
>>    "?
>>    \s*(;|$)
>>  /x   REJECT 554 Attachment Blocked (Rule 0)
>>
>> /^\s*Content-(Disposition|Type).*name\s*=\s*"?(.*(\.|=2E)(386|acm|ade|adp|awx|ax|bas|bat|bin|cdf|chm|cmd|cnv|com|cpl|crt|csh|dll|dlo|drv|exe|hlp|hta|inf|ins|isp|jse|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|nws|ocx|ops|pcd|pif|pl|prf|reg|scf|scr|script|sct|sh|shb|shm|shs|so|sys|tlb|vb|vbe|vbs|vbx|vxd|wiz|wll|wpc|wsc|wsf|wsh))(\?=)?"?\s*$/x
>>  REJECT 554 Attachment Blocked (Rule 1)
>>
>> /^\s*Content-(?:Disposition|Type):(?:.*?;)?\s*(?:file)?name\s*=\s*"?(.*?(\.|=2E)(386|acm|ade|adp|awx|ax|bas|bat|bin|cdf|chm|cmd|cnv|com|cpl|crt|csh|dll|dlo|drv|exe|hlp|hta|inf|ins|isp|jse|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|nws|ocx|ops|pcd|pif|pl|prf|reg|scf|scr|script|sct|sh|shb|shm|shs|so|sys|tlb|vb|vbe|vbs|vbx|vxd|wiz|wll|wpc|wsc|wsf|wsh))(?:\?=)?"?\s*(;|$)/x
>>   REJECT 554 Attachment Blocked (Rule 2)
>>
>> /name=[^>]*\.(386|acm|ade|adp|awx|ax|bas|bat|bin|cdf|chm|cmd|cnv|com|cpl|crt|csh|dll|dlo|drv|exe|hlp|hta|inf|ins|isp|jse|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|nws|ocx|ops|pcd|pif|pl|prf|reg|scf|scr|script|sct|sh|shb|shm|shs|so|sys|tlb|vb|vbe|vbs|vbx|vxd|wiz|wll|wpc|wsc|wsf|wsh)\"/
>>  REJECT 554 Attachment Blocked (Rule 3)

Reply via email to