Lindsay Haisley writes:

On Wed, 2008-12-17 at 18:21 -0500, Sam Varshavchik wrote:
Courier has several different APIs by which incoming mail can be inspected or filtered before Courier accepts mail from the remote mail server, and, if unwanted, Courier then refuses to accept the message from the remote server.

Please give me some references or clues on this.  I have Courier running
with a global /etc/courier/maildroprc file, which is basically delivery

There's the localmailfilter API, which invokes maildrop recipes to filter mail before it is accepted. The maildrop recipes are user specific. This is only for incoming mail addressed to local mailboxes, and is not used for smarthosed or relayed mail.

The maildrop recipes can only use a subset of the available maildrop functionality, and the setup is somewhat complicated. You have to get several things exactly right -- file permissions, locations, and maildrop syntax, otherwise things will break horribly. See the localmailfilter man page.

The other alternative is the courierfilter API, which is more of a plugin API that provides hooks that Courier runs before it accepts a message. The hook can direct Courier to either accept the message or reject it. While localmailfilter is oriented towards recipient-specific filtering instructions, while courierfilter is more appropriate for global mail filtering policies.

What I would like to do is re-organize this scheme so that Courier or
Maildrop can run SpamAssassin at the SMTP front door, and reject
outright any email with a spam score in excess of a given value, which I
can parse for with Maildrop with "if ( /^X-Spam-Level: *\*\*\*\*\*\*\*\*
\*\*/ ) { .... do something ....}".  /etc/courier/maildroprc is parsed

That's more appropriate for courierfilter, however there is no maildrop-based courierfilter implementation. There are general Perl and Python based skeleton wrappers, where you can plug in your own code.

A Google search comes up with a bunch of Perl-based modules:

http://search.cpan.org/~jmehnle/Courier-Filter-v0.200/lib/Courier/Filter/Overview.pod

One of them is a SpamAssassin module. I am not directly familiar with these Perl plugins, but there seems to be a whole class of Perl modules here that uses the courierfilter API, and it looks rather promising. Julian is subscribed here. Wait for him to yell with more info.


Attachment: pgpxOb1zTRMPk.pgp
Description: PGP signature

------------------------------------------------------------------------------
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to