Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's in your .procmailrc [closed]

Are there any handy general items you put in your .procmailrc file?

like image 273
dlamblin Avatar asked Aug 12 '08 05:08

dlamblin


2 Answers

Many mailers prefix a mail's subject with "Re: " when replying, if that prefix isn't already there. German Outlook instead prefixes with "AW: " (for "AntWort") if that prefix isn't already there. Unfortunately, these two behaviours clash, resulting in mail subjects like "Re: AW: Re: AW: Re: AW: Re: AW: Lunch". So I now have:

:0f
* ^Subject: (Antwort|AW):
|sed -r -e '1,/^$/s/^(Subject: )(((Antwort: )|(Re: )|(AW: ))+)(.*)/\1Re: \7\nX-Orig-Subject: \2\7/'

Which curtails these (and an "Antwort: " prefix that I've evidently also been bothered by at some point) down to a single "Re: ".

like image 113
Jon Bright Avatar answered Nov 07 '22 09:11

Jon Bright


Just simple things - move messages to appropriate folders, forward some stuff to an email2sms address, move spam to spam folder. One thing I'm kind of proud of is how to mark your spam as "read" (this is for Courier IMAP and Maildir, where "read" means "move to different folder and change the filename"):

:0                                                                              
* ^X-Spam                       # the header our filter inserts for spam                                                                   
{                                                                               
    :0                                                                         
    .Junk\ E-mail/              # stores in .Junk E-mail/new/                                                                                      

    :0                                                                          
    * LASTFOLDER ?? /\/[^/]+$   # get the stored message's filename                                                   
    { tail=$MATCH }             # and put it into $tail
    # now move the message                                                            
    TRAP="mv .Junk\ E-mail/new/$tail .Junk\ E-mail/cur/$tail:2,S"               
}
like image 5
Marie Fischer Avatar answered Nov 07 '22 08:11

Marie Fischer