""" This is small example of how to use libmuttproc """ from libmuttproc import * from os import environ home = environ['HOME'] #include this file from your .muttrc muttfile = open(os.path.join(home,'.mutt/autogenerated'), 'w') #include this file from your procmailrc procmailfile = open(os.path.join(home,'.procmail/autogenerated'), 'w') #print warnings to this file warningsfile = sys.stdout #your default signature signaturefile=os.path.join(home, ".signature") #your default fromadress fromaddress = "Alyssq P Hacker " active = 1 subscribed = 1 printwarnings = 1 #set the defaults for all your mailinglists all = MailingLists(muttfile, procmailfile, warningsfile, active, subscribed, printwarnings, signaturefile, fromaddress) #define some lists #ML("someaddress@somewhere","/m/comp/misc/blaa/blas", "^some silly rexexp",all) MailingList("debian-news@lists.debian.org", "/m/comp/debian/news/", "^X-Mailing-List.*debian-news@lists.debian.org.*",all) MailingList("mutt-users@mutt.org", "/m/comp/misc/mutt/", "^.*mutt-users@mutt.org.*",all) #procmail list is not well behaved to we need several regexp MailingList("procmail@Informatik.RWTH-Aachen.DE", "/m/comp/misc/procmail/", "^List-Id: discussion of the procmail program .*",all) MailingList("procmail@Lists.RWTH-Aachen.DE", "/m/comp/misc/procmail/", "^List-Id: discussion of the procmail program .*",all) MailingList("procmail-users@procmail.org", "/m/comp/misc/procmail/", "^List-Id: discussion of the procmail program .*",all) #do all the work all.run()