Sam Varshavchik <[EMAIL PROTECTED]> wrote:
> Julian Mehnle writes:
> > 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.

But the recipient address(es) should still be known in this step, so wouldn't it make 
sense to include it/them in the error log message?  It's not as if the recipient 
address was the cause for the rejection in the DNS blacklist case, so why is it 
included *there*?

> 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.

I don't want to pollute my SMTP error messages with that.  I'll take the way Gordon 
suggested and insert the log records directly into the SQL database from my 
courierfilter.  May I'll also create a courierfilter to do DNS blacklist checks, so I 
can save the message's subject in the SQL database as well, which would greatly 
increase the users' "Rejected Messages" list's usefulness.

Thinking more about it, I think this is a nice idea, since it also enables me to apply 
DNS blacklist checks based on per-user preferences.  On the other hand, it requires 
every message to be completely received before it can be rejected due to the sending 
host being listed on a DNS blacklist, which wouldn't normally be the case otherwise.

Thanks, Sam and Gordon, for your suggestions!



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to