]> 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:

postpone delaying and fix resubmission
[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 LC_CTYPE=de_CH.UTF-8
21
22 #NICE='/usr/bin/nice -20'
23
24 PROCMAIL="$NICE /usr/bin/procmail -p $PMDIR/procmailrc"
25 FORMAIL="$NICE /usr/bin/formail -f"
26 EGREP="$NICE /bin/egrep"
27 SED="$NICE /bin/sed"
28 DELIVER="$NICE /usr/lib/dovecot/deliver"
29
30 CRM114="$NICE /usr/share/crm114/mailreaver.crm -u $MAILFILT/crm114/"
31 SA_PREFS="$MAILFILT/spamassassin/user_prefs"
32 SPAMASSASSIN="$NICE /usr/bin/spamassassin --prefs-file=$SA_PREFS"
33 SPAMC="$NICE /usr/bin/spamc --log-to-stderr --no-safe-fallback"
34 #SPAMC="$SPAMASSASSIN"
35 TRAINER="$NICE $MAILFILT/bin/train"
36
37 SQLITE="$NICE /usr/bin/sqlite3"
38
39 OURDATE="`date -R`"
40 OURDATE_SHORT=`date +%Y.%m.%d.%H.%M.%N`
41
42 BASE=$HOME/.maildir
43
44 #DEFAULT="|$DELIVER"
45 DEFAULT=$BASE/
46 ORGMAIL=$HOME/BOUNCED-MAIL
47
48 # maximum message size for spam checking
49 SPAMCHECK_MAX_MESSAGE_SIZE=512000
50
51 # if crm114 is unsure and SA returns a score less-than-or-equal to this,
52 # autotrain crm114 with ham
53 CRM_UNSURE_SA_AUTOTRAIN_LIMIT_HAM=2.0
54 # if crm114 classifies a message as spam but SA returns a score
55 # less-than-or-equal to this, retrain crm114
56 CRM_MISCLASSIFY_SA_AUTOTRAIN_LIMIT_HAM=-1.0
57 # if crm114 is unsure and SA returns a score greater than this, autotrain
58 # crm114 with spam
59 CRM_UNSURE_SA_AUTOTRAIN_LIMIT_SPAM=8.0
60 # if crm114 classifies a message as ham but SA returns a score
61 # greate than this, retrain crm114
62 CRM_MISCLASSIFY_SA_AUTOTRAIN_LIMIT_SPAM=11
63
64 ### constants used in rules
65 NL="
66 "
67 RE_MYDOMAIN="(.+\.)*madduck\.net"
68 RE_MAILRELAYS="(seamus|clegg)\.madduck\.net"
69 RE_SPACE="[     ]"
70 RE_NOT_SPACE="[^        ]"
71 RE_SPACE_NEWLINE="(^|$RE_SPACE)"
72 RE_FIRSTNAME="martin($RE_SPACE_NEWLINE+f(\.?|elix))?"
73 RE_LASTNAME="kraff?t"
74 RE_EXTRACT_HEADER_VALUE="$RE_SPACE*\/$RE_NOT_SPACE.*"
75
76 DEJAVU_HEADER=X-Deja-Vu
77
78 NULL=/dev/null
79 DELAYED_QUEUE=$BASE/.delayed/
80 TICKLER_QUEUE=$BASE/.tickler/
81 DISCARD=$BASE/.discard/
82 #DISCARD="'|$DELIVER -m BASE.discard'"
83
84 ### variables from the message
85
86 ### local recipient data
87 # user+foobar@my.domain.org
88 # <  >                       $USER
89 #      <    >                $EXTENSION
90 # <         >                $LOCAL
91 #             <           >  $DOMAIN
92 # <                       >  $RECIPIENT
93 USER="${USER:-$LOGNAME}"
94 EXTENSION="${EXTENSION:-}"
95 LOCAL="${LOCAL:-$USER${EXTENSION:++$EXTENSION}}"
96 HOSTNAME="`hostname --fqdn`"
97 DOMAIN="${DOMAIN:-$HOSTNAME}"
98 RECIPIENT="${RECIPIENT:-$LOCAL@$DOMAIN}"
99 ID="$LOGNAME@$HOSTNAME"
100
101 # message-id
102 INCLUDERC=$PMDIR/get-msgid
103
104 # if $SENDER is undefined or not an email address, get it from the message
105 :0
106 * !SENDER ?? @
107 *$ ^Sender:$RE_EXTRACT_HEADER_VALUE
108 { SENDER="$MATCH" }
109
110 :0
111 *$ ^Date:$RE_EXTRACT_HEADER_VALUE
112 { DATE="$MATCH" }
113
114 :0
115 *$ ^From:$RE_EXTRACT_HEADER_VALUE
116 { FROM="$MATCH" }
117
118 :0
119 *$ ^Subject:$RE_EXTRACT_HEADER_VALUE
120 { SUBJECT="$MATCH" }
121
122 :0
123 *$ ^X-Original-To:$RE_EXTRACT_HEADER_VALUE
124 { ORIGINAL_TO="$MATCH" }
125 :0 E
126 { LOG="NO ORIGINAL_TO: $MSGID" }
127
128 :0
129 *$ ^X-Trained-As:$RE_EXTRACT_HEADER_VALUE
130 { TRAINED_AS="$MATCH" }
131
132 :0
133 *$ ^X-Tickle-Delivered:$RE_EXTRACT_HEADER_VALUE
134 { TICKLE_DELIVERED="$MATCH" }
135
136 :0
137 *$ ^X-Delayed:$RE_EXTRACT_HEADER_VALUE
138 { DELAYED="$MATCH" }
139
140 # fix variable values for special cases
141 INCLUDERC=$PMDIR/normalise
142
143 :0
144 * ORIGINAL_TO ?? ^\/[^@]+
145 { ORIG_LOCAL="$MATCH" }
146
147 :0
148 * ORIGINAL_TO ?? .+@\/.+
149 { ORIG_DOMAIN="$MATCH" }
150
151 ### run-time variables
152
153 # MSG_DEJAVU
154 # a procmail-style flag, which is true if unset and false if set (to !).
155 # unset by dejavu if the message has already been seen by the filter (according
156 # to the X-Been-There header).
157 MSG_DEJAVU=!
158
159 # DEST
160 # set this to a folder if the message should be delivered elsewhere than the
161 # default
162 DEST
163
164 # SKIP_SPAMCHECKS
165 # if set, cuases spamchecks to be skipped, value lists reason
166 SKIP_SPAMCHECKS
167
168 # SPAMTRAPPED
169 # set by spamtrapped and eqdomains and used to bypass spamchecks and handle as
170 # spam immediately. The value identifies who unset the variable.
171 SPAMTRAPPED
172
173 # IS_SPAM
174 # if set, then the mailfilter is as sure as it gets that the message is spam.
175 # The value identifies who set the variable.
176 IS_SPAM
177
178 # SPAM_DISAGREE
179 # if set, then the various spamchecks disagree about spaminess of the mail.
180 # The value can hold additional information.
181 SPAM_DISAGREE
182
183 # SPAM_UNSURE
184 # if set, then the various spamchecks are unsure about spaminess of the mail.
185 # The value can hold additional information.
186 SPAM_UNSURE
187
188 # SPAM_UNKNOWN
189 # if set, the spamchecks were skipped. The value gives the reason for
190 # skipping.
191 SPAM_UNKNOWN
192
193 # RETRAIN
194 # if set, causes spamfilters to be retrained, according to the variable's value
195 RETRAIN
196
197 # JUSTME
198 # if set, contains reason why justme message was passed
199 JUSTME