[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Procmail
And Lo! The Great Prophet Richard Ibbotson uttered these words of wisdom:
> Hi
>
> Well, As I thought I would I've messed up procmail configuration...
> my procmailrc looks like....
>
>
> PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:.
> MAILDIR=/var/spool/mail/$richard
> DEFAULT=root
>
> :0 # Anything from zetnet brought down by
> # Fetchmail
> *^TO.*
> richard # will go to /home/richard/Mail/inbox
>
Er, the whitespace between :0 and * probably isn't needed, but as :
indicates rule start, this is probably moot.
Also, what is $richard? That'll probably translate to /var/spool/mail.
DEFAULT needs to point to a complete mailbox, e.g., /var/spool/mail/root,
or mayhap $MAILDIR/root however, if you want to write to root's mailbox
and mail is coming in to /you/, it's probably going to fail (users don't
have access to root do they?), so if you want to deliver to root by
default, you need a rule to forward the mail with a rule like placed at
the extreme bottom of .procmailrc (it's parsed on a first-match basis):
:0
!root
Assuming you always have your mail coming in to /var/spool/mail, then
you'll want:
PATH=<as before>
MAILDIR=/var/spool/mail
:0
* ^TO.*
richard
But as that's sending all mail to richard, you can abbrivate it to:
PATH=<as before>
MAILDIR=/var/spool/mail
:0
richard
DEFAULT is (by default) /var/spool/mail/$USER, so you could even just have
an empty .procmailrc for this simple thing :)
The mail folder in the recipe (in this case "richard") is relative to
the setting of MAILDIR, unless it is an absolute path or other special
directive.
HTH,
Chris...
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.