Re: [Exim] Rewriting headers with transport_filter / content…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Tore Anderson
Date:  
À: exim-users
Sujet: Re: [Exim] Rewriting headers with transport_filter / contents of $header_*
* Tore Anderson

 > >     local_delivery:
 > >       driver = pipe
 > >       transport_filter = /bin/modify-subject
 > >       command = /bin/save-to-disk
 > >       environment = <; SUBJECT=$h_subject:

> >
> > My problem is that $h_subject: is still the old subject as it was
> > before the transport_filter was run. Is it possible to make Exim
> > regenerate its $header_* variables based on the output from the
> > transport_filter before setting the environment?


* Philip Hazel

> No, because the transport filter is run simultaneously with the actual
> delivery that a transport does. It really is an "inline filter". All
> expansion and setup is done previously.


Ok, I feared that was the case.

> Perhaps you need headers_add and headers_remove instead?


I've thought about it, but as the subject is only modified under
certain conditions (/bin/modify-subject is indeed spamassassin's
spamc, I changed it to better concretise my problem).

I figured I could modify spamassassin slightly, so it just printed
out the headers it wanted to add/modify, and incorporate that into
a headers_add directive using ${run {..}} - but as far as I can see,
the message itself is not passed to the standard input of whatever
command I use, so it's impossible to use that method. Anyway the
specifications states this about headers_add:

    Because the addition does not happen until transport time, header
   lines that are added by headers_add are not accessible by means of
   the $header_xxx expansion syntax.


..so headers_add/remove is anyway inappropriate for me, regardless
of if it I could to pipe the message into a ${run {}}-expansion or no.

I don't have an absolute need to modify the subject, but I have to
somehow figure out whether or not the transport_filter (or something
similar to that) deemed the message to be spam, and need to pass that
on to the delivery program trough the environment.

Is there any way of accomplishing this, short of setting up a
sandwish-configuration where Exim delivers to SpamAssassin which
in turn delivers to Exim again which then makes the final delivery?
(I fear such a setup will be much too expensive.)

local_scan() is not unfortunately a good solution either, as it
does not allow for sufficient per-user customization.

--
Tore Anderson