Hi Gordon,

I've setup courier to run perlfilter. However it doesn't seem to be getting run.

I've ensured that /etc/courier/enablefiltering is run for both esmtp and local (since I'm running tests on localhost). I copied the perlfilter-example.pl to perlfilter.pl and altered that for testing.

I believe I've setup perlfilter correctly and the processes are running.

# cat /etc/courier/enablefiltering
local esmtp

# ls /etc/courier/filters/active/
perlfilter

# cat /etc/courier/filters/perlfilter
/usr/lib/courier/share/perlfilter.pl

# ls /var/spool/courier/filters/
perlfilter

# ps auwx|grep perlfilter
daemon   24829  0.0  0.0   3492   744 ?        S    11:15   0:00 perlfilter
daemon   24830  0.0  0.0   5936  1856 ?        S    11:15   0:00 perlfilter
daemon   24831  0.0  0.0   5936  1856 ?        S    11:15   0:00 perlfilter
daemon   24832  0.0  0.0   5936  1856 ?        S    11:15   0:00 perlfilter
daemon   24833  0.0  0.0   5936  1856 ?        S    11:15   0:00 perlfilter
daemon   24834  0.0  0.0   5936  1856 ?        S    11:15   0:00 perlfilter
daemon   25408  0.0  0.0   3492   748 ?        S    11:36   0:00 perlfilter
daemon   25409  0.0  0.0   5936  1856 ?        S    11:36   0:00 perlfilter
daemon   25410  0.0  0.0   5936  1856 ?        S    11:36   0:00 perlfilter
daemon   25411  0.0  0.0   5936  1856 ?        S    11:36   0:00 perlfilter
daemon   25412  0.0  0.0   5936  1856 ?        S    11:36   0:00 perlfilter
daemon   25413  0.0  0.0   5936  1856 ?        S    11:36   0:00 perlfilter

And, just as a test I've altered perlfilter.pl such that it will reject all messages in the filterdata sub, by returning "500 Invalid Date header" regardless of the content.

But if I send a message to myself (locally on the server via pine), the message is accepted and goes through.

What am I missing?

Thanks for your help
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