Re: [exim] Redirecting mails with Zip attachments with Exim

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] Redirecting mails with Zip attachments with Exim
On 25/05/16 20:48, Jonathan Gilpin wrote:
>    condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}}


You could hoist the \. to before the (alternates) to save eye-clutter


> warn    message = X-Redirect-To: jodie@???
>         condition = ${if match {${lc:$mime_filename}}{\N(\.zip)$\N}{1}{0}}


Pointless parentheses in the regex; only one alternate.

Deprecated use of message= on a warn verb.
Prefer add_header, placed after the condition.

Should work, though.

> zip_redirect:
>      driver = redirect
>      condition = ${if def:h_X-Redirect-To: {1}{0}}
>      headers_add = X-Original-Recipient: $local_part@$domain
>      data = $h_X-Redirect-To:
>#      headers_remove = X-Redirect-Zip-To
>      redirect_router = dnslookup


Looks plausible, depending on where you placed it in your routers.
The redirect_router might be unneeded, if dnslookup is the first
router in the chain anyway.

Can you set up a testcase, and run with debug? Then you will
see the processing sequence.
--
Cheers,
Jeremy