File: test.rc

package info (click to toggle)
procmail-lib 1:1995.08.28-4.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 156 kB
  • ctags: 32
  • sloc: perl: 213; makefile: 143
file content (211 lines) | stat: -rw-r--r-- 4,175 bytes parent folder | download | duplicates (3)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# procmailrc for AKS
#
# Basic philosophy:
#
#  1. Mail is assumed to be MH-based
#  2. Drop all daemon-based mail in +admin
#  3. If mail is from NOACKS list, drop in +inbox
#  4. If mail is to ME, and not an ack, and an ack hasn't
#     been sent recently, generate an auto-ack
#  5. Scan mail for junk & drop
#  6. Leave any remaining mail in +other
#  7. If any maildrops fail (file system full, drop in $DEFAULT, then $FAILDROP)
#  
SHELL=/bin/sh

PROCDIR=/eci/procmail
BIN=$PROCDIR/bin
LIB=$PROCDIR/lib

FORMAIL=$BIN/formail
PROCMAIL=$BIN/procmail

PATH=$PATH:/usr/local/bin:$BIN
MAILDIR=$HOME/Mail
LOGFILE=$MAILDIR/Log

# Where mail gets placed as a *last* resort
FAILDROP=/fs/dokoka/aks/failed.maildrop

# Mail folders to drop things into
INBOX=inbox/.
ADMIN=admin/.
OTHER=other/.

MY_ADDR=aks@hub.ucsb.edu
MY_NAMES="(aks|alan|stebbens|a.stebbens|alan.stebbens)"
FROMSIG="Alan's Mailer-Daemon <$MY_ADDR>"

STAFF='(aks|toad|em|mce|stu|stefan|theodora|bruno)'
REQUEST='((ccse|request|help|problem)(-(dist|staff))?)'
NOACKUSERS='(rog|tel|probert|movie)'
NOACKS="($STAFF|$REQUEST|$NOACKUSERS)$POST_ADDR_SPAN"

VERBOSE=off

# Do the duplicate mail check
INCLUDERC=$LIB/dupcheck.rc

# Pull in the standard header patterns
INCLUDERC=$LIB/headers.rc

# Define a pattern matching UCSB mail address (also matches user@host; ie:
# no domain)
FROM_UCSB="$FROM.*\.ucsb\.edu"

# Detect loops right away -- and stop them
:0:
* $ ^X-Loop: *$MY_ADDR
$INBOX
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# If the mail is to me, do some special things
:0
* ^TO(aks)
{
    # Check on special mail
    :0:
    * ^Subject:.*eci[12] fsupdate
    $ADMIN
	:0e:
	$DEFAULT
	    :0e:
	    $FAILDROP

    ############################################
    # Check for any commands on the Subject line
    ############################################
    INCLUDERC=$LIB/commands.rc

    # Don't ack our staff or people who we don't want to send acks to
    :0:
    * $ $FROM$NOACKS
    $INBOX
	:0e:
	$DEFAULT
	    :0e:
	    $FAILDROP

    # Do any autoacknowledgements
    INCLUDERC=$LIB/ackmail.rc

    # If the mail is directly to me, -> +inbox
    :0:
    * $ $TO(aks)([,@]|$)
    $INBOX
	:0e:
	$DEFAULT
	    :0e:
	    $FAILDROP

    # If the mail is to an administrative alias, -> +admin
    :0:
    * $ ^TO($REQUEST|$STAFF)$POST_ADDR_SPAN
    $ADMIN
	:0e:
	$DEFAULT
	    :0e:
	    $FAILDROP

    # Otherwise drop it all in default personal box
    :0: 
    $INBOX
	:0e:
	$DEFAULT
	    :0e:
	    $FAILDROP

}

# We're having mail loop problems when a system goes "south" (loses
# its network connection

:0h:
* ^To: *(MAILER-DAEMON|root|Postmaster)@engineering.ucsb.edu
* ^From: *(MAILER-DAEMON|root|Postmaster)@engineering.ucsb.edu
* ^Subject:.*(Returned mail: Deferred|Unable to return to sender)
/dev/null

# Trash the PLP errors
:0h:
* ^From:.*\(PLP printer daemon\)
* ^Subject:.*(e1|e2|cad)(ps1|ps2)(-(eci2|axle|wheel))? printer job
/dev/null

# Now back to our regularly scheduled filtering

:0:
* ^TO(hostmaster@hub)
$ADMIN
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# One of the tagged subjects
:0:
* ^Subject: *(Re: *)?\[UCSB
$ADMIN
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# If it is mail to one of the networking lists, place in +inbox
:0:
* ^TO(cnc(-(info|bbone|policy|outreach))?)@
$INBOX
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# It is not mail specifically to me; must be a candidate for
# junkmail filtering..
INCLUDERC=$HOME/.junkmailrc

# If it is mail to one my lists, put into +other
:0:
* ^TO(((help|info|bug)-)?gnu-(emacs|utils|([0-9a-zA-Z]+-)?sources)|\
	mh-users|procmail|SmartList|MailAgent|Majordomo(-(users|workers))?|\
	list-managers|com-priv-digest-dist|amd-workers|\
	perl-users|sybase-l|(info-)?ietf(-announce(-request)?)?)@
$OTHER
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# If the mail is to an administrative alias, -> +admin
:0:
* $ ^TO($REQUEST|$STAFF)$POST_ADDR_SPAN
$ADMIN
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# If mail is from some kind of daemon, drop it in the +admin folder
:0:
* ^FROM_MAILER
$ADMIN
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# Drop any remaining into my $INBOX

:0:
$INBOX
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

:
    ? test -f foo
    /dev/null