[exim] Injecting emails directly into a router/transport

Top Page
Delete this message
Reply to this message
Author: Ted Cooper
Date:  
To: Exim Users
Subject: [exim] Injecting emails directly into a router/transport
Hi all,

I have a desire to inject emails which have been received via getmail
into my Exim server so that they skip everything but a specific router.
The router hands off processing to an "Exim filter" file which sets up
final deliveries to the correct Maildirs.

The desire comes about from having many email accounts being fetched
using getmail via POP/IMAP which are then all fed into my inbox.
Previously, these emails were then processed through my MUA's Message
Filters to they all ended up in the correct Maildirs. The loss of all of
these filters meant changing tack.

The "Exim filter" works just fine for all emails which are delivered
normally to the server, but those pulled in via getmail skip Exim
entirely by being written to the Maildir directly.

I could setup getmail to filter the emails itself into the correct
locations, but I would rather have all of the filtering in the one
.forward file.

The To:, From:, Delivered-To:, etc. headers are not consistent so piping
each into Exim via "exim -bm -t" may end up emails being delivered
externally (loop!) our bounced out (bad!). One option would be set set a
safe (local) bounce and recipient addresses on the command line.

Given that the old style spam filtering used to have emails piped out to
processes and then re-injected into a router/transport, and that I know
the $domain, $local_part and router I want to use, what are the command
line arguments I want to be using to do this? My google foo has so far
failed me even when I go look at the old spam scanning instructions.

The only hint I have so far is that I could structure the injected
emails like BSMTP and call "exim -bS -oMr userfwd", but then I would
need a program to convert a raw email into bsmtp.

Or should I throw out my Exim filter and use procmail as MDA for both
Exim Maildir and getmail deliveries. Injecting emails back into Exim is
really an attempt to make Exim+Exim filter my MDA so I may be
overloading things.