[exim] How to catch attachments with non-ascii names?

Top Page
Delete this message
Reply to this message
Author: Alexander Shikoff
Date:  
To: exim-users
Subject: [exim] How to catch attachments with non-ascii names?
Hello,

as you know a lot of MUAs allow user to add the attachments with non-ascii
names (koi8-r, cp1251 etc.). For example, the header of attachment made
by mutt looks like

Content-Type: application/vnd.ms-powerpoint
Content-Disposition: attachment; filename*=koi8-u''%D4%C5%D3%D4%2Epps
Content-Transfer-Encoding: base64

In such case exim isn't able to get the filename of attachment in
$mime_filename variable. Therefore such attachments cannot be catched
neither by construction:

acl_smtp_mime = acl_check_mime
[...]
acl_check_mime:
    warn
    message         = Attachment: $mime_filename 
    log_message     = Attachment: $mime_filename 
    condition       = ${if match{$mime_filename}{\N\.(bat|btm|cmd|com|cpl|dll)\N}}


nor by 
acl_check_data:
       deny
        message = This message contains an attachment of an unwanted type (.$found_extension)
        demime = bat:btm:cmd:com:cpl:dll:lnk:msi:pif:prf:reg:scr:vbs:url


Can anybody suggest the best way to catch extensions with filename in
any charset?

Thanks a lot!

-- 
Kind Regards,    Alexander Shikoff
minotaur@???