Re: [exim] am I crazy - writing message details to a log fil…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Marcus Barczak
Datum:  
To: exim-users
Betreff: Re: [exim] am I crazy - writing message details to a log file on successful routing
On 26/06/2006, at 6:51 PM, Philip Hazel wrote:

> Here's a kludge. I assume your successful router is routing the
> address
> to a transport. If so, you can use the fact that the "transport"
> option
> is expanded.


Hi Philip, at the moment i'm using a number of routers to achieve a
range of different mail routing scenarios, each router is routing to
a transport. I wasn't aware the transport option was expanded, this
could be a suitable workaround for the time being.

> (Best performance would probably be obtained by writing a
> daemon that listens on a socket and have Exim write to the socket.)


This was destined to be my ideal final solution as we need to include
some other message processing functionality - essentially having the
message arrive, get passed out for some processing, then passed back
to exim for final delivery. However at the moment me need is to come
up with an interim solution to relieve the load on the system.

> Alternatively, why not do the archiving from a system filter? That
> runs
> per-message rather than per-recipient (saving some resources), and
> there's no problem writing to a file directly from the filter,
> using the
> logwrite command.


I looked into system filters however we aren't archiving every
message that passes through the system. We offer the archiving and
off-site backup of messages as an optional service for our customers
(by domain) and couldn't find a way of doing lookups from a system
filter. The current archive router declarations (first entries in
the router config block) look like this:

archive_in_router:
driver = accept
condition = ${lookup{$domain}lsearch{/etc/mail/archive_domains}
{yes}{no}}
transport = archive_incoming
unseen = true

archive_out_router:
driver = accept
condition = ${lookup{$sender_address_domain}lsearch{/etc/mail/
archive_domains}{yes}{no}}
transport = archive_outgoing
unseen = true

Then get passed onto delivery routers. Thanks for the tips Philip,
will have a play and see how it goes.

Cheers,
Marcus