Alessandro Vesely writes:
On 01/May/10 00:03, Sam Varshavchik wrote:Alessandro Vesely writes: [... whitelisting with maildrop filtering API ...]No, you don't need smtpfilter in that case. Just install rcptfilter that terminates with a 0 exit code.That is to make it whitelisted, right? However, since terminating with 0 is the default, why isn't that tantamount to having no rcptfilter?
No, there is no difference.
Since the rcptfilter never returns 99, the smtpfilter is never checked.Fine. What I still don't understand, is how should the other users say that they /want/ the global filter to be run. I've always used "allfilters", so I'm not familiar with this at all.
This is a three-step process.First, each local recipient's rcptfilter runs, if it exists. A nonexistent rcptfilter is considered a whitelisted result, for these purposes. The first recipient's result determines whether the entire message is considered to be whitelisted or not.
In the second step, courierfilters are run. This stage uses courierfilters installed in either the filters or the allfilters directory, depending upon whether the message is whitelisted, or not.
In the third step, if the message is not whitelisted, each local recipient's smtpfilter runs to selective reject the message for that recipient only.
BTW, is outgoing mail considered whitelisted by default?
Yes.
After the splitting mechanism, yet another possibility to whitelist global filters, in case one runs multiple ones, is to return "000 Ok." from, say, 0filter (the first one in its directory). However, this kind of "STMP response" is not documented in http://www.courier-mta.org/courierfilter.html so Sam's confirmation is needed also for this bit.No -- that won't work. Courier itself supplies the SMTP result code, based on the exit status of the filter script.Err... I meant 0filter to be a filter, not a script. I spotted some code near the end of the dofilter() function that sets rc=-1 if the first char of the response is '0', but I'm not sure what functionality it is meant to provide.
There may be multiple global filters that get installed. This is a mechanism by which a global filter indicates that filtering should stop and a message is to be accepted. In run_filter():
if (rc)
return (rc < 0 ? 0 : rc);
So the negative return value is suppressed, and becomes 0. Meanwhile, the
negative return value aborts the loop in run_filter_dir() that goes through
the filters in alphabetical order.
pgp8qqPsztMfZ.pgp
Description: PGP signature
------------------------------------------------------------------------------
_______________________________________________ courier-users mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
