-
Notifications
You must be signed in to change notification settings - Fork 0
/
.procmailrc
159 lines (131 loc) · 3.06 KB
/
.procmailrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# $Id$
LOGFILE=procmail.log
LOGABSTRACT=all
SHELL=/bin/sh
TERM=vt100
COMSAT=no
#VERBOSE=yes
LOOPADDR="[email protected]"
LOOPCHECK="lsm@(execpc\.com|(pug\.)?qqx\.org)"
NL="
"
# Drop Sobig messages
:0
* ^Subject: (Re: That movie|Re: Wicked screensaver|Re: Your application|Re: Approved|Re: Re: My details|Re: Details|Your details|Thank you!)$
* ^X-MailScanner: Found to be clean
{ HOST }
:0c:
backup/1
:0
* $ ^X-Loop:.*${LOOPCHECK}
| formail -A"X-procmail: lsm loop" | $SENDMAIL ${MASTERADDR}
# Forward cron output to ${MASTERADDR}
:0
* Subject:.*cron
! ${MASTERADDR}
# If it's a reply to a local message, send it to ${MASTERADDR}
:0
* ^Subject: Re:
{
:0
* ^(References|In-Reply-To):.*[@.]qqx\.org
! ${MASTERADDR}
# Drop other replies
:0
{ HOST }
}
:0
* ^(Sender:|From[: ]).*(postmaster|mailer-daemon|<@>)
| formail -A"X-Procmail: lsm mail from daemon" | $SENDMAIL ${MASTERADDR}
# No spam checking for now
# * HOST ?? adfsdafafaf
:0
{
SPAMSCORE=`spamc -c`
SPAM=$?
# * SPAM ?? ^^1^^
:0
* SPAMSCORE ?? ^^\/[0-9.]+
* $ $MATCH^0
* -0.99^0
{ SPAM=yes }
:0E
{ SPAM=no }
LOG="Spam: $SPAM ($SPAMSCORE)$NL"
}
:0
* ^MIME-Version:
* 5^0 ^Content-type:
* -6^0 ^Content-type:.*text/plain
* 5^0 ^Content-transfer-encoding:
* -6^0 ^Content-transfer-encoding:.*[78]bit
{
LOG="MIME message$NL"
#VERBOSE=yes
:0
* SPAM ?? y
| formail -A"X-procmail: lsm spam (MIME)" | $SENDMAIL ${MASTERADDR}
# Duplicate the headers
# Continue even if this fails
:0fhw
| sed -e H -e '$ { p; g; }'
# generate the autoreply headers and quote the original message
# do this even if we couldn't duplicate the headers
:0fw
| formail -rtk -I"From: Linux Software Map <[email protected]>" \
-I"Precedence: junk" \
-A"X-Loop: ${LOOPADDR}"
# Add in the body of the reply
# Only if formail succeeded
:0afbw
| cat mime.error -
# Send it off
# Only if cat succeeded
:0aw
| $SENDMAIL -oi -t
#VERBOSE=no
#LOG="Mime error sent$NL"
}
:0E
{
# If subject is "template", send the template
:0
* ^Subject: template
| (formail -rt -A"Precedence: junk" -A"X-Loop: ${LOOPADDR}";\
cat lsm-template) | $SENDMAIL -t
# If subject is "add", run body through lsmcheck
# This is the Son of the LSM Robot.
:0
* ^Subject:[ ]*add
* ! $ ^X-Loop: ${LOOPCHECK}
{
:0fBbw
* ^Begin3
| lsmconv
:0w: add.lock
| (tee msg.$$ | formail -rt -A"X-Loop: ${LOOPADDR}"; \
cat sonny.msg; \
if lsmcheck < msg.$$; then lsmextract < msg.$$ >> \
updates/lsm.`date +%Y-%m-%d` ; \
chmod a+r $HOME/updates/*; fi; \
rm -f msg.$$) | $SENDMAIL -t
:0e
{
:0fh
| formail -rt -A"BCC: ${MASTERADDR}" | cat - $HOME/error
:0ac
| $SENDMAIL -t
:0:
backup/err
}
}
# Respond with a help message to all other messages
:0E
* ! SPAM ?? y
* ! $ ^X-Loop: ${LOOPCHECK}
| (formail -rt -A"Precedence: junk" -A"X-Loop: ${LOOPADDR}";\
cat lsm-template) | $SENDMAIL -t
}
:0
! ${MASTERADDR}