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.