[Exim] Transport Execution Order

Startseite
Nachricht löschen
Nachricht beantworten
Autor: John R. Shearer
Datum:  
To: exim, exim-users
Betreff: [Exim] Transport Execution Order
I believe that I am having a problem with the order which transports are
executed.

I am trying to use Exim to replace a sendmail/procmail front-end to a
spam filtering system. Odd as it may be, the spam filter needs three
input files: one containing the message, one containing just headers and
one containing just the body (procmail currently generates these three
files and initiates the spam filtering application). I wrote three
routers & transports to create the files and a fourth to execute the
spam filtering application, passing the file specifications as arguments.

The behavior I am seeing is that *usually* the files are created before
the spam filtering application is run, but about 30% of the time at
least one of the files is missing when the application starts. I have
run hundreds of tests and the results are, well, consistently
inconsistent, but about 30% +/- 6%.

I have tried placing the router which initiates the application after
the routers that generate the files, but the routers' transports appear
to always be run in reverse order of the router definitions. I also
tried adding a 10 second pause in my testing program to see if it was a
timing issue, but it had no effect what so ever. This is why I believe
that the transports are being executed out of order.

According to
<http://www.exim.org/exim-html-4.30/doc/html/spec_3.html#SECT3.12>...

"Each local delivery runs in a separate process under
a non-privileged uid, and they are run in sequence. "

Are not my transports considered to be "local deliveries"? If not, then
how can I make them such so that they will be run in sequence?

I'm running Exim version 4.30 compiled on RedHat Linux. Below are my
configs, though I have omitted the definitions of the various macros
(PUREMAILHEADER, EMAILHEADERSPEC, etc.).

Thanks in advance for your insights. - John R. S.


---------------------------- ROUTERS ----------------------

puremail_router:
  driver = accept
  check_local_user = yes
  # The application cannot be run unless we can find
  # what program to execute for this particular local user.
  condition = "${if !eq \
    {${lookup{$local_part}wildlsearch{/etc/exim4/appversions}}} \
    {} \
    {1}{0}}"
  require_files = $home/Mail/allow/
  transport = puremail_transport
  headers_add = PUREMAILHEADER: yes
  unseen = yes


copy_message_router:
driver = accept
check_local_user = yes
transport = copy_message_transport
require_files = $home/Mail/allow/
unseen = yes
headers_add = PUREMAILHEADER: yes
verify = no
expn = no

copy_header_router:
driver = accept
check_local_user = yes
transport = copy_header_transport
require_files = $home/Mail/tmp/
unseen = yes
headers_add = PUREMAILHEADER: yes
verify = no
expn = no

copy_body_router:
driver = accept
check_local_user = yes
transport = copy_body_transport
require_files = $home/Mail/tmp/
headers_add = PUREMAILHEADER: yes
verify = no
expn = no

---------------------------- TRANSPORTS ----------------------

copy_header_transport:
driver = appendfile
use_lockfile = no
file = EMAILHEADERSPEC
headers_only = yes

copy_body_transport:
driver = appendfile
use_lockfile = no
file = EMAILBODY
body_only = yes

copy_message_transport:
driver = appendfile
use_lockfile = no
file = EMAILCOPYSPEC

puremail_transport:
  driver = pipe
  path = "/bin:/usr/bin:/usr/local/bin"
  command = ${lookup{$local_part}wildlsearch{/etc/exim4/appversions}} \
            $home \
            " |~*|*~| $header_Subject: |~*|*~| $header_To: |~*|*~|
$header_From: |~*|*~|" \
            EMAILCOPYSPEC \
            OUTEMAILSEND \
            $return_path \
            EMAILCOPYNAME \
            EMAILBODY \
            EMAILHEADERSPEC