Re: [Exim] Two queries: Address writing and embedded perl

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: David Pashley
CC: exim-users
Subject: Re: [Exim] Two queries: Address writing and embedded perl
On 11 Dec 2001, David Pashley wrote:

> I have the following rewrite rule in my
> configuration.
>
> david@???
> ${lookup{$header_to:}lsearch{/home/david/.mailing-lists}\
>                         {$value}fail} frFs

>
> [that should be on 2 lines, but got wrapped in my editor]
>
> .mailing-lists contains:
>
> exim-users@???: exim-users@???
> david-test@???: test@???
>
> This seems to work. This message should go through the rewrite.
> Does anyone have experience of doing something like this? Are there any
> pitfalls to look out for. Will it cope with messages where the mailing
> list is CCed?


No. It also won't cope when the To: header contains more than one
address.

> I currently use exiscan to check mail for viruses, but I'm not entirely
> happy with the method it uses. I was considering using a perl function
> in a condition on a director or router, which returned true or false
> depending on whether the mail was infected. It this realistic? Again are
> there any pitfalls to lookout for? Would it be bad for the perl function
> to change the file in the spool directory?


1. Yes.
2. Yes.
3. Yes, because if the system dies while you are in the middle of
changing it, you could get a scrambled file. If you changed the
number of lines, the value of $body_linecount, which is stored in the
-H file, would be wrong.

In Exim 4, you can provide a function written in C to do this kind of
checking as a message is received, before the final "OK" response is
sent to the sender host. That is more efficient (C not Perl - though of
course the C can call Perl if it wants), and also means you can do the
check before accepting the message.


--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.