Re: [EXIM] Remove attachments

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Philip Hazel
Data:  
Para: Marc Haber
CC: exim-users
Assunto: Re: [EXIM] Remove attachments
On Mon, 7 Jun 1999, Marc Haber wrote:

> That's what I'd call a dirty hack ;-)


Me too.

> It will break if one uses the "large spool dir" option (but anybody
> doing this will probably have that much load on his machine that they
> wouldn't do any scanning on the mail server.


It can look in both possible places for the file (that is what Exim
does, to allow for turning the option on/off).

> It will break if somebody moves the spool directory.


It can call /usr/lib/sendmail -bP spool_directory to find where the
spool directory is. Or it can be passed $spool_directory.

> It will break if you change the spool directory layout.


True. But that's highly unlikely. And in fact, if you just want to
*read* the body of a message, "exim -Mvb <message id>" will do that for
you. No need for any of these worries.

> In <Pine.SOL.3.96.990604112959.8350H-100000@???>, you
> say that "you can't really tamper with the message body in a system
> filter". While it is clear now that exim can't do this at the moment,
> are there reasons in the exim code that would make implementation
> expensive?


The existing file is open and locked to act at the "delivery lock" on
the message. I don't see a safe way of updating it while this remains
the case. You wouldn't want to write to it in place, in case there was a
crash halfway through. (But as I said before, a simple truncation is
less of a problem.) You would want to write to a new file and rename,
but that would defeat the locking. Therefore, in order to do this, Exim
would have to be changed to use some entirely different method of
locking a message during delivery. I imagine it would have to create a
new file specifically for this purpose. OTOH, perhaps taking out a lock
on the new file before renaming might be sufficient. I would have to
check up on that.

> if $header_Content-Type: multipart/mixed then
>   if pipe_message "virus_scan()" <> 0 then
>     fail
>   endif
> endif


I see the attraction of that kind of approach. However, if it really is
just a virus scan (no modification of the message) then running embedded
Perl and using "exim -Mvb" to read the body is just a slight variation
on your syntax, and you can do that already. It's the modification of
the message that poses the problem.

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



--
*** Exim information can be found at http://www.exim.org/ ***