1 #############################################################
  2 # Procmailrc, 2009-01-15
  3 # Author: Stefan Krauth (sdk@xxzz.de)
  4 # URL: http://dot.xxzz.de/dot.procmailrc.html
  5 #
  6 # Feel free to use it.
  7 ##############################################################
  8 PATH=/bin:/usr/bin:/usr/local/bin
  9 MAILDIR=$HOME/.emails
 10 LOGFILE=$HOME/.procmail.log
 11 VERBOSE=on
 12
 13 ## Silently drop all Asian language mail
 14 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
 15 :0:
 16 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
 17 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
 18 $MAILDIR/.x-spam/
 19
 20 :0:
 21 * ^Content-Type:.*multipart
 22 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
 23 $MAILDIR/.x-spam/
 24
 25 ## Bogofilter Setup
 26 # filter mail through bogofilter, tagging it as Ham, Spam, or Unsure,
 27 # and updating the wordlist
 28 :0fw
 29 | bogofilter-sqlite -u -e -p
 30
 31
 32 # if bogofilter failed, return the mail to the queue;
 33 # the MTA will retry to deliver it later
 34 # 75 is the value for EX_TEMPFAIL in /usr/include/sysexits.h
 35 :0e
 36 { EXITCODE=75 HOST }
 37
 38
 39 # file the mail to spam-bogofilter if it's spam.
 40 :0:
 41 * ^X-Bogosity: Spam, tests=bogofilter
 42 $MAILDIR/.x-spam/
 43
 44 # file the mail to unsure-bogofilter
 45 # if it's neither ham nor spam.
 46 :0:
 47 * ^X-Bogosity: Unsure, tests=bogofilter
 48 $MAILDIR/.x-spam-unshure/
 49
 50 # With this recipe, you can train bogofilter starting with an empty
 51 # wordlist.  Be sure to check your unsure-folder regularly, take the
 52 # messages out of it, classify them as ham (or spam), and use them to
 53 # train bogofilter.
 54
 55 ## Fix Outlook PGP
 56 :0
 57 * !^Content-Type: message/
 58 * !^Content-Type: multipart/
 59 * !^Content-Type: application/pgp
 60 {
 61         :0 fBw
 62         * ^-----BEGIN PGP MESSAGE-----
 63         * ^-----END PGP MESSAGE-----
 64         | formail \
 65             -i "Content-Type: application/pgp; format=text; x-action=encrypt"
 66
 67         :0 fBw
 68         * ^-----BEGIN PGP SIGNED MESSAGE-----
 69         * ^-----BEGIN PGP SIGNATURE-----
 70         * ^-----END PGP SIGNATURE-----
 71         | formail \
 72             -i "Content-Type: application/pgp; format=text; x-action=sign"
 73 }
 74
 75
 76 # Repair "From "
 77 :0 fhw
 78 | /usr/bin/formail -I "From " -a "From "
 79
 80 #Mailinglists
 81 :0H
 82 * ^Sender:.ccchd-bounces@ccchd.de
 83 $MAILDIR/.noname-ev/
 84
 85 :0H
 86 * ^Sender:.intern-bounces@discordia.noname-ev.de
 87 $MAILDIR/.noname-ev-intern/
 88
 89 :0H
 90 * ^To:.debian-security-announce@lists.debian.org
 91 $MAILDIR/.debian-security/
 92
 93 :0H
 94 * ^Sender:.kletterliste-bounces@xxzz.de
 95 $MAILDIR/.kletterliste/
 96
 97 :0H
 98 * ^Sender:.intern@lists.ccc.de
 99 $MAILDIR/.ccc-intern/
100
101 :0H
102 * ^Sender:.uugrn-bounces@uugrn.org
103 $MAILDIR/.uugrn/
104
105 #Fixing up missing F
106 :0
107 * ^^rom[ ]
108 {
109     LOG="*** Dropped F off From_ header! Fixing up. "
110
111         :0 fhw
112         | sed -e '1s/^/F/'
113 }
114
115 # default
116 :0
117 $MAILDIR/