Thanks, that really helps!

Reading up on courierperlfilter, it says that each message may have more than one control file. When would that be the case? If multiple control files, what would one have that the other doesn't?

Ricardo
----- Original Message ----- From: "Gordon Messmer" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, March 18, 2006 9:55 AM
Subject: Re: [courier-users] verify envelope sender?


Ricardo Kleemann wrote:

I'm somewhat confused as to how exactly this works and should work. I have an /etc/courier/maildroprc which runs some checks and may return an error.
For example, I have this:

if ($RECIPIENT =~ /321.net$/)
{
       STAT=`/usr/local/bin/check_config $RECIPIENT`
       if ($STAT =~ /^Error:/)
       {
               echo "550 $STAT"
               EXITCODE=77
               exit
       }
}

Don't do that in maildroprc. Once you've accepted mail (via smtp), it's your responsibility to make sure that it's delivered. By accepting the mail, you're promising the sender that you'll handle all further processing.

If you have a set of conditions under which you will refuse to process mail, the best place to process them is in a global mail filter (see the man page for courierfilter). In addition to the example filters included with Courier, there are frameworks available in Perl and Python (I wrote the one Python framework). If you refuse a message via a global mail filter, the message won't be accepted by Courier's SMTPd, and the sending MTA will generate its own DSN for the sender. You won't get any from your own system.

Additionally each user has a .mailfilter file which may also output an error (for example if a virus is found). In all cases, I'm asserting EXITCODE=77,
and print out an error message.

Do that in a global filter, too. There are a couple of ways to get clamav hooked up to a global mail filter. There's a dedicated daemon written in C, and a filter in the pythonfilter package.




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to