Julian Mehnle writes:

/etc/courier/esmtpd), I get log entries of this format:

  Oct  9 03:37:30 io courieresmtpd:
error,relay=::ffff:68.35.83.35,from=<[EMAIL PROTECTED]>,to=<[EMAIL PROTECTED]
.net>: 511 Blocked - see http://www.spamcop.net/bl.shtml?68.35.83.35

But when a mail gets rejected due to my custom filter, I get log entries
of this format:

  Oct  9 03:59:00 io courieresmtpd:
error,relay=::ffff:217.88.243.27,from=<[EMAIL PROTECTED]>: 511 Just
testing...

The "to=<...>" part is missing.

This is because courierfilter runs after the message was received via DATA, and not in response to a RCPT TO.


                                I need this because I parse the log files
for rejection messages and create records in a PostgreSQL database, so my
users can use a web front-end to look up whether mails directed to them
have been rejected by the mail server.  Without the "to=<...>" part, I'm
unable to assign the rejection records to users.

The only thing you could do is read the control file to obtain the recipient list of the original message (there may be more than one, and courierfilter is invoked once, no matter how many recipients the message has, and some of those recipients may be remote recipients) and include the recipients' addresses in your error message.


Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to