]> git.madduck.net Git - etc/mailfilter.git/blob - procmail/defines

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

remove all references to albatross, which we do not use anymore
[etc/mailfilter.git] / procmail / defines
1 ### basic settings
2
3 SHELL=/bin/sh
4 PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin
5
6 COMSAT=no
7
8 LINEBUF=16384
9 UMASK=0077
10
11 PMVAR=$HOME/.var/procmail
12 MAILFILT=$HOME/.etc/mailfilter
13 PMRULES=$PMDIR/rules
14 CONF=$MAILFILT/config
15 REPLIES=$MAILFILT/autoreplies
16
17 LOGFILE=${LOGFILE:-$PMVAR/log}
18 LOGABSTRACT=no
19
20 #NICE='/usr/bin/nice -20'
21
22 PROCMAIL="$NICE /usr/bin/procmail -p $PMDIR/procmailrc"
23 FORMAIL="$NICE /usr/bin/formail -f"
24 EGREP="$NICE /bin/egrep"
25 SED="$NICE /bin/sed"
26 DELIVER="$NICE /usr/lib/dovecot/deliver"
27
28 CRM114="$NICE /usr/share/crm114/mailreaver.crm -u $MAILFILT/crm114/"
29 SA_PREFS="$MAILFILT/spamassassin/user_prefs"
30 SPAMASSASSIN="$NICE /usr/bin/spamassassin --prefs-file=$SA_PREFS"
31 SPAMC="$NICE /usr/bin/spamc --log-to-stderr --no-safe-fallback"
32 #SPAMC="$SPAMASSASSIN"
33 TRAINER="$MAILFILT/bin/train"
34
35 OURDATE=`date -R`
36 OURDATE_SHORT=`date +%Y.%m.%d.%H.%M.%N`
37
38 BASE=$HOME/.maildir
39
40 #DEFAULT="|$DELIVER"
41 DEFAULT=$BASE/
42 ORGMAIL=$HOME/BOUNCED-MAIL
43
44 # maximum message size for spam checking
45 SPAMCHECK_MAX_MESSAGE_SIZE=2500000
46
47 # if crm114 is unsure and SA returns a score less-than-or-equal to this,
48 # autotrain crm114 with ham
49 CRM_UNSURE_SA_AUTOTRAIN_LIMIT_HAM=2.0
50 # if crm114 classifies a message as spam but SA returns a score
51 # less-than-or-equal to this, retrain crm114
52 CRM_MISCLASSIFY_SA_AUTOTRAIN_LIMIT_HAM=-1.0
53 # if crm114 is unsure and SA returns a score greater than this, autotrain
54 # crm114 with spam
55 CRM_UNSURE_SA_AUTOTRAIN_LIMIT_SPAM=8.0
56 # if crm114 classifies a message as ham but SA returns a score
57 # greate than this, retrain crm114
58 CRM_MISCLASSIFY_SA_AUTOTRAIN_LIMIT_SPAM=11
59
60 ### constants used in rules
61 NL="
62 "
63 RE_MYDOMAIN="(.+\.)*madduck\.net"
64 RE_MAILRELAYS="(seamus|clegg)\.madduck\.net"
65 RE_SPACE_NEWLINE="(^|[  ])"
66 RE_FIRSTNAME="martin($RE_SPACE_NEWLINE+f(\.?|elix))?"
67 RE_LASTNAME="kraff?t"
68 RE_EXTRACT_HEADER_VALUE="[      ]*\/[^  ].*"
69
70 NULL=/dev/null
71 DISCARD=$BASE/.discard/
72 #DISCARD="'|$DELIVER -m BASE.discard'"
73
74 ### variables from the message
75
76 ### local recipient data
77 # user+foobar@my.domain.org
78 # <  >                       $USER
79 #      <    >                $EXTENSION
80 # <         >                $LOCAL
81 #             <           >  $DOMAIN
82 # <                       >  $RECIPIENT
83 USER="${USER:-$LOGNAME}"
84 EXTENSION="${EXTENSION:-}"
85 LOCAL="${LOCAL:-$USER${EXTENSION:++$EXTENSION}}"
86 HOSTNAME="`hostname --fqdn`"
87 DOMAIN="${DOMAIN:-$HOSTNAME}"
88 RECIPIENT="${RECIPIENT:-$LOCAL@$DOMAIN}"
89 ID="$LOGNAME@$HOSTNAME"
90
91 # message-id
92 INCLUDERC=$PMDIR/get-msgid
93
94 # if $SENDER is undefined or not an email address, get it from the message
95 :0
96 * !SENDER ?? @
97 *$ ^Sender:$RE_EXTRACT_HEADER_VALUE
98 { SENDER="$MATCH" }
99
100 :0
101 *$ ^Date:$RE_EXTRACT_HEADER_VALUE
102 { DATE="$MATCH" }
103
104 :0
105 *$ ^From:$RE_EXTRACT_HEADER_VALUE
106 { FROM="$MATCH" }
107
108 :0
109 *$ ^Subject:$RE_EXTRACT_HEADER_VALUE
110 { SUBJECT="$MATCH" }
111
112 :0
113 *$ ^X-Original-To:$RE_EXTRACT_HEADER_VALUE
114 { ORIGINAL_TO="$MATCH" }
115 :0 E
116 { LOG="NO ORIGINAL_TO: $MSGID" }
117
118 # fix variable values for special cases
119 INCLUDERC=$PMDIR/normalise
120
121 :0
122 * ORIGINAL_TO ?? ^\/[^@]+
123 { ORIG_LOCAL="$MATCH" }
124
125 :0
126 * ORIGINAL_TO ?? .+@\/.+
127 { ORIG_DOMAIN="$MATCH" }
128
129 ### run-time variables
130
131 # REPROC_MESSAGE
132 # a procmail-style flag, which is true if unset and false if set (to !).
133 # unset by marknew if the message has already been seen by the filter (according
134 # to the X-Been-There header).
135 REPROC_MESSAGE=!
136
137 # SKIP_SPAMCHECKS
138 # if set, cuases spamchecks to be skipped, value lists reason
139 SKIP_SPAMCHECKS
140
141 # SPAMTRAPPED
142 # set by spamtrapped and eqdomains and used to bypass spamchecks and handle as
143 # spam immediately. The value identifies who unset the variable.
144 SPAMTRAPPED
145
146 # IS_SPAM
147 # if set, then the mailfilter is as sure as it gets that the message is spam.
148 # The value identifies who set the variable.
149 IS_SPAM
150
151 # SPAM_DISAGREE
152 # if set, then the various spamchecks disagree about spaminess of the mail.
153 # The value can hold additional information.
154 SPAM_DISAGREE
155
156 # SPAM_UNSURE
157 # if set, then the various spamchecks are unsure about spaminess of the mail.
158 # The value can hold additional information.
159 SPAM_UNSURE
160
161 # SPAM_UNKNOWN
162 # if set, the spamchecks were skipped. The value gives the reason for
163 # skipping.
164 SPAM_UNKNOWN
165
166 # RETRAIN
167 # if set, causes spamfilters to be retrained, according to the variable's value
168 RETRAIN