Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] General procmail question



On Sat, 4 Jan 2003 13:25:29 +0100, Godwin Stewart
<gstewart@example.com> wrote to Tokyo LUG <tlug@example.com>:

> What I therefore need to do is get procmail to use mfilter.pl somehow.

For those who are interested, I cracked it with a small program in C I
called "chkmail".

I've edited my sendmail.cf so that local delivery no longer happens through
procmail but through chkmail instead. chkmail is invoked with exactly the
same command line parameters as procmail. What it does is:

1) Make a note of the command line parameters with which it was invoked.

2) Read the incoming mail from stdin and separate headers from body.

3) Add an "X-PassedThrough:" header so I know it's been processed by
chkmail.

4) Pass the headers through my super-duper spam-stomping Perl script and add
my (in)famous "X-SpamTagged-By:" header if it is spam.

5) Invoke procmail with the command line parameters noted in 1) and pipe the
new headers, then the body through it.

If procmail sees the "X-SpamTagged-By:" header it'll divert the mail to a
"spam" mbox.

Since this filtering now takes place upon local delivery, all three ways a
mail can get into my box are now protected.

Time for bed :)

-- 
G. Stewart   --   gstewart@example.com
                  gstewart@example.com
Registered Linux user #284683

GnuPG key  : BA3D01C6 (pgp.mit.edu)
Fingerprint: C3DF C686 6572 6E59 E3E4  0F40 2B9A 2218 BA3D 01C6
---------------------------------------------------------------
There is a theory which states that if ever anybody discovers exactly
what the Universe is for and why it is here, it will instantly disappear
and be replaced by something even more bizarre and inexplicable. There
is another theory which states that this has already happened.

Attachment: pgp00013.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links