Custom Search

Friday, July 13, 2007

The Joys of Procmail

Procmail, possibly from the root word proctology. ;) Had one heck of a time setting it up with mutt and getmail but it's a done deal, up and running finally. I'm putting in the configuration below. Possibly someone having the problems I did will be googling and find it. We can only hope. I want to stress the importance, too, of the order in which the below values are placed. Pay attention to that when you're creating your own configuration. And do not put anything in you don't need. Also, VERBOSE=off stopped a good amount of the problems I was having when I'd run getmail and it'd call procmail. Procmail choked on the output. Once verbose was turned off, things got immediately better.

VERBOSE=off
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/.procmail-log
MAILDIR=$HOME/Mail
DEFAULT=$MAILDIR/inbox
LOCKFILE=$HOME/.lockmail
COMSAT=no
PER=(mypersonal@gmail\.com|mypersonal@linux\.org)
FBSDQUESTIONS=(owner-freebsd-questions@freebsd\.org)
FBSDSTABLE=(owner-freebsd-stable@freebsd\.org)
FBSDCVSALL=(owner-cvs-all@freebsd\.org)
OBSDALL=(owner-misc@openbsd\.org)
OBSDSEC=(owner-security-annouce@openbsd\.org)

:0
*$ ^From:.*$PER
per/

:0
*$ ^From:.*$FBSDQUESTIONS
fbsd/

:0
*$ ^From:.*$FBSDSTABLE
fbsd/

:0
*$ ^From:.*$FBSDCVSALL
fbsd/

:0
*$ ^From:.*$OBSDALL
obsd/

:0
*$ ^From:.*$OBSDSEC
obsdsec/

I have lots of individual entries below the section listed, but for brevity's sake, that's all I'm putting in for now. You'll have to read the "fine" manual to see other ways to filter. There are lots and it can get really complicated. Here's how I have getmail setup:

[options]
verbose = 0
read_all = false
delete = true
message_log = ~/.getmail/log

[retriever]
type = SimplePOP3Retriever
server = myispmailserver
username = myusername
password = mypassword

[destination]
#type = Maildir
#path = /home/dennyboy/Mail/
type = MDA_external
path = /usr/local/bin/procmail
unixfrom = true

Setting up .muttrc is a real joy too. ;) I'll have to recount that some other time. It goes without saying there's a lot of reading. It pays to to read the instructions. People in the mailing lists are notoriously recalcitrant about helping you if they think you haven't really tried on your own, especially when it comes to reading the man pages and installed docs. Rightfully so, too. I worked on this mess, on and off, for over a week. I finally did ask on the openbsd misc mailing list, but just like when you were back in grade school doing your math for the teacher, you need to "show your work". I got a really good answer and after a little editing with vim, I finally had everything working in a short time.

powered by performancing firefox

Labels: , , ,