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

Re: [Sheflug] Procmail again



* Barrie Bremner (baz [at] barriebremner.com) wrote:
> 
> Hi All,
> 
> I've been having a look at a bunch of procmail FAQs and the manpages,
> however I'm still unable to achieve anything.
> 
> Below is my first shot at a ~/.procmailrc - just to filter off LUG
> messages to other mail files, and move everything else to "othermail":
> 
> # .procmailrc
> # routes incoming mail to appropriate mailboxes
> PATH=/usr/bin:/usr/local/bin
> MAILDIR=$HOME/Mailbox   # but this is a file...!?
> LOGFILE=$HOME/proclog
> SHELL=/bin/bash
> DEFAULT=/$HOME/othermail
> 
> # Put mail from ShefLUG mailing list into sheflug mailbox
> :0:
> * ^Subject:.*Sheflug
> /$HOME/sheflug
> # Put mail from WiltsLUG mailing list into wiltslug mailbox
> :0:
> * ^Subject:.*wiltshire
> /$HOME/wiltslug
> 
> Now, correct me if I'm wrong, but are all mail "directories" not just
> flat files? Every mail file I've ever looked at has been.
> 
> Therefore, if I set MAILDIR to $HOME/Mailbox instead of the normal
> /var/spool/mail/$LOGNAME surely it shouldn't matter?
> 
> Running procmail from the command line doesn't do much - procmail
> looks like it hangs until I kill it with Ctrl-C when it gives
> 
> procmail: Terminating prematurely
> 
> Am I missing something obvious here?
> 

the only way I can think to help is a very abbreviated version of my 
.procmailrc:


PATH=/usr/bin:/usr/local/bin:/bin
MAILDIR=/home/richlowe/Mail
LOGFILE=/home/richlowe/.procmaillog
SHELL=/bin/sh
VERBOSE=off

DEFAULT=$MAILDIR/Inbox
LOGFILE=$HOME/.procmail.log #real useful when you're testing.
LOCKFILE=$home/.procmail.lock

# MAILDIR being a directory containing mailboxes (which yes, are flat files).


# Filters mail with the "To:" header matching that regex, to the
# mailbox called ShefLUG in $MAILDIR (in this case
# /home/richlowe/Mail/ShefLUG

:0:
* ^TO(sheflug|shef-lug)@(vuw.ac.nz|list.sheflug.org.uk)
ShefLUG


# Other rules, filtering spam / other mailing lists / etc..
# go here


# Default rule to drop mail into your Inbox
:0:
$DEFAULT



Tom Gilbert (giblet) as some understandable procmail docs, (and his
.procmailrc) on his site. 

Docs: http://www.linuxbrit.co.uk/procmail/ 
.procmailrc: http://www.linuxbrit.co.uk/downloads/dot.procmailrc

His .procmailrc probably does far far more than you could ever want...

-- 
[ Richard Lowe - richlowe - richlowe [at] richlowe.demon.co.uk ]
[            http://www.snowman.net/~richlowe/            ]

___________________________________________________________________

Sheffield Linux User's Group - http://www.sheflug.co.uk . 
To unsubscribe from this list send mail to 
shef-lug-request@list.sheflug.org.uk with the word
"unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.