version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
PROCMAIL |
|
|
2 |
!!!PROCMAIL |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
EXAMPLES |
|
|
8 |
FILES |
|
|
9 |
SEE ALSO |
|
|
10 |
DIAGNOSTICS |
|
|
11 |
EXTENDED DIAGNOSTICS |
|
|
12 |
WARNINGS |
|
|
13 |
BUGS |
|
|
14 |
MISCELLANEOUS |
|
|
15 |
NOTES |
|
|
16 |
SOURCE |
|
|
17 |
MAILINGLIST |
|
|
18 |
AUTHORS |
|
|
19 |
---- |
|
|
20 |
!!NAME |
|
|
21 |
|
|
|
22 |
|
|
|
23 |
procmail - autonomous mail processor |
|
|
24 |
!!SYNOPSIS |
|
|
25 |
|
|
|
26 |
|
|
|
27 |
__procmail__ [[__-ptoY__] [[__-f__ ''fromwhom''] |
|
|
28 |
[[''parameter''__=__''value'' | ''rcfile''] |
|
|
29 |
...__ |
|
|
30 |
procmail__ [[__-toY__] [[__-f__ ''fromwhom''] |
|
|
31 |
[[__-a__ ''argument''] ... __-d__ ''recipient'' |
|
|
32 |
...__ |
|
|
33 |
procmail__ [[__-ptY__] __-m__ |
|
|
34 |
[[''parameter''__=__''value''] ... ''rcfile'' |
|
|
35 |
[[''argument''] ...__ |
|
|
36 |
procmail -v__ |
|
|
37 |
!!DESCRIPTION |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
For a quick start, see __NOTES__ at the end. |
|
|
41 |
|
|
|
42 |
|
|
|
43 |
__Procmail__ should be invoked automatically over the |
|
|
44 |
__.forward__ file mechanism as soon as mail arrives. |
|
|
45 |
Alternatively, when installed by a system administrator, it |
|
|
46 |
can be invoked from within the mailer immediately. When |
|
|
47 |
invoked, it first sets some environment variables to default |
|
|
48 |
values, reads the mail message from stdin until an EOF, |
|
|
49 |
separates the body from the header, and then, if no command |
|
|
50 |
line arguments are present, it starts to look for a file |
|
|
51 |
named __$HOME/.procmailrc__. According to the processing |
|
|
52 |
recipes in this file, the mail message that just arrived |
|
|
53 |
gets distributed into the right folder (and more). If no |
|
|
54 |
rcfile is found, or processing of the rcfile falls off the |
|
|
55 |
end, procmail will store the mail in the default system |
|
|
56 |
mailbox. |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
If no rcfiles and no __-p__ have been specified on the |
|
|
60 |
command line, procmail will, prior to reading |
|
|
61 |
$HOME/.procmailrc, interpret commands from |
|
|
62 |
__/etc/procmailrc__ (if present). Care must be taken when |
|
|
63 |
creating /etc/procmailrc, because, if circumstances permit, |
|
|
64 |
it will be executed with root privileges (contrary to the |
|
|
65 |
$HOME/.procmailrc file of course). |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
If running suid root or with root privileges, procmail will |
|
|
69 |
be able to perform as a functionally enhanced, backwards |
|
|
70 |
compatible mail delivery agent. |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
Procmail can also be used as a general purpose mail filter, |
|
|
74 |
i.e., provisions have been made to enable procmail to be |
|
|
75 |
invoked in a special sendmail rule. |
|
|
76 |
|
|
|
77 |
|
|
|
78 |
The rcfile format is described in detail in the |
|
|
79 |
procmailrc(5) man page. |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
The weighted scoring technique is described in detail in the |
|
|
83 |
procmailsc(5) man page. |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
Examples for rcfile recipes can be looked up in the |
|
|
87 |
procmailex(5) man page. |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
__Signals__ |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
__TERMINATE__ |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
Terminate prematurely and requeue the mail. |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
__HANGUP__ |
|
|
100 |
|
|
|
101 |
|
|
|
102 |
Terminate prematurely and bounce the mail. |
|
|
103 |
|
|
|
104 |
|
|
|
105 |
__INTERRUPT__ |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
Terminate prematurely and bounce the mail. |
|
|
109 |
|
|
|
110 |
|
|
|
111 |
__QUIT__ Terminate prematurely and silently lose the |
|
|
112 |
mail. |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
__ALARM__ |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
Force a timeout (see __TIMEOUT).__ |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
__USR1__ Equivalent to a __VERBOSE__=off. |
|
|
122 |
|
|
|
123 |
|
|
|
124 |
__USR2__ Equivalent to a __VERBOSE__=on. |
|
|
125 |
!!OPTIONS |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
__-v__ |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
Procmail will print its version number, display its compile |
|
|
132 |
time configuration and exit. |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
__-p__ |
|
|
136 |
|
|
|
137 |
|
|
|
138 |
Preserve any old environment. Normally procmail clears the |
|
|
139 |
environment upon startup, except for the value of TZ. |
|
|
140 |
However, in any case: any default values will override any |
|
|
141 |
preexisting environment variables, i.e., procmail will not |
|
|
142 |
pay any attention to any predefined environment variables, |
|
|
143 |
it will happily overwrite them with its own defaults. For |
|
|
144 |
the list of environment variables that procmail will preset |
|
|
145 |
see the procmailrc(5) man page. If both -p and -m are |
|
|
146 |
specified, the list of preset environment variables shrinks |
|
|
147 |
to just: LOGNAME, HOME, SHELL, ORGMAIL and |
|
|
148 |
MAILDIR. |
|
|
149 |
|
|
|
150 |
|
|
|
151 |
__-t__ |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
Make procmail fail softly, i.e., if procmail cannot deliver |
|
|
155 |
the mail to any of the destinations you gave, the mail will |
|
|
156 |
not bounce, but will return to the mailqueue. Another |
|
|
157 |
delivery-attempt will be made at some time in the |
|
|
158 |
future. |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
__-f__ ''fromwhom'' |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
Causes procmail to regenerate the leading `From ' line with |
|
|
165 |
''fromwhom'' as the sender (instead of -f one could use |
|
|
166 |
the alternate and obsolete -r). If ''fromwhom'' consists |
|
|
167 |
merely of a single `-', then procmail will only update the |
|
|
168 |
timestamp on the `From ' line (if present, if not, it will |
|
|
169 |
generate a new one). |
|
|
170 |
|
|
|
171 |
|
|
|
172 |
__-o__ |
|
|
173 |
|
|
|
174 |
|
|
|
175 |
Instead of allowing anyone to generate `From ' lines, simply |
|
|
176 |
override the fakes. |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
__-Y__ |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
Assume traditional Berkeley mailbox format, ignore any |
|
|
183 |
__Content-Length:__ fields. |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
__-a__ ''argument'' |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
This will set $1 to be equal to ''argument''. Each |
|
|
190 |
succeeding __-a__ ''argument'' will set the next |
|
|
191 |
number variable ($2, $3, etc). It can be used to pass meta |
|
|
192 |
information along to procmail. This is typically done by |
|
|
193 |
passing along the $@x information from the sendmail mailer |
|
|
194 |
rule. |
|
|
195 |
|
|
|
196 |
|
|
|
197 |
__-d__ ''recipient ...'' |
|
|
198 |
|
|
|
199 |
|
|
|
200 |
This turns on explicit delivery mode, delivery will be to |
|
|
201 |
the local user ''recipient''. This, of course, only is |
|
|
202 |
possible if procmail has root privileges (or if procmail is |
|
|
203 |
already running with the recipient's euid and egid). |
|
|
204 |
Procmail will setuid to the intended recipients and delivers |
|
|
205 |
the mail as if it were invoked by the recipient with no |
|
|
206 |
arguments (i.e., if no rcfile is found, delivery is like |
|
|
207 |
ordinary mail). This option is incompatible with |
|
|
208 |
__-p__. |
|
|
209 |
|
|
|
210 |
|
|
|
211 |
__-m__ |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
Turns procmail into a general purpose mail filter. In this |
|
|
215 |
mode one rcfile must be specified on the command line. After |
|
|
216 |
the rcfile, procmail will accept an unlimited number of |
|
|
217 |
arguments. If the rcfile is an absolute path starting with |
|
|
218 |
__/etc/procmailrcs/__ without backward references (i.e. |
|
|
219 |
the parent directory cannot be mentioned) procmail will, |
|
|
220 |
only if no security violations are found, take on the |
|
|
221 |
identity of the owner of the rcfile (or symbolic link). For |
|
|
222 |
some advanced usage of this option you should look in the |
|
|
223 |
__EXAMPLES__ section below..SH ARGUMENTS Any arguments |
|
|
224 |
containing an '=' are considered to be environment variable |
|
|
225 |
assignments, they will ''all'' be evaluated after the |
|
|
226 |
default values have been assigned and before the first |
|
|
227 |
rcfile is opened. |
|
|
228 |
|
|
|
229 |
|
|
|
230 |
Any other arguments are presumed to be rcfile paths (either |
|
|
231 |
absolute, or if they start with `./' relative to the current |
|
|
232 |
directory; __any other relative__ path is relative to |
|
|
233 |
$HOME, unless the __-m__ option has been given, in which |
|
|
234 |
case all relative paths are relative to the current |
|
|
235 |
directory); procmail will start with the first one it finds |
|
|
236 |
on the command line. The following ones will only be parsed |
|
|
237 |
if the preceding ones have a not matching HOST-directive |
|
|
238 |
entry, or in case they should not exist. |
|
|
239 |
|
|
|
240 |
|
|
|
241 |
If no rcfiles are specified, it looks for |
|
|
242 |
__$HOME/.procmailrc__. If not even that can be found, |
|
|
243 |
processing will continue according to the default settings |
|
|
244 |
of the environment variables and the ones specified on the |
|
|
245 |
command line. |
|
|
246 |
!!EXAMPLES |
|
|
247 |
|
|
|
248 |
|
|
|
249 |
Examples for rcfile recipes can be looked up in the |
|
|
250 |
procmailex(5) man page. A small sample rcfile can be |
|
|
251 |
found in the __NOTES__ section below. |
|
|
252 |
|
|
|
253 |
|
|
|
254 |
Skip the rest of this EXAMPLES section unless you are a |
|
|
255 |
system administrator who is vaguely familiar with |
|
|
256 |
sendmail.cf syntax. |
|
|
257 |
|
|
|
258 |
|
|
|
259 |
The __-m__ option is typically used when procmail is |
|
|
260 |
called from within a rule in the sendmail.cf file. In order |
|
|
261 |
to be able to do this it is convenient to create an extra |
|
|
262 |
`procmail' mailer in your sendmail.cf file (in addition to |
|
|
263 |
the perhaps already present `local' mailer that starts up |
|
|
264 |
procmail). To create such a `procmail' mailer I'd suggest |
|
|
265 |
something like: |
|
|
266 |
|
|
|
267 |
|
|
|
268 |
Mprocmail, P=/usr/bin/procmail, F=mSDFMhun, S=11, R=21, |
|
|
269 |
A=procmail -m $h $g $u |
|
|
270 |
This enables you to use rules like the following (most likely in ruleset 0) to filter mail through the procmail mailer (please note the leading tab to continue the rule, and the tab to separate the comments): |
|
|
271 |
|
|
|
272 |
|
|
|
273 |
R$* |
|
|
274 |
And /etc/procmailrcs/some.rc could be as simple as: |
|
|
275 |
|
|
|
276 |
|
|
|
277 |
SENDER = |
|
|
278 |
Do watch out when sending mail from within the /etc/procmailrcs/some.rc file, if you send mail to addresses which match the first rule again, you could be creating an endless mail loop. |
|
|
279 |
!!FILES |
|
|
280 |
|
|
|
281 |
|
|
|
282 |
__/etc/passwd__ to set the recipient's LOGNAME, HOME and |
|
|
283 |
SHELL variable defaults |
|
|
284 |
|
|
|
285 |
|
|
|
286 |
__/var/mail/$LOGNAME__ |
|
|
287 |
|
|
|
288 |
|
|
|
289 |
system mailbox; both the system mailbox and the immediate |
|
|
290 |
directory it is in will be created every time procmail |
|
|
291 |
starts and either one is not present |
|
|
292 |
|
|
|
293 |
|
|
|
294 |
__/etc/procmailrc__ initial global rcfile |
|
|
295 |
|
|
|
296 |
|
|
|
297 |
__/etc/procmailrcs/__ |
|
|
298 |
|
|
|
299 |
|
|
|
300 |
special privileges path for rcfiles |
|
|
301 |
|
|
|
302 |
|
|
|
303 |
__$HOME/.procmailrc__ |
|
|
304 |
|
|
|
305 |
|
|
|
306 |
default rcfile |
|
|
307 |
|
|
|
308 |
|
|
|
309 |
__/var/mail/$LOGNAME.lock__ |
|
|
310 |
|
|
|
311 |
|
|
|
312 |
lockfile for the system mailbox (not automatically used by |
|
|
313 |
procmail, unless $DEFAULT equals /var/mail/$LOGNAME and |
|
|
314 |
procmail is delivering to $DEFAULT) |
|
|
315 |
|
|
|
316 |
|
|
|
317 |
__/usr/sbin/sendmail__ |
|
|
318 |
|
|
|
319 |
|
|
|
320 |
default mail forwarder |
|
|
321 |
|
|
|
322 |
|
|
|
323 |
___????`hostname`__ temporary `unique' zero-length files |
|
|
324 |
created by procmail |
|
|
325 |
!!SEE ALSO |
|
|
326 |
|
|
|
327 |
|
|
|
328 |
procmailrc(5), procmailsc(5), |
|
|
329 |
procmailex(5), sh(1), csh(1), |
|
|
330 |
mail(1), mailx(1), binmail(1), |
|
|
331 |
uucp(1), aliases(5), sendmail(8), |
|
|
332 |
egrep(1), grep(1), biff(1), |
|
|
333 |
comsat(8), lockfile(1), formail(1), |
|
|
334 |
cron(1) |
|
|
335 |
!!DIAGNOSTICS |
|
|
336 |
|
|
|
337 |
|
|
|
338 |
Autoforwarding mailbox found |
|
|
339 |
|
|
|
340 |
|
|
|
341 |
The system mailbox had its suid or sgid bit set, procmail |
|
|
342 |
terminates with EX_NOUSER assuming that this mailbox must |
|
|
343 |
not be delivered to. |
|
|
344 |
|
|
|
345 |
|
|
|
346 |
Bad substitution of |
|
|
347 |
|
|
|
348 |
|
|
|
349 |
Not a valid environment variable name |
|
|
350 |
specified. |
|
|
351 |
|
|
|
352 |
|
|
|
353 |
Closing brace unexpected |
|
|
354 |
|
|
|
355 |
|
|
|
356 |
There was no corresponding opening brace (nesting |
|
|
357 |
block). |
|
|
358 |
|
|
|
359 |
|
|
|
360 |
Conflicting options |
|
|
361 |
|
|
|
362 |
|
|
|
363 |
Not all option combinations are useful |
|
|
364 |
|
|
|
365 |
|
|
|
366 |
Conflicting x suppressed |
|
|
367 |
|
|
|
368 |
|
|
|
369 |
Flag x is not compatible with some other flag on this |
|
|
370 |
recipe. |
|
|
371 |
|
|
|
372 |
|
|
|
373 |
Couldn't create |
|
|
374 |
|
|
|
375 |
|
|
|
376 |
The system mailbox was missing and could not/will not be |
|
|
377 |
created. |
|
|
378 |
|
|
|
379 |
|
|
|
380 |
Couldn't create maildir part |
|
|
381 |
|
|
|
382 |
|
|
|
383 |
The maildir folder |
|
|
384 |
|
|
|
385 |
|
|
|
386 |
Couldn't create or rename temp file |
|
|
387 |
|
|
|
388 |
|
|
|
389 |
An error occurred in the mechanics of delivering to the |
|
|
390 |
directory folder |
|
|
391 |
|
|
|
392 |
|
|
|
393 |
Couldn't determine implicit lockfile from |
|
|
394 |
|
|
|
395 |
|
|
|
396 |
There were no ` |
|
|
397 |
|
|
|
398 |
|
|
|
399 |
Couldn't read |
|
|
400 |
|
|
|
401 |
|
|
|
402 |
Procmail was unable to open an rc- file or it was not a |
|
|
403 |
regular file, or procmail couldn't open an MH di- rectory to |
|
|
404 |
find the highest num- bered file. |
|
|
405 |
|
|
|
406 |
|
|
|
407 |
Couldn't unlock |
|
|
408 |
|
|
|
409 |
|
|
|
410 |
Lockfile was already gone, or write permission to the |
|
|
411 |
directory where the lockfile is has been |
|
|
412 |
denied. |
|
|
413 |
|
|
|
414 |
|
|
|
415 |
Deadlock attempted on |
|
|
416 |
|
|
|
417 |
|
|
|
418 |
The locallockfile specified on this recipe is equal to a |
|
|
419 |
still active $LOCKFILE. |
|
|
420 |
|
|
|
421 |
|
|
|
422 |
Denying special privileges for |
|
|
423 |
|
|
|
424 |
|
|
|
425 |
Procmail will not take on the iden- tity that comes with the |
|
|
426 |
rcfile be- cause a security violation was found (e.g. |
|
|
427 |
__-p__ or variable assign- ments on the command line) or |
|
|
428 |
proc- mail had insufficient privileges to do |
|
|
429 |
so. |
|
|
430 |
|
|
|
431 |
|
|
|
432 |
Descriptor |
|
|
433 |
|
|
|
434 |
|
|
|
435 |
As procmail was started, stdin, stdout or stderr was not |
|
|
436 |
connected (possibly an attempt to subvert se- |
|
|
437 |
curity) |
|
|
438 |
|
|
|
439 |
|
|
|
440 |
Enforcing stricter permissions on |
|
|
441 |
|
|
|
442 |
|
|
|
443 |
The system mailbox of the recipient was found to be |
|
|
444 |
unsecured, procmail secured it. |
|
|
445 |
|
|
|
446 |
|
|
|
447 |
Error while writing to |
|
|
448 |
|
|
|
449 |
|
|
|
450 |
Nonexistent subdirectory, no write permission, pipe died or |
|
|
451 |
disk full. |
|
|
452 |
|
|
|
453 |
|
|
|
454 |
Exceeded LINEBUF |
|
|
455 |
|
|
|
456 |
|
|
|
457 |
Buffer overflow detected, LINEBUF was too small, |
|
|
458 |
PROCMAIL_OVERFLOW has been set. |
|
|
459 |
|
|
|
460 |
|
|
|
461 |
MAILDIR is not an absolute path |
|
|
462 |
|
|
|
463 |
|
|
|
464 |
MAILDIR path too long |
|
|
465 |
|
|
|
466 |
|
|
|
467 |
ORGMAIL is not an absolute path |
|
|
468 |
|
|
|
469 |
|
|
|
470 |
ORGMAIL path too long |
|
|
471 |
|
|
|
472 |
|
|
|
473 |
default rcfile is not an absolute path |
|
|
474 |
|
|
|
475 |
|
|
|
476 |
default rcfile path too long |
|
|
477 |
|
|
|
478 |
|
|
|
479 |
The specified item's full path, when expanded, was longer |
|
|
480 |
than LINEBUF or didn't start with a file |
|
|
481 |
separator. |
|
|
482 |
|
|
|
483 |
|
|
|
484 |
Excessive output quenched from |
|
|
485 |
|
|
|
486 |
|
|
|
487 |
The program or filter |
|
|
488 |
|
|
|
489 |
|
|
|
490 |
Extraneous x ignored |
|
|
491 |
|
|
|
492 |
|
|
|
493 |
The action line or other flags on this recipe makes flag x |
|
|
494 |
meaning- less. |
|
|
495 |
|
|
|
496 |
|
|
|
497 |
Failed forking |
|
|
498 |
|
|
|
499 |
|
|
|
500 |
Process table is full (and NORES- RETRY has been |
|
|
501 |
exhausted). |
|
|
502 |
|
|
|
503 |
|
|
|
504 |
Failed to execute |
|
|
505 |
|
|
|
506 |
|
|
|
507 |
Program not in path, or not exe- cutable. |
|
|
508 |
|
|
|
509 |
|
|
|
510 |
Forced unlock denied on |
|
|
511 |
|
|
|
512 |
|
|
|
513 |
No write permission in the directo- ry where __lockfile__ |
|
|
514 |
__ |
|
|
515 |
|
|
|
516 |
|
|
|
517 |
Forcing lock on |
|
|
518 |
|
|
|
519 |
|
|
|
520 |
__Lockfile__ |
|
|
521 |
__LOCKTIMEOUT__). |
|
|
522 |
|
|
|
523 |
|
|
|
524 |
Incomplete recipe |
|
|
525 |
|
|
|
526 |
|
|
|
527 |
The start of a recipe was found, but it stranded in an |
|
|
528 |
EOF. |
|
|
529 |
|
|
|
530 |
|
|
|
531 |
Insufficient privileges |
|
|
532 |
|
|
|
533 |
|
|
|
534 |
Procmail either needs root privi- leges, or must have the |
|
|
535 |
right (e)uid __and__ (e)gid to run in deliv- ery mode. |
|
|
536 |
The mail will bounce. |
|
|
537 |
|
|
|
538 |
|
|
|
539 |
Invalid regexp |
|
|
540 |
|
|
|
541 |
|
|
|
542 |
The regular expression |
|
|
543 |
|
|
|
544 |
|
|
|
545 |
Kernel-lock failed |
|
|
546 |
|
|
|
547 |
|
|
|
548 |
While trying to use the kernel-sup- ported locking calls, |
|
|
549 |
one of them failed (usually indicates an OS er- ror), |
|
|
550 |
procmail ignores this error and proceeds. |
|
|
551 |
|
|
|
552 |
|
|
|
553 |
Kernel-unlock failed |
|
|
554 |
|
|
|
555 |
|
|
|
556 |
See above. |
|
|
557 |
|
|
|
558 |
|
|
|
559 |
Lock failure on |
|
|
560 |
|
|
|
561 |
|
|
|
562 |
Can only occur if you specify some real weird (and illegal) |
|
|
563 |
lockfile- names or if the __lockfile__ could not be |
|
|
564 |
created because of insufficient permissions or nonexistent |
|
|
565 |
subdi- rectories. |
|
|
566 |
|
|
|
567 |
|
|
|
568 |
Lost |
|
|
569 |
|
|
|
570 |
|
|
|
571 |
Missing action The current recipe was found to be |
|
|
572 |
incomplete. |
|
|
573 |
|
|
|
574 |
|
|
|
575 |
Missing closing brace |
|
|
576 |
|
|
|
577 |
|
|
|
578 |
A nesting block was started, but never |
|
|
579 |
finished. |
|
|
580 |
|
|
|
581 |
|
|
|
582 |
Missing name The -f option needs an extra |
|
|
583 |
argument. |
|
|
584 |
|
|
|
585 |
|
|
|
586 |
Missing argument |
|
|
587 |
|
|
|
588 |
|
|
|
589 |
You specified the -a option but forgot the |
|
|
590 |
argument. |
|
|
591 |
|
|
|
592 |
|
|
|
593 |
Missing rcfile You speci- fied the -m option, procmail ex- |
|
|
594 |
pects the name of an rcfile as ar- gument. |
|
|
595 |
|
|
|
596 |
|
|
|
597 |
Missing recipient |
|
|
598 |
|
|
|
599 |
|
|
|
600 |
You specified the -d option or called procmail under a |
|
|
601 |
different name, it expects one or more recip- ients as |
|
|
602 |
arguments. |
|
|
603 |
|
|
|
604 |
|
|
|
605 |
No space left to finish writing |
|
|
606 |
|
|
|
607 |
|
|
|
608 |
The filesystem containing |
|
|
609 |
|
|
|
610 |
|
|
|
611 |
Out of memory The system is out of swap space (and NORES- |
|
|
612 |
RETRY has been exhausted). |
|
|
613 |
|
|
|
614 |
|
|
|
615 |
Processing continued |
|
|
616 |
|
|
|
617 |
|
|
|
618 |
The unrecognised options on the command line are ignored, |
|
|
619 |
proceed- ing as usual. |
|
|
620 |
|
|
|
621 |
|
|
|
622 |
Program failure (nnn) of |
|
|
623 |
|
|
|
624 |
|
|
|
625 |
Program that was started by proc- mail returned nnn instead |
|
|
626 |
of EX- IT_SUCCESS (=0); if nnn is nega- tive, then this is |
|
|
627 |
the signal the program died on. |
|
|
628 |
|
|
|
629 |
|
|
|
630 |
Quota exceeded while writing |
|
|
631 |
|
|
|
632 |
|
|
|
633 |
The filesize quota for the recipi- ent on the filesystem |
|
|
634 |
containing |
|
|
635 |
|
|
|
636 |
|
|
|
637 |
Renaming bogus |
|
|
638 |
|
|
|
639 |
|
|
|
640 |
The system mailbox of the recipient was found to be bogus, |
|
|
641 |
procmail performed evasive actions. |
|
|
642 |
|
|
|
643 |
|
|
|
644 |
Rescue of unfiltered data succeeded/failed |
|
|
645 |
|
|
|
646 |
|
|
|
647 |
A filter returned unsuccessfully, procmail tried to get back |
|
|
648 |
the original text. |
|
|
649 |
|
|
|
650 |
|
|
|
651 |
Skipped: |
|
|
652 |
|
|
|
653 |
|
|
|
654 |
Suspicious rcfile |
|
|
655 |
|
|
|
656 |
|
|
|
657 |
The owner of the rcfile was not the recipient or root, the |
|
|
658 |
file was world writable, or the directory that contained it |
|
|
659 |
was world writable, or this was the default rcfile |
|
|
660 |
($HOME/.procmailrc) and ei- ther it was group writable or |
|
|
661 |
the directory that contained it was group writable (the |
|
|
662 |
rcfile was not used). |
|
|
663 |
|
|
|
664 |
|
|
|
665 |
Terminating prematurely whilst waiting for ... |
|
|
666 |
|
|
|
667 |
|
|
|
668 |
Procmail received a signal while it was waiting for |
|
|
669 |
... |
|
|
670 |
|
|
|
671 |
|
|
|
672 |
Timeout, terminating |
|
|
673 |
|
|
|
674 |
|
|
|
675 |
Timeout has occurred on program or filter |
|
|
676 |
|
|
|
677 |
|
|
|
678 |
Timeout, was waiting for |
|
|
679 |
|
|
|
680 |
|
|
|
681 |
Timeout has occurred on program, filter or file |
|
|
682 |
|
|
|
683 |
|
|
|
684 |
Truncated file to former size |
|
|
685 |
|
|
|
686 |
|
|
|
687 |
The file could not be delivered to successfully, so the file |
|
|
688 |
was trun- cated to its former size. |
|
|
689 |
|
|
|
690 |
|
|
|
691 |
Truncating |
|
|
692 |
|
|
|
693 |
|
|
|
694 |
|
|
|
695 |
|
|
|
696 |
Unable to treat as directory |
|
|
697 |
|
|
|
698 |
|
|
|
699 |
Either the suffix on |
|
|
700 |
|
|
|
701 |
|
|
|
702 |
Unexpected EOL Missing closing quote, or trying to escape |
|
|
703 |
EOF. |
|
|
704 |
|
|
|
705 |
|
|
|
706 |
Unknown user |
|
|
707 |
|
|
|
708 |
|
|
|
709 |
The specified recipient does not have a corresponding |
|
|
710 |
uid. |
|
|
711 |
!!EXTENDED DIAGNOSTICS |
|
|
712 |
|
|
|
713 |
|
|
|
714 |
Extended diagnostics can be turned on and off through set- |
|
|
715 |
ting the VERBOSE variable. |
|
|
716 |
|
|
|
717 |
|
|
|
718 |
[[pid] time |
|
|
719 |
|
|
|
720 |
|
|
|
721 |
Procmail's pid and a timestamp. Generated whenever procmail |
|
|
722 |
logs a diagnostic and at least a second has elapsed since |
|
|
723 |
the last times- tamp. |
|
|
724 |
|
|
|
725 |
|
|
|
726 |
Acquiring kernel-lock |
|
|
727 |
|
|
|
728 |
|
|
|
729 |
Procmail now tries to kernel-lock the most recently opened |
|
|
730 |
file (de- scriptor). |
|
|
731 |
|
|
|
732 |
|
|
|
733 |
Assigning |
|
|
734 |
|
|
|
735 |
|
|
|
736 |
Assuming identity of the recipient, VERBOSE=off |
|
|
737 |
|
|
|
738 |
|
|
|
739 |
Dropping all privileges (if any), implicitly turns off |
|
|
740 |
extended diag- nostics. |
|
|
741 |
|
|
|
742 |
|
|
|
743 |
Bypassed locking |
|
|
744 |
|
|
|
745 |
|
|
|
746 |
The mail spool directory was not accessible to procmail, it |
|
|
747 |
relied solely on kernel locks. |
|
|
748 |
|
|
|
749 |
|
|
|
750 |
Executing |
|
|
751 |
|
|
|
752 |
|
|
|
753 |
HOST mismatched |
|
|
754 |
|
|
|
755 |
|
|
|
756 |
This host was called |
|
|
757 |
|
|
|
758 |
|
|
|
759 |
Locking |
|
|
760 |
|
|
|
761 |
|
|
|
762 |
Linking to |
|
|
763 |
|
|
|
764 |
|
|
|
765 |
Match on |
|
|
766 |
|
|
|
767 |
|
|
|
768 |
Matched |
|
|
769 |
MATCH__. |
|
|
770 |
|
|
|
771 |
|
|
|
772 |
No match on |
|
|
773 |
|
|
|
774 |
|
|
|
775 |
Non-zero exitcode (nnn) by |
|
|
776 |
|
|
|
777 |
|
|
|
778 |
Program that was started by proc- mail as a condition or as |
|
|
779 |
the ac- tion of a recipe with the `W' flag returned nnn |
|
|
780 |
instead of EXIT_SUC- CESS (=0); the usage indicates that |
|
|
781 |
this is not an entirely unexpected condition. |
|
|
782 |
|
|
|
783 |
|
|
|
784 |
Notified comsat: |
|
|
785 |
|
|
|
786 |
|
|
|
787 |
Sent comsat/biff a notice that mail arrived for user |
|
|
788 |
$LOGNAME at `off- set' in `file'. |
|
|
789 |
|
|
|
790 |
|
|
|
791 |
Opening |
|
|
792 |
|
|
|
793 |
|
|
|
794 |
Rcfile: |
|
|
795 |
|
|
|
796 |
|
|
|
797 |
Reiterating kernel-lock |
|
|
798 |
|
|
|
799 |
|
|
|
800 |
While attempting several locking methods, one of these |
|
|
801 |
failed. Procmail will reiterate until they all succeed in |
|
|
802 |
rapid succession. |
|
|
803 |
|
|
|
804 |
|
|
|
805 |
Score: added newtotal |
|
|
806 |
|
|
|
807 |
|
|
|
808 |
This condition scored `added' points, which resulted in a |
|
|
809 |
`newto- tal' score. |
|
|
810 |
|
|
|
811 |
|
|
|
812 |
Unlocking |
|
|
813 |
!!WARNINGS |
|
|
814 |
|
|
|
815 |
|
|
|
816 |
You should create a shell script that uses |
|
|
817 |
lockfile(1) be- fore invoking your mail shell on any |
|
|
818 |
mailbox file other than the system mailbox (unless of |
|
|
819 |
course, your mail shell uses the same lockfiles (local or |
|
|
820 |
global) you specified in your rcfile). |
|
|
821 |
|
|
|
822 |
|
|
|
823 |
In the unlikely event that you absolutely need to kill |
|
|
824 |
procmail before it has finished, first try and use the |
|
|
825 |
regular kill command (i.e., ''not'' kill -9, see the |
|
|
826 |
subsec- tion ''Signals'' for suggestions), otherwise some |
|
|
827 |
''lockfiles'' might not get removed. |
|
|
828 |
|
|
|
829 |
|
|
|
830 |
Beware when using the __-t__ option, if procmail |
|
|
831 |
repeatedly is unable to deliver the mail (e.g., due to an |
|
|
832 |
incorrect rc- file), the system mailqueue could fill up. |
|
|
833 |
This could ag- gravate both the local postmaster and other |
|
|
834 |
users. |
|
|
835 |
|
|
|
836 |
|
|
|
837 |
The __/etc/procmailrc__ file might be executed with root |
|
|
838 |
priv- ileges, so be very careful of what you put in it. |
|
|
839 |
__SHELL__ will be equal to that of the current recipient, |
|
|
840 |
so if procmail has to invoke the shell, you'd better set it |
|
|
841 |
to some safe value first. See also: |
|
|
842 |
__DROPPRIVS__. |
|
|
843 |
|
|
|
844 |
|
|
|
845 |
Keep in mind that if chown(1) is permitted on files |
|
|
846 |
in __/etc/procmailrcs/__, that they can be chowned to |
|
|
847 |
root (or anyone else) by their current owners. For maximum |
|
|
848 |
securi- ty, make sure this directory is ''executable'' to |
|
|
849 |
root only. |
|
|
850 |
|
|
|
851 |
|
|
|
852 |
Procmail is not the proper tool for sharing one mailbox |
|
|
853 |
among many users, such as when you have one POP account for |
|
|
854 |
all mail to your domain. It can be done if you manage to |
|
|
855 |
configure your MTA to add some headers with the enve- lope |
|
|
856 |
recipient data in order to tell Procmail who a mes- sage is |
|
|
857 |
for, but this is usually not the right thing to do. Perhaps |
|
|
858 |
you want to investigate if your MTA offers `virtual user |
|
|
859 |
tables', or check out the `multidrop' facil- ity of |
|
|
860 |
Fetchmail. |
|
|
861 |
!!BUGS |
|
|
862 |
|
|
|
863 |
|
|
|
864 |
After removing a lockfile by force, procmail waits $SUS- |
|
|
865 |
PEND seconds before creating a new lockfile so that anoth- |
|
|
866 |
er process that decides to remove the stale lockfile will |
|
|
867 |
not remove the newly created lock by mistake. |
|
|
868 |
|
|
|
869 |
|
|
|
870 |
Procmail uses the regular TERMINATE signal to terminate any |
|
|
871 |
runaway filter, but it does not check if the filter responds |
|
|
872 |
to that signal and it only sends it to the filter itself, |
|
|
873 |
not to any of the filter's children. |
|
|
874 |
|
|
|
875 |
|
|
|
876 |
A continued __Content-Length:__ field is not handled |
|
|
877 |
correct- ly. |
|
|
878 |
|
|
|
879 |
|
|
|
880 |
The embedded newlines in a continued header should be |
|
|
881 |
skipped when matching instead of being treated as a single |
|
|
882 |
space as they are now. |
|
|
883 |
!!MISCELLANEOUS |
|
|
884 |
|
|
|
885 |
|
|
|
886 |
If there is an existing __Content-Length:__ field in the |
|
|
887 |
head- er of the mail and the __-Y__ option is not |
|
|
888 |
specified, proc- mail will trim the field to report the |
|
|
889 |
correct size. Procmail does not change the |
|
|
890 |
fieldwidth. |
|
|
891 |
|
|
|
892 |
|
|
|
893 |
If there is no __Content-Length:__ field or the __-Y__ |
|
|
894 |
option has been specified and procmail appends to regular |
|
|
895 |
mailfold- ers, any lines in the body of the message that |
|
|
896 |
look like postmarks are prepended with ` |
|
|
897 |
__ |
|
|
898 |
|
|
|
899 |
|
|
|
900 |
`nFrom ' |
|
|
901 |
If the destination name used in explicit delivery mode is not in /etc/passwd, procmail will proceed as if explicit delivery mode was not in effect. If not in explicit de- livery mode and should the uid procmail is running under, have no corresponding /etc/passwd entry, then HOME will default to /, LOGNAME will default to #uid, SHELL will de- fault to /bin/sh, and ORGMAIL will default to /tmp/dead.letter. |
|
|
902 |
|
|
|
903 |
|
|
|
904 |
When in explicit delivery mode, procmail will generate a |
|
|
905 |
leading `From ' line if none is present. If one is al- ready |
|
|
906 |
present procmail will leave it intact. If procmail is not |
|
|
907 |
invoked with one of the following user or group ids : root, |
|
|
908 |
daemon, uucp, mail, x400, network, list, slist, lists or |
|
|
909 |
news, but still has to generate or accept a new `From ' |
|
|
910 |
line, it will generate an additional ` |
|
|
911 |
|
|
|
912 |
|
|
|
913 |
For security reasons procmail will only use an absolute or |
|
|
914 |
$HOME-relative rcfile if it is owned by the recipient or |
|
|
915 |
root, not world writable, and the directory it is con- |
|
|
916 |
tained in is not world writable. The $HOME/.procmailrc file |
|
|
917 |
has the additional constraint of not being group-writable or |
|
|
918 |
in a group-writable directory. |
|
|
919 |
|
|
|
920 |
|
|
|
921 |
If /var/mail/$LOGNAME is a bogus mailbox (i.e., does not |
|
|
922 |
belong to the recipient, is unwritable, is a symbolic link |
|
|
923 |
or is a hard link), procmail will upon startup try to re- |
|
|
924 |
name it into a file starting with `BOGUS.$LOGNAME.' and |
|
|
925 |
ending in an inode-sequence-code. If this turns out to be |
|
|
926 |
impossible, __ORGMAIL__ will have ''no'' initial |
|
|
927 |
value, and hence will inhibit delivery without a proper |
|
|
928 |
rcfile. |
|
|
929 |
|
|
|
930 |
|
|
|
931 |
If /var/mail/$LOGNAME already is a valid mailbox, but has |
|
|
932 |
got too loose permissions on it, procmail will correct this. |
|
|
933 |
To prevent procmail from doing this make sure the u+x bit is |
|
|
934 |
set. |
|
|
935 |
|
|
|
936 |
|
|
|
937 |
When delivering to directories, MH folders, or maildir |
|
|
938 |
folders, you __don't__ need to use lockfiles to prevent |
|
|
939 |
sever- al concurrently running procmail programs from |
|
|
940 |
messing up. |
|
|
941 |
|
|
|
942 |
|
|
|
943 |
Delivering to MH folders is slightly more time consuming |
|
|
944 |
than delivering to normal directories or mailboxes, be- |
|
|
945 |
cause procmail has to search for the next available number |
|
|
946 |
(instead of having the filename immediately |
|
|
947 |
available). |
|
|
948 |
|
|
|
949 |
|
|
|
950 |
On general failure procmail will return EX_CANTCREAT, un- |
|
|
951 |
less option __-t__ is specified, in which case it will |
|
|
952 |
return EX_TEMPFAIL. |
|
|
953 |
|
|
|
954 |
|
|
|
955 |
To make `egrepping' of headers more consistent, procmail |
|
|
956 |
concatenates all continued header fields; but only inter- |
|
|
957 |
nally. When delivering the mail, line breaks will appear as |
|
|
958 |
before. |
|
|
959 |
|
|
|
960 |
|
|
|
961 |
If procmail is called under a name not starting with |
|
|
962 |
`procmail' (e.g., if it is linked to another name and in- |
|
|
963 |
voked as such), it comes up in explicit delivery mode, and |
|
|
964 |
expects the recipients' names as command line arguments (as |
|
|
965 |
if -d had been specified). |
|
|
966 |
|
|
|
967 |
|
|
|
968 |
Comsat/biff notifications are done using udp. They are sent |
|
|
969 |
off once when procmail generates the regular logfile entry. |
|
|
970 |
The notification messages have the following ex- tended |
|
|
971 |
format (or as close as you can get when final de- livery was |
|
|
972 |
not to a file): |
|
|
973 |
|
|
|
974 |
|
|
|
975 |
$LOGNAME@offset_of_message_in_mailbox:absolute_path_to_mailbox |
|
|
976 |
Whenever procmail itself opens a file to deliver to, it consistently uses the following kernel locking strategies: fcntl(2). |
|
|
977 |
|
|
|
978 |
|
|
|
979 |
Procmail is NFS-resistant and eight-bit clean. |
|
|
980 |
!!NOTES |
|
|
981 |
|
|
|
982 |
|
|
|
983 |
Calling up procmail with the -h or -? options will cause it |
|
|
984 |
to display a command-line help and recipe flag |
|
|
985 |
quick-reference page. |
|
|
986 |
|
|
|
987 |
|
|
|
988 |
There exists an excellent newbie FAQ about mailfilters (and |
2 |
perry |
989 |
procmail in particular); it is maintained by Nancy !McGough |
1 |
perry |
990 |
|
|
|
991 |
|
|
|
992 |
send usenet/news.answers/mail/filtering-faq |
2 |
perry |
993 |
If procmail is ''not'' installed globally as the default mail delivery agent (ask your system administrator), you have to make sure it is invoked when your mail arrives. In this case your $HOME/.forward (beware, it __has__ to be world readable) file should contain the line below. Be sure to include the single and double quotes, and unless you know your site to be running smrsh (the !SendMail Restricted SHell), it must be an ''absolute'' path. |
1 |
perry |
994 |
|
|
|
995 |
|
|
|
996 |
Some mailers (notably exim) do not currently accept the above syntax. In such case use this instead: |
|
|
997 |
|
|
|
998 |
|
|
|
999 |
|/usr/bin/procmail |
|
|
1000 |
Procmail can also be invoked to postprocess an already filled system mailbox. This can be useful if you don't want to or can't use a $HOME/.forward file (in which case the following script could periodically be called from within cron(1), or whenever you start reading mail): |
|
|
1001 |
|
|
|
1002 |
|
|
|
1003 |
#!/bin/sh |
|
|
1004 |
ORGMAIL=/var/mail/$LOGNAME |
|
|
1005 |
if cd $HOME |
|
|
1006 |
|
|
|
1007 |
|
|
|
1008 |
__A sample small $HOME/.procmailrc:__ |
|
|
1009 |
|
|
|
1010 |
|
|
|
1011 |
PATH=/usr/local/bin:/usr/bin:/bin |
|
|
1012 |
MAILDIR=$HOME/Mail #you'd better make sure it exists |
|
|
1013 |
DEFAULT=$MAILDIR/mbox #completely optional |
|
|
1014 |
LOGFILE=$MAILDIR/from #recommended |
|
|
1015 |
:0: |
|
|
1016 |
* ^From.*berg |
|
|
1017 |
from_me |
|
|
1018 |
:0 |
|
|
1019 |
* ^Subject:.*Flame |
|
|
1020 |
/dev/null |
|
|
1021 |
Other examples for rcfile recipes can be looked up in the procmailex(5) man page. |
|
|
1022 |
!!SOURCE |
|
|
1023 |
|
|
|
1024 |
|
|
|
1025 |
This program is part of the ''procmail |
|
|
1026 |
mail-processing-pack- age'' (v3.22) available at |
|
|
1027 |
http://www.procmail.org/ or ftp.procmail.org in |
|
|
1028 |
__pub/procmail/__. |
|
|
1029 |
!!MAILINGLIST |
|
|
1030 |
|
|
|
1031 |
|
|
|
1032 |
There exists a mailinglist for questions relating to any |
|
|
1033 |
program in the procmail package: |
|
|
1034 |
|
|
|
1035 |
|
|
|
1036 |
|
|
|
1037 |
|
|
|
1038 |
|
|
|
1039 |
for subscription requests. |
|
|
1040 |
|
|
|
1041 |
|
|
|
1042 |
If you would like to stay informed about new versions and |
|
|
1043 |
official patches send a subscription request to |
|
|
1044 |
|
|
|
1045 |
|
|
|
1046 |
procmail-announce-request@procmail.org |
|
|
1047 |
(this is a readonly list). |
|
|
1048 |
!!AUTHORS |
|
|
1049 |
|
|
|
1050 |
|
|
|
1051 |
Stephen R. van den Berg |
|
|
1052 |
|
|
|
1053 |
|
|
|
1054 |
|
|
|
1055 |
Philip A. Guenther |
|
|
1056 |
|
|
|
1057 |
|
|
|
1058 |
|
|
|
1059 |
---- |