Re: [exim] Special log after mail has been delivered

Góra strony
Delete this message
Reply to this message
Autor: Evgeniy Berdnikov
Data:  
Dla: exim-users
Temat: Re: [exim] Special log after mail has been delivered
On Mon, May 06, 2013 at 10:02:35PM +0200, Heiko Schlittermann wrote:
> Evgeniy Berdnikov <bd4@???> (Mo 06 Mai 2013 21:48:19 CEST):
> > On Mon, May 06, 2013 at 07:04:36PM +0100, Klaus Ethgen wrote:
> > > I need to write special logs to a database when the mail is received and
> > > after it has been (successful or not) delivered as well as when it
> > > bounces.
> > >
> > > For the first I can use a condition in acl to call a own embedded perl
> > > script that is doing the stuff. But for the other two logging issues I
> > > did not found any way to call a perl subroutine. The best I can archive
> > > is to have a condition in the router. But this gives me no way to see
> > > the status of the delivered mail.
> > >
> > > Do you see any way to do it?
> >
> > It seems me you have no chances to catch ALL the bounce cases in routers
> > and transports: there may be situations such as insufficient memory for
> > Exim, disk overflow and others... I belive the only reliable solution is
> > to parse logs and extract relevant entries.
>
> A bounce will go through a transport, otherwise the bounce isn't a
> bounce, is it?


The internally generated bounce mail should go through a transport, yes.
But for a situation, when Exim acts as a server and reject mail in SMTP
session, no internal mail is generated for bounce. It's unclear is this
case interesting for topic starter or not.

Then, some temporary error as malloc() failure can happen at the moment
when no router/transport is running, so this situation can not be catched
by configuration handler, but must be logged.

> > Parsing may be done on the fly, via exim -> syslog -> program(pipe),
> > of logging to program via named pipe (man fifo), or some other way.
>
> If you're interested in reliable logging, you should not use logging to
> syslog. Exim has no feedback, if the log entry is really written.
>
> I'd say, the built-in logging facility of Exim is much more mature,
> since it stops message reception in face of logging problems. IMHO a
> very crucial element of a safe and secure mail service.


Agree. However, writing to named pipe is so safe as writing to a file:
if nobody reads pipe, then writer is blocked.
--
Eugene Berdnikov