# Please install procmail from http://www.procmail.org first. # # split.rc is using Jari Alto procmail modules from http://www.procmail.org/jari/pm-code.zip # It will split RFC-822 style formatted mbox file using date from every message # header and save each message into a file based on it's date. # By default, it will split messages to files on per-month basis. # The script also replaces quoted-printable encoded text within message # headers by 8bit characters. # # Usage: # formail -b -s procmail -m split.rc < mail.archive # # # In the current directory you will receive files named like $listname.0210 # containig messages sen in October 2002, files named duplicates where are # duplicated messages (original got saved into $listname.* file). # # This recipe can be found at # http://www.natur.cuni.cz/~mmokrejs/procmail/splitmail/procmail_only_with_dmmh/ # # Martin Mokrejs PMSRC=/etc/procmail LOGFILE=$HOME/splitmail.log # first of all, let's check for duplicates and remove them JA_ID_CACHE = .pm-msgid.cache JA_ID_MBOX = duplicates INCLUDERC=/etc/procmail/pm-jadup.rc INCLUDERC=/etc/procmail/pm-jadate.rc # set listname here. Actually it's only needed because the resulting files need to have some prefix. LIST = vcelari EXT = "$YY$MM" # 9910 # replace quoted-printable encoded text inside message headers by 8bit characters # download it from http://www.natur.cuni.cz/~mmokrejs/procmail/majordomo/dmmh :0Hhfw * =\?[^?]+\?[qb]\?[^?]+\?= | $HOME/bin/dmmh # convert text in message bodies from cp1250 to iso-8859-2, for example # for details see the charsets.rc script # download it from http://www.natur.cuni.cz/~mmokrejs/procmail/charsets.rc INCLUDERC=charsets.rc INCLUDERC = $PMSRC/pm-jamime-decode.rc :0 fhw | formail -I "X-Priority:" -I "X-MSMail-Priority:" -I "Sender:" -I "X-Sender:" -I "Precedence:" -I "Resent-from:" -I "Resent-message-id:" -I "Resent-reply-to:" -I "Resent-sender:" -I "X-Obalka-From:" -I "X-Obalka-To:" -I "X-No-Archive:" -I "Old-x-envelope-to:" -I "Mailing-List:" -I "Delivered-To:" -I "Old-X-Loop:" -I "Old-X-Mailing-List:" -I "Old-From:" -I "Old-To:" -I "Old-Subject:" -I "MIME-Version:" -I "X-Antivirus:" -I "X-Antivirus-Status:" -I "Status:" -I "Content-Length:" -I "Lines:" -I "Importance:" # deliver messages into krb4.9910 etc. :0: $LIST.$EXT