Ask Bjørn Hansen said the following on 02/21/2006 06:49 AM: > > On Feb 19, 2006, at 4:57 PM, Robin Bowes wrote: > >> 1. Is this normal? i.e. is it correct that this is getting called three >> times? > > > Johan explained this well. > >> 2. If it is normal, how to I detect the final time it is called as I >> only want to log the accepted mail details once? i.e. what changes >> between calls to reset_transaction? > > > Instead of storing the log entry as it's being built in $self->{} you > could use a transaction note; that way it'll be cleared out > automatically with the transaction. (Look for "sub reset_transaction" > in lib/Qpsmtpd/SMTP.pm or lib/Qpsmtpd.pm in trunk > http://svn.perl.org/qpsmtpd/branches/0.3x/lib/Qpsmtpd/SMTP.pm http:// > svn.perl.org/qpsmtpd/trunk/lib/Qpsmtpd.pm )
Ask, I'm still not clear about how this works. I'm not actually storing anything - just reading what qpsmtpd does. What I want to do is log the email sender and recipients at the point when the mail has been accepted for delivery. What I'm not sure of is how to detect when the mail has been accepted for delivery. Any pointers would be appreciated. R.