16 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Filtering messages
FromSent OnAttachments
LucioFeb 18, 2005 1:05 am 
Alessandro VeselyFeb 19, 2005 3:53 am 
LucioFeb 21, 2005 12:23 am 
Bill MichellFeb 21, 2005 1:33 am 
Julian MehnleFeb 21, 2005 9:10 am 
Julian MehnleFeb 21, 2005 9:24 am 
Gordon MessmerFeb 21, 2005 10:17 am 
Alessandro VeselyFeb 22, 2005 12:42 am 
Martin OrrFeb 22, 2005 9:30 am 
Gordon MessmerFeb 22, 2005 10:02 am 
Alessandro VeselyFeb 22, 2005 10:54 am 
Martijn LievaartFeb 22, 2005 11:45 am 
Jay LeeFeb 22, 2005 12:05 pm 
Jerry AmundsonFeb 22, 2005 12:05 pm 
Martijn LievaartFeb 23, 2005 1:08 am 
Martijn LievaartFeb 23, 2005 1:10 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Filtering messagesActions...
From:Alessandro Vesely (ves@tana.it)
Date:Feb 19, 2005 3:53:00 am
List:net.sourceforge.lists.courier-users

Lucio wrote:

[...] Rejects all outgoing messages if they do not specify "bigbrother@localdomain" in one of the headers.

Courier already has a big-brother option. Check it out in etc/courierd before you proceed. If you are going to test a filter, setting an ARCHIVEDIR is a convenient way to debug control files.

Anyway, keep in mind that the filter is not told if the message is incoming or outgoing: it must examine the control file and the environment to make its own decisions.

[...] What's easier? Learning perl (which would be useful anyway) to the point I need or writing a filter in C?

I did learn (some) Perl. Nicely documented on debian systems... but Vromans' pocket reference is helpful. You have to learn how to download and install modules, and you'll discover a new world. Done that, Perl is much more cryptic than C and every time I have to use it I need to re-squeeze my brains. However, if you can afford to spend several days teaching yourself Perl, I'd recommend you do so.

What about a bash script? Can I put a bash script in the filters directory? Can I put any kind of executable in there?

It is difficult to write a bash script that behaves correctly. Take a look at courierfilter.c and the example filters provided. Additionally, there is a
forking C-written filter at <http://www.tana.it/sw/avfilter/>. If you are in a hurry, you may be better off adapting a bare filter interface from one of those
examples and executing a shell script from there. That way you get the best from both.

And what about Java (let alone performance)?

Java : Perl = Heaven : Hell. As the former is so easy, formally correct and incredibly prolix, the latter is more tempting. I'd remain on the Earth :-)

How do I add the new address to the CC list (regardless of the language I use)?

Append it to the control file(s) or else issue an independent sendmail of the mail file.