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

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