procmail
[Top] [All Lists]

Mailchain optimisation [Long and possibly OT]

2009-05-30 08:23:07
Hello all,

Sean's comments in reply to my previous thread have given me cause to
stop and reconsider my current mail setup.

This message is likely to be long and may veer off-topic. Nevertheless I
would greatly appreciate any help, suggestions or advice that can be
offered given the amount of expertise and experience gathered on this
list...

Background
==========

This is a home server. I am not a sysadmin just an interested hobbyist.
I am currently running Fedora 9. My current mailchain is as follows:
fetchmail->procmail(->clamav->spamassassin)->dovecot
I use mbox format (not maildir).

All software is installed and kept updated via yum (with the exception
of clamav/clamd which is compiled from source) and is therefore the most
recent available in the Fedora repositories. 
Currently:
fetchmail release 6.3.8+GSS+RPA+NTLM+SDPS+SSL+HESIOD+NLS+KRB4+KRB5
procmail v3.22 2001/09/10
Version 8.14.2 

There are just 3 users: mark (me), wife, son.
I have mail accounts with at least 4 different ISPs at least one of
which is a catch-all address. One is a vanity domain address and is of
the form whateverIwant(_at_)myvanitydomain(_dot_)demon(_dot_)co(_dot_)uk (the 
".demon.co.uk"
bit is real). I used to use this extensively:
me@@myvanitydomain.demon.co.uk
mybusinessname(_at_)myvanitydomain(_dot_)demon(_dot_)co(_dot_)uk
wife(_at_)myvanitydomain(_dot_)demon(_dot_)co(_dot_)uk
son(_at_)myvanitydomain(_dot_)demon(_dot_)co(_dot_)uk

and also for creating a separate identity for each website or
mailinglist I registered with - the idea being that I could keep track
of any misuse of my email address. I have since come to realise that
this is of little benefit and I have moved away from this - nevertheless
I still need to deal with quite a lot of mail in these various names.

Other accounts (e.g. gmail, autoforward to one of the above ISPs and get
collected from there).

Current Setup
=============

I have had the following setup for so long I can't remember just when I
did it - probably around Fedora Core 2 or 3 (but I have used every
distro since RedHat 6). With only minor tweaking and tinkering it has
worked fine since then.

Mail is delivered into /var/spool/mail/username (currently 4 - root,
mark, wife, son). I am assuming this is the default Fedora setup as I
don't remember changing anything, but I confess I don't really
understand it.

I run fetchmail as user "mark" (I believe that running fetchmail as root
is deprecated). This collects POP mail from each of the 4 ISPs.
Fetchmail hands off to procmail. In my /etc/procmailrc I have the
following settings:
        SHELL=/bin/bash
        PMDIR=/home/mark/Procmail
        LOGFILE=/var/log/procmail/pmlog
        MAILDIR=/home/mark/Msgs
In processing the mail I first take a copy of *all* mail and put it in a
backup folder which gets archived weekly.
I then have a series of INCLUDERC files which:
1) Remove any well tested regular spam patterns and consign them to the
/dev/null pit of doom
2) Extract any trusted mailing lists (such as this one) and deliver them
directly into organised directories
3) Filter against a list of my known addresses (see above) anything
addressed to an unknown name goes into a "possible spam" folder for
review. This is still required because someone may mistype one of the
real names or it may be from something I registered in the past but have
not included in my list yet.

Next I send stuff of to clamd for virus (and extra SaneSecurity etc.
signatures).
Then it goes to spamc for spammassassin checking.

Anything returning unmolested from that lot then gets filtered for
wife/son and delivered to /var/spool/mail/username. This is the bit
which Sean feels should be done by sendmail (and I agree).

Then (still in /etc/procmailrc) I have another INCLUDERC that sorts my
mail into various mail folders that I have organised (I know that this
should be done by ~/.procmailrc but I can't get that to work - see
below).

Anything left drops through into /var/spool/mail/mark


Problem 1
=========

What triggers $HOME/.procmailrc ?

I do have a /home/mark/.procmailrc but it does not seem to get used (I
have tried) and hence I do my personal mail folder organisation using an
INCLUDERC off of /etc/procmailrc.

Is this because the mail goes into /var/spool/mail/username?


Problem 2
=========

How do I rope sendmail in to help me here (apologies for OT)?

I have tried the following experiment:

I created the following entry in /etc/mail/virtusertable
joebloggs(_at_)myvanitydomain(_dot_)demon(_dot_)co(_dot_)uk     son
(and ran makemap hash /etc/mail/virtusertable.db <
/etc/mail/virtusertable) and restarted sendmail for good measure.
I also allowed the joebloggs entry through my filter.
I changed the MAILDIR directive to be MAILDIR=$HOME (and also tried
MAILDIR=$HOME/Msgs)

I then sent myself a mail to that address. As it did not touch any of
the aforementioned filters it dropped straight through but was delivered
into MY Inbox - not "son" as I would have expected / hoped. (On a couple
of tests was delivered as msg.VSlK or somesuch - but still in MY /home).

Why? Is it perhaps because fetchmail is called by user "mark"?
Any tests I can try to see if sendmail is actually registering the
virtusertable entry?



So - over to anyone still reading. (Apologies again for rambling OT
post). If anyone has any helpful suggestions or tests or troubleshooting
ideas I would be very grateful. 

Remember please that the above system may not be optimal or very
professional, but it works. I cannot afford to break it.
I would also remind you that I have reasonable Linux skills but am not a
sysadmin and am not familiar with many sysadmin tools.
Typing slowly and not using big words would help too!

Many thanks in advance.

Mark
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>