MAILDIR=/home/seymour/mail LOGFILE=/home/seymour/logs/procmail MONTH=`date +%Y/%m` # example $MONTH = 1999/08 # so it will make a directory for each month # in each year's directory ## Note: If you sort all of your mail, you can set MAILDIR to # be something like /home/seymour/mail/$MONTH and then # just enter the name of the mailbox to filter to as follows: # # :0: # * ^Sender:.*owner-mutt-users@mutt.org # mutt-users # ----- check for existance of this month's directory ----- :0 ic * ? test ! -d $MONTH | mkdir -p $MONTH && chmod 0700 $MONTH # ----- add Lines: header for Maildir mail ----- :0 bw LINES=|wc -l | tr -d " " :0 fhw |formail -a "Lines: $LINES" # lbdb address fetching :0hc | lbdb-fetchaddr # ----- header rewriting ----- # As listed in the Mutt docs to convert old-style PGP messages to MIME :0 * !^Content-Type: multipart/ * !^Content-Type: application/pgp { :0 fBw * ^-----BEGIN PGP MESSAGE----- * ^-----END PGP MESSAGE----- | formail \ -i "Content-Type: application/pgp; format=text; x-action=encrypt" :0 fBw * ^-----BEGIN PGP SIGNED MESSAGE----- * ^-----BEGIN PGP SIGNATURE----- * ^-----END PGP SIGNATURE----- | formail \ -i "Content-Type: application/pgp; format=text; x-action=sign" } # ----- mailbox filtering ----- :0: * ^Sender:.*owner-mutt-users@mutt.org $MONTH/mutt-users/ :0: * ^X-Mailing-List:.*debian-user@lists.debian.org $MONTH/debian-user/ :0: * ^From:.*freshd@freshmeat.net $MONTH/freshmeat/ :0: * ^From:.*slashdot@slashdot.org $MONTH/slashdot/ :0: * ^X-Mailing-List:.*gnupg-users@gnupg.org $MONTH/gnupg-users/ :0: * ^X-Mailing-List:.*gnupg-announce@gnupg.org $MONTH/gnupg-users/ :0: * ^X-Mailing-List:.*procmail@informatik.rwth-aachen.de $MONTH/procmail/ :0: * ^X-Mailing-List:.*fetchmail-friends@ccil.org $MONTH/fetchmail/ :0f * Subject:.*\(reiserfs\) \/.* | formail -bfi "Subject: $MATCH" :0: * ^Mailing-List:.*reiserfs-help@devlinux.com $MONTH/reiserfs/ # ----- anything else goes here ----- :0: $MONTH/Inbox/