# Install procmail and formail from http://www.procmail.org . # You just need the programs in your PATH, you don't have to set-up # procmail as you local delivery agent(LDA), although it's a great # idea. # # To obey problems with MIME encoded email headers, download # http://www.natur.cuni.cz/~mmokrejs/procmail/majordomo/dmmh # and be sure the path below(currently $HOME/bin/dmmh is right). # # Usage: formail -b -s procmail extract-emails.rc < mail/people # # Run this process on several files and then once done, postprocess # the extract-emails.log file with: # perl extract-emails.pl < extract-emails.log > emails.txt SHELL=/bin/sh # # Remember we always append to the logfile, so either be sure # that it contains email addresses from previous runs on different/same # folders, or remove the file before running formail(1). # LOGFILE=extract-emails.log DEFAULT=/dev/null VERBOSE=off LOGABSTRACT=none LINEBUF=102400 # De-mangle RFC 2047 header mangling # download http://www.natur.cuni.cz/~mmokrejs/procmail/majordomo/dmmh :0Hhfw * =\?[^?]+\?[qb]\?[^?]+\?= | $HOME/bin/dmmh :0 { FROM = `formail -zrxFrom:` } :0 { TO = `formail -zcxTo:` } :0 { CC = `formail -zcxCc:` } LOG="$FROM " LOG="$TO " LOG="$CC "