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

add RE_SPACE variable
[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_SPACE_NEWLINE="(^|$RE_SPACE)"
69 RE_FIRSTNAME="martin($RE_SPACE_NEWLINE+f(\.?|elix))?"
70 RE_LASTNAME="kraff?t"
71 RE_EXTRACT_HEADER_VALUE="[      ]*\/[^  ].*"
72
73 DEJAVU_HEADER=X-Deja-Vu
74
75 NULL=/dev/null
76 DISCARD=$BASE/.discard/
77 #DISCARD="'|$DELIVER -m BASE.discard'"
78
79 ### variables from the message
80
81 ### local recipient data
82 # user+foobar@my.domain.org
83 # <  >                       $USER
84 #      <    >                $EXTENSION
85 # <         >                $LOCAL
86 #             <           >  $DOMAIN
87 # <                       >  $RECIPIENT
88 USER="${USER:-$LOGNAME}"
89 EXTENSION="${EXTENSION:-}"
90 LOCAL="${LOCAL:-$USER${EXTENSION:++$EXTENSION}}"
91 HOSTNAME="`hostname --fqdn`"
92 DOMAIN="${DOMAIN:-$HOSTNAME}"
93 RECIPIENT="${RECIPIENT:-$LOCAL@$DOMAIN}"
94 ID="$LOGNAME@$HOSTNAME"
95
96 # message-id
97 INCLUDERC=$PMDIR/get-msgid
98
99 # if $SENDER is undefined or not an email address, get it from the message
100 :0
101 * !SENDER ?? @
102 *$ ^Sender:$RE_EXTRACT_HEADER_VALUE
103 { SENDER="$MATCH" }
104
105 :0
106 *$ ^Date:$RE_EXTRACT_HEADER_VALUE
107 { DATE="$MATCH" }
108
109 :0
110 *$ ^From:$RE_EXTRACT_HEADER_VALUE
111 { FROM="$MATCH" }
112
113 :0
114 *$ ^Subject:$RE_EXTRACT_HEADER_VALUE
115 { SUBJECT="$MATCH" }
116
117 :0
118 *$ ^X-Original-To:$RE_EXTRACT_HEADER_VALUE
119 { ORIGINAL_TO="$MATCH" }
120 :0 E
121 { LOG="NO ORIGINAL_TO: $MSGID" }
122
123 # fix variable values for special cases
124 INCLUDERC=$PMDIR/normalise
125
126 :0
127 * ORIGINAL_TO ?? ^\/[^@]+
128 { ORIG_LOCAL="$MATCH" }
129
130 :0
131 * ORIGINAL_TO ?? .+@\/.+
132 { ORIG_DOMAIN="$MATCH" }
133
134 ### run-time variables
135
136 # MSG_DEJAVU
137 # a procmail-style flag, which is true if unset and false if set (to !).
138 # unset by dejavu if the message has already been seen by the filter (according
139 # to the X-Been-There header).
140 MSG_DEJAVU=!
141
142 # DEST
143 # set this to a folder if the message should be delivered elsewhere than the
144 # default
145 DEST
146
147 # SKIP_SPAMCHECKS
148 # if set, cuases spamchecks to be skipped, value lists reason
149 SKIP_SPAMCHECKS
150
151 # SPAMTRAPPED
152 # set by spamtrapped and eqdomains and used to bypass spamchecks and handle as
153 # spam immediately. The value identifies who unset the variable.
154 SPAMTRAPPED
155
156 # IS_SPAM
157 # if set, then the mailfilter is as sure as it gets that the message is spam.
158 # The value identifies who set the variable.
159 IS_SPAM
160
161 # SPAM_DISAGREE
162 # if set, then the various spamchecks disagree about spaminess of the mail.
163 # The value can hold additional information.
164 SPAM_DISAGREE
165
166 # SPAM_UNSURE
167 # if set, then the various spamchecks are unsure about spaminess of the mail.
168 # The value can hold additional information.
169 SPAM_UNSURE
170
171 # SPAM_UNKNOWN
172 # if set, the spamchecks were skipped. The value gives the reason for
173 # skipping.
174 SPAM_UNKNOWN
175
176 # RETRAIN
177 # if set, causes spamfilters to be retrained, according to the variable's value
178 RETRAIN
179
180 # JUSTME
181 # if set, contains reason why justme message was passed
182 JUSTME
183
184 # TRAINED_AS
185 # if set, contains category with which this message has just been trained
186 TRAINED_AS