Debian Codegraph @

man/procmail.man

raw ◀ ▶
Source reconstructed at patch state 0 of 4 — not the installed (fully patched) source.
4 Debian patches touch this file
1 Please read the README file in this directory first.
2 .ex
3 .Id $Id: procmail.man,v 1.91 2001/08/27 08:44:04 guenther Exp $
4 .TH PROCMAIL 1 \*(Dt BuGless
5 .na
6 .SH NAME
7 procmail \- autonomous mail processor
8 .SH SYNOPSIS
9 .B procmail
10 .RB [ \-@PRESERVOPT@@TEMPFAILOPT@@OVERRIDEOPT@@BERKELEYOPT@ ]
11 .RB [ "\-@FROMWHOPT@ \fIfromwhom\fP" ]
12 .if n .ti +0.5i
13 .RI [ "parameter\fB=\fPvalue " | " rcfile" ]
14 \&.\|.\|.
15 .br
16 .B procmail
17 .RB [ \-@TEMPFAILOPT@@OVERRIDEOPT@@BERKELEYOPT@ ]
18 .RB [ "\-@FROMWHOPT@ \fIfromwhom\fP" ]
19 .RB [ "\-@ARGUMENTOPT@ \fIargument\fP" ]
20 \&.\|.\|.
21 .if n .ti +0.5i
22 .B \-@DELIVEROPT@
23 .I recipient
24 \&.\|.\|.
25 .br
26 .B procmail
27 .RB [ \-@PRESERVOPT@@TEMPFAILOPT@@BERKELEYOPT@ ]
28 .B \-@MAILFILTOPT@
29 .RI [ "parameter\fB=\fPvalue" ]
30 \&.\|.\|.
31 .I rcfile
32 .if n .ti +0.5i
33 .RI [ argument ]
34 \&.\|.\|.@[email protected]
35 .B procmail
36 .B \-@VERSIONOPT@
37 .ad
38 .SH DESCRIPTION
39 For a quick start, see
40 .B NOTES
41 at the end.
42 .PP
43 .B Procmail
44 should be invoked automatically over the
45 .B @DOT_FORWARD@
46 file mechanism as soon as mail arrives. Alternatively, when installed by
47 a system administrator, it can be invoked from within the mailer immediately.
48 When invoked, it first sets some environment variables to default values,
49 reads the mail message from stdin until an EOF, separates the body from the
50 header, and then, if no command line arguments are present, it starts to look
51 for a file named
52 .BR @PROCMAILRC@ .
53 According to the processing recipes in this file,
54 the mail message that just arrived gets distributed into the right folder
55 (and more). If no rcfile is found, or processing of the rcfile falls off
56 the end, procmail will store the mail in the default system
57 mailbox.@ETCRC_desc@
58 .PP
59 If running suid root or with root privileges, procmail will be able to
60 perform as a functionally enhanced, backwards compatible mail delivery agent.
61 .PP
62 Procmail can also be used as a general purpose mail filter, i.e., provisions
63 have been made to enable procmail to be invoked in a special sendmail rule.
64 .PP
65 The rcfile format is described in detail in the
66 .BR procmailrc (5)
67 man page.
68 .PP
69 The weighted scoring technique is described in detail in the
70 .BR procmailsc (5)
71 man page.
72 .PP
73 Examples for rcfile recipes can be looked up in the
74 .BR procmailex (5)
75 man page.
76 .SS Signals
77 .TP 1.2i
78 .B TERMINATE
79 Terminate prematurely and requeue the mail.
80 .TP
81 .B HANGUP
82 Terminate prematurely and bounce the mail.
83 .TP
84 .B INTERRUPT
85 Terminate prematurely and bounce the mail.
86 .TP
87 .B QUIT
88 Terminate prematurely and silently lose the mail.
89 .TP
90 .B ALARM
91 Force a timeout (see
92 .BR TIMEOUT).
93 .TP
94 .B USR1
95 Equivalent to a
96 .BR VERBOSE =off.
97 .TP
98 .B USR2
99 Equivalent to a
100 .BR VERBOSE =on.
101 .SH OPTIONS
102 .TP 0.5i
103 .B \-@VERSIONOPT@
104 Procmail will print its version number, display its compile time
105 configuration and exit.
106 .TP
107 .B \-@PRESERVOPT@
108 Preserve any old environment. Normally procmail clears the environment
109 upon startup@KEEPENV@. However, in any case: any default values will override
110 any preexisting environment variables, i.e., procmail will not pay any attention
111 to any predefined environment variables, it will happily overwrite them
112 with its own defaults. For the list of environment variables that procmail
113 will preset see the
114 .BR procmailrc (5)
115 man page. If both \-@PRESERVOPT@ and \-@MAILFILTOPT@ are specified, the
116 list of preset environment variables shrinks to just: LOGNAME, HOME, SHELL,
117 ORGMAIL and MAILDIR.
118 .TP
119 .B \-@TEMPFAILOPT@
120 Make procmail fail softly, i.e., if procmail cannot deliver the mail to
121 any of the destinations you gave, the mail will not bounce, but will return
122 to the mailqueue. Another delivery-attempt will be made at some time in
123 the future.
124 .TP
125 .I "\fB\-@FROMWHOPT@\fP fromwhom"
126 Causes procmail to regenerate the leading `@FROM@' line with
127 .I fromwhom
128 as the sender (instead of \-@FROMWHOPT@ one could use the alternate and
129 obsolete \-@ALTFROMWHOPT@). If
130 .I fromwhom
131 consists merely of a single `@REFRESH_TIME@', then procmail will only
132 update the timestamp on the `@FROM@' line (if present, if not, it will
133 generate a new one).
134 .TP
135 .B \-@OVERRIDEOPT@
136 Instead of allowing anyone to generate `@FROM@' lines, simply override
137 the fakes.
138 .TP
139 .B \-@BERKELEYOPT@
140 Assume traditional Berkeley mailbox format, ignore any
141 .B Content-Length:
142 fields.
143 .TP
144 .I "\fB\-@ARGUMENTOPT@\fP argument"
145 This will set $1 to be equal to
146 .IR argument .
147 Each succeeding
148 .I "\fB\-@ARGUMENTOPT@\fP argument"
149 will set the next number variable ($2, $3, etc). It can be used
150 to pass meta information along to procmail. This is typically done
151 by passing along the $@x information from the sendmail mailer rule.
152 .TP
153 .I "\fB\-@DELIVEROPT@\fP recipient .\|.\|."
154 This turns on explicit delivery mode, delivery will be to the local user
155 .IR recipient .
156 This, of course, only is possible if procmail has root
157 privileges@SETRUID@.
158 Procmail will setuid to the intended recipients and delivers the mail as
159 if it were invoked by the recipient with no arguments (i.e., if no rcfile
160 is found, delivery is like ordinary mail). This option is incompatible with
161 .BR \-@PRESERVOPT@ .
162 .TP
163 .B \-@MAILFILTOPT@
164 Turns procmail into a general purpose mail filter. In this mode one rcfile
165 must be specified on the command line. After the rcfile, procmail will
166 accept an unlimited number of arguments.@ETCRCS_desc@
167 For some advanced usage of this option you should look in the
168 .B EXAMPLES
169 section below.@[email protected] ARGUMENTS
170 Any arguments containing an '=' are considered to be environment variable
171 assignments, they will
172 .I all
173 be evaluated after the default values have been
174 assigned and before the first rcfile is opened.
175 .PP
176 Any other arguments are presumed to be rcfile paths (either absolute,
177 or if they start with `@chCURDIR@@MCDIRSEP@' relative to the current
178 directory;
179 .B any other relative
180 path is relative to $HOME, unless the
181 .B \-@MAILFILTOPT@
182 option has been given, in which case all relative paths are relative to the
183 current directory); procmail will start with the first one it finds on the
184 command line. The following ones will only be parsed if the preceding ones
185 have a not matching HOST-directive entry, or in case they should not exist.
186 .PP
187 If no rcfiles are specified, it looks for
188 .BR @PROCMAILRC@ .
189 If not even that can be found, processing will continue according to
190 the default settings of the environment variables and the ones specified
191 on the command line.
192 .SH EXAMPLES
193 Examples for rcfile recipes can be looked up in the
194 .BR procmailex (5)
195 man page.
196 A small sample rcfile can be found in the
197 .B NOTES
198 section below.
199 .PP
200 Skip the rest of this EXAMPLES section unless you are a system administrator
201 who is vaguely familiar with sendmail.cf syntax.
202 .PP
203 The
204 .B \-@MAILFILTOPT@
205 option is typically used when procmail is called from within a rule in the
206 sendmail.cf file. In order to be able to do this it is convenient to create
207 an extra `procmail' mailer in your sendmail.cf file (in addition to the perhaps
208 already present `local' mailer that starts up procmail). To create such a
209 `procmail' mailer I'd suggest something like:
210 .Sx 2
211 Mprocmail, P=@BINDIR@/procmail, F=mSDFMhun, S=11, R=21,
212 A=procmail \-@MAILFILTOPT@ $h $g $u
213 .Ex
214 This enables you to use rules like the following (most likely in ruleset 0)
215 to filter mail through the procmail mailer (please note the leading tab
216 to continue the rule, and the tab to separate the comments):
217 .Sx 4
218 R$*<@some.where>$*
219 $#procmail $@/etc/procmailrcs/some.rc $:[email protected]$2
220 R$*<@$*.procmail>$*
221 $1<@$2>$3 Already filtered, map back
222 .Ex
223 And /etc/procmailrcs/some.rc could be as simple as:
224 .Sx 9
225 SENDER = "<$1>" # fix for empty sender addresses
226 SHIFT = 1 # remove it from $@
227
228 :0 # sink all junk mail
229 * ^Subject:.*junk
230 /dev/null
231
232 :0 w # pass along all other mail
233 ! \-oi \-f "$SENDER" "$@"
234 .Ex
235 Do watch out when sending mail from within the /etc/procmailrcs/some.rc file,
236 if you send mail to addresses which match the first rule again, you could
237 be creating an endless mail loop.
238 .SH FILES
239 .TP 2.3i
240 .B /etc/passwd
241 to set the recipient's LOGNAME, HOME and SHELL variable defaults
242 .TP
243 .B @MAILSPOOLDIR@$LOGNAME
244 system mailbox; both the system mailbox and the immediate directory
245 it is in will be created every time procmail starts and either one is
246 not present@ETCRC_files@@ETCRCS_files@
247 .TP
248 .B @PROCMAILRC@
249 default rcfile
250 .TP
251 .B @MAILSPOOLDIR@$LOGNAME@DEFlockext@
252 lockfile for the system mailbox (not automatically used by procmail, unless
253 $DEFAULT equals @MAILSPOOLDIR@$LOGNAME and procmail is delivering to $DEFAULT)
254 .TP
255 .B @DEFsendmail@
256 default mail forwarder
257 .TP
258 .B @UNIQ_PREFIX@????`hostname`
259 temporary `unique' zero-length files created by procmail
260 .SH "SEE ALSO"
261 .na
262 .nh
263 .BR procmailrc (5),
264 .BR procmailsc (5),
265 .BR procmailex (5),
266 .BR sh (1),
267 .BR csh (1),
268 .BR mail (1),
269 .BR mailx (1),
270 .BR binmail (1),
271 .BR uucp (1),
272 .BR aliases (5),
273 .BR sendmail (8),
274 .BR egrep (1),
275 .BR grep (1),
276 .BR biff (1),
277 .BR comsat (8),
278 .BR lockfile (1),
279 .BR formail (1),
280 .BR cron (1)
281 .hy
282 .ad
283 .SH DIAGNOSTICS
284 .TP 2.3i
285 Autoforwarding mailbox found
286 The system mailbox had its suid or sgid bit set, procmail terminates with
287 EX_NOUSER assuming that this mailbox must not be delivered to.
288 .TP
289 Bad substitution of "x"
290 Not a valid environment variable name specified.
291 .TP
292 Closing brace unexpected
293 There was no corresponding opening brace (nesting block).
294 .TP
295 Conflicting options
296 Not all option combinations are useful
297 .TP
298 Conflicting x suppressed
299 Flag x is not compatible with some other flag on this recipe.
300 .TP
301 Couldn't create "x"
302 The system mailbox was missing and could not/will not be created.
303 .TP
304 Couldn't create maildir part "x"
305 The maildir folder "x" is missing one or more required subdirectories and
306 procmail could not create them.
307 .TP
308 Couldn't create or rename temp file "x"
309 An error occurred in the mechanics of delivering to the directory folder "x".
310 .TP
311 Couldn't determine implicit lockfile from "x"
312 There were no `>>' redirectors to be found, using simply `$LOCKEXT' as
313 locallockfile.
314 .TP
315 Couldn't read "x"
316 Procmail was unable to open an rcfile or it was not a regular file, or
317 procmail couldn't open an MH directory to find the highest numbered file.
318 .TP
319 Couldn't unlock "x"
320 Lockfile was already gone, or write permission to the directory where the
321 lockfile is has been denied.
322 .TP
323 Deadlock attempted on "x"
324 The locallockfile specified on this recipe is equal to a still active
325 $LOCKFILE.@ETCRCS_error@
326 .TP
327 Descriptor "x" was not open
328 As procmail was started, stdin, stdout or stderr was not connected (possibly
329 an attempt to subvert security)
330 .TP
331 Enforcing stricter permissions on "x"
332 The system mailbox of the recipient was found to be unsecured, procmail
333 secured it.
334 .TP
335 Error while writing to "x"
336 Nonexistent subdirectory, no write permission, pipe died or disk full.
337 .TP
338 Exceeded LINEBUF
339 Buffer overflow detected, LINEBUF was too small, PROCMAIL_OVERFLOW has
340 been set.
341 .TP
342 MAILDIR is not an absolute path
343 .TP
344 MAILDIR path too long
345 .TP
346 ORGMAIL is not an absolute path
347 .TP
348 ORGMAIL path too long
349 .TP
350 default rcfile is not an absolute path
351 .TP
352 default rcfile path too long
353 The specified item's full path, when expanded, was longer than LINEBUF
354 or didn't start with a file separator.
355 .TP
356 Excessive output quenched from "x"
357 The program or filter "x" tried to produce too much output for the current
358 LINEBUF, the rest was discarded and PROCMAIL_OVERFLOW has been set.
359 .TP
360 Extraneous x ignored
361 The action line or other flags on this recipe makes flag x meaningless.
362 .TP
363 Failed forking "x"
364 Process table is full (and NORESRETRY has been exhausted).
365 .TP
366 Failed to execute "x"
367 Program not in path, or not executable.
368 .TP
369 Forced unlock denied on "x"
370 No write permission in the directory where
371 .B lockfile
372 "x" resides, or more than one procmail trying to force a lock at exactly the
373 same time.
374 .TP
375 Forcing lock on "x"
376 .B Lockfile
377 "x" is going to be removed by force because of a timeout (see also:
378 .BR LOCKTIMEOUT ).
379 .TP
380 Incomplete recipe
381 The start of a recipe was found, but it stranded in an EOF.
382 .TP
383 Insufficient privileges
384 Procmail either needs root privileges, or must have the
385 right (e)uid
386 .B and
387 (e)gid to run in delivery mode. The mail will bounce.
388 .TP
389 Invalid regexp "x"
390 The regular expression "x" contains errors (most likely some missing or
391 extraneous parens).
392 .TP
393 Kernel-lock failed
394 While trying to use the kernel-supported locking calls, one of them failed
395 (usually indicates an OS error), procmail ignores this error and proceeds.
396 .TP
397 Kernel-unlock failed
398 See above.
399 .TP
400 Lock failure on "x"
401 Can only occur if you specify some real weird (and illegal) lockfilenames
402 or if the
403 .B lockfile
404 could not be created because of insufficient permissions or nonexistent
405 subdirectories.
406 .TP
407 Lost "x"
408 Procmail tried to clone itself but could not find back rcfile "x" (it either
409 got removed or it was a relative path and you changed directory since
410 procmail opened it last time).
411 .TP
412 Missing action
413 The current recipe was found to be incomplete.
414 .TP
415 Missing closing brace
416 A nesting block was started, but never finished.
417 .TP
418 Missing name
419 The \-@FROMWHOPT@ option needs an extra argument.
420 .TP
421 Missing argument
422 You specified the \-@ARGUMENTOPT@ option but forgot the argument.
423 .TP
424 Missing rcfile
425 You specified the \-@MAILFILTOPT@ option, procmail expects the name of an
426 rcfile as argument.
427 .TP
428 Missing recipient
429 You specified the \-@DELIVEROPT@ option or called procmail under a different
430 name, it expects one or more recipients as arguments.@WARN_RESTRICT_EXEC@
431 .TP
432 No space left to finish writing "x"
433 The filesystem containing "x" does not have enough free space to permit
434 delivery of the message to the file.
435 .TP
436 Out of memory
437 The system is out of swap space (and NORESRETRY has been exhausted).
438 .TP
439 Processing continued
440 The unrecognised options on the command line are ignored, proceeding as
441 usual.
442 .TP
443 Program failure (nnn) of "x"
444 Program that was started by procmail returned nnn instead of
445 EXIT_SUCCESS (=@EX_OK@);
446 if nnn is negative, then this is the signal the program died on.
447 .TP
448 Quota exceeded while writing "x"
449 The filesize quota for the recipient on the filesystem containing "x"
450 does not permit delivering the message to the file.
451 .TP
452 Renaming bogus "x" into "x"
453 The system mailbox of the recipient was found to be bogus, procmail performed
454 evasive actions.
455 .TP
456 Rescue of unfiltered data succeeded/failed
457 A filter returned unsuccessfully, procmail tried to get back the original text.
458 .TP
459 Skipped: "x"
460 Couldn't do anything with "x" in the rcfile (syntax error), ignoring it.
461 .TP
462 Suspicious rcfile "x"
463 The owner of the rcfile was not the recipient or root, the file was
464 world writable, or the directory that contained it was world writable,
465 or this was the default rcfile (@PROCMAILRC@) and either it was group
466 writable or the directory that contained it was group writable (the
467 rcfile was not used).
468 .TP
469 Terminating prematurely whilst waiting for .\|.\|.
470 Procmail received a signal while it was waiting for .\|.\|.
471 .TP
472 Timeout, terminating "x"
473 Timeout has occurred on program or filter "x".
474 .TP
475 Timeout, was waiting for "x"
476 Timeout has occurred on program, filter or file "x". If it was a program or
477 filter, then it didn't seem to be running anymore.
478 .TP
479 Truncated file to former size
480 The file could not be delivered to successfully, so the file was truncated
481 to its former size.
482 .TP
483 Truncating "x" and retrying lock
484 "x" does not seem to be a valid filename or the file is not empty.
485 .TP
486 Unable to treat as directory "x"
487 Either the suffix on "x" would indicate that it should be an MH or
488 maildir folder, or it was listed as an second folder into which to link,
489 but it already exists and is not a directory.
490 .TP
491 Unexpected EOL
492 Missing closing quote, or trying to escape EOF.
493 .TP
494 Unknown user "x"
495 The specified recipient does not have a corresponding uid.
496 .SH "EXTENDED DIAGNOSTICS"
497 Extended diagnostics can be turned on and off through setting the
498 VERBOSE variable.
499 .TP 2.3i
500 [pid] time & date
501 Procmail's pid and a timestamp. Generated whenever procmail logs a
502 diagnostic and at least a second has elapsed since the last timestamp.
503 .TP
504 Acquiring kernel-lock
505 Procmail now tries to kernel-lock the most recently opened file (descriptor).
506 .TP
507 Assigning "x"
508 Environment variable assignment.
509 .TP
510 Assuming identity of the recipient, VERBOSE=off
511 Dropping all privileges (if any), implicitly turns off extended diagnostics.
512 .TP
513 Bypassed locking "x"
514 The mail spool directory was not accessible to procmail, it relied solely
515 on kernel locks.
516 .TP
517 Executing "x"
518 Starting program "x". If it is started by procmail directly (without an
519 intermediate shell), procmail will show where it separated the arguments
520 by inserting commas.
521 .TP
522 HOST mismatched "x"
523 This host was called "x", HOST contained something else.
524 .TP
525 Locking "x"
526 Creating lockfile "x".
527 .TP
528 Linking to "x"
529 Creating a hardlink between directory folders.
530 .TP
531 Match on "x"
532 Condition matched.
533 .TP
534 Matched "x"
535 Assigned "x" to
536 .BR @MATCHVAR@ .
537 .TP
538 No match on "x"
539 Condition didn't match, recipe skipped.
540 .TP
541 Non-zero exitcode (nnn) by "x"
542 Program that was started by procmail as a condition or as the action of
543 a recipe with the `@WAIT_EXIT_QUIET@' flag returned nnn instead of
544 EXIT_SUCCESS (=@EX_OK@); the usage indicates that this is not an
545 entirely unexpected condition.
546 .TP
547 Notified comsat: "$LOGNAME@offset:file"
548 Sent comsat/biff a notice that mail arrived for user $LOGNAME at `offset'
549 in `file'.
550 .TP
551 Opening "x"
552 Opening file "x" for appending.
553 .TP
554 Rcfile: "x"
555 Rcfile changed to "x".
556 .TP
557 Reiterating kernel-lock
558 While attempting several locking methods, one of these failed. Procmail will
559 reiterate until they all succeed in rapid succession.
560 .TP
561 Score: added newtotal "x"
562 This condition scored `added' points, which resulted in a `newtotal' score.
563 .TP
564 Unlocking "x"
565 Removing lockfile "x" again.
566 .SH WARNINGS
567 You should create a shell script that uses
568 .BR lockfile (1)
569 before invoking your mail shell on any mailbox file other than the system
570 mailbox (unless of course, your mail shell uses the same lockfiles (local
571 or global) you specified in your rcfile).
572 .PP
573 In the unlikely event that you absolutely need to kill procmail before it has
574 finished, first try and use the regular kill command (i.e.,
575 .I not
576 kill \-9, see the subsection
577 .I Signals
578 for suggestions), otherwise some
579 .I lockfiles
580 might not get removed.
581 .PP
582 Beware when using the
583 .B \-@TEMPFAILOPT@
584 option, if procmail repeatedly is unable to deliver the mail (e.g., due to
585 an incorrect rcfile), the system mailqueue could fill up. This could
586 aggravate both the local postmaster and other users.@ETCRC_warn@@ETCRCS_warn@
587 .PP
588 Procmail is not the proper tool for sharing one mailbox among many
589 users, such as when you have one POP account for all mail to your
590 domain. It can be done if you manage to configure your MTA to add some
591 headers with the envelope recipient data in order to tell Procmail who
592 a message is for, but this is usually not the right thing to do.
593 Perhaps you want to investigate if your MTA offers `virtual user
594 tables', or check out the `multidrop' facility of Fetchmail.
595 .SH BUGS
596 After removing a lockfile by force, procmail waits $SUSPEND seconds before
597 creating a new lockfile so that another process that decides to remove the
598 stale lockfile will not remove the newly created lock by mistake.
599 .PP
600 Procmail uses the regular TERMINATE signal to terminate any runaway filter,
601 but it does not check if the filter responds to that signal and it only sends
602 it to the filter itself, not to any of the filter's children.
603 .PP
604 A continued
605 .B Content-Length:
606 field is not handled correctly.
607 .PP
608 The embedded newlines in a continued header should be skipped when
609 matching instead of being treated as a single space as they are now.
610 .SH MISCELLANEOUS
611 If there is an existing
612 .B Content-Length:
613 field in the header of the mail and the
614 .B \-@BERKELEYOPT@
615 option is not specified, procmail will trim the field to report the correct
616 size. Procmail does not change the fieldwidth.
617 .PP
618 If there is no
619 .B Content-Length:
620 field or the
621 .B \-@BERKELEYOPT@
622 option has been specified and procmail appends to regular mailfolders, any
623 lines in the body of the message that look like postmarks are prepended with
624 `@ESCAP@' (disarms bogus mailheaders). The regular expression that is used
625 to search for these postmarks is:
626 .RS
627 `@FROM_EXPR@'
628 .RE
629 .PP
630 If the destination name used in explicit delivery mode is not in /etc/passwd,
631 procmail will proceed as if explicit delivery mode was not in effect.
632 If not in explicit delivery mode and
633 should the uid procmail is running under, have no corresponding /etc/passwd
634 entry, then HOME will default to @ROOT_DIR@, LOGNAME will default to #uid,
635 SHELL will default to @BinSh@, and ORGMAIL will default to
636 @DEAD_LETTER@.
637 .PP
638 When in explicit delivery mode, procmail will generate a leading `@FROM@'
639 line if none is present. If one is already present procmail will leave it
640 intact.@TRUSTED_IDS@
641 .PP
642 For security reasons procmail will only use an absolute or
643 $HOME-relative rcfile if it is owned by the recipient or root, not
644 world writable, and the directory it is contained in is not world
645 writable. The @PROCMAILRC@ file has the additional constraint of not
646 being group-writable or in a group-writable directory.@RESTRICT_EXEC@
647 .PP
648 If @MAILSPOOLDIR@$LOGNAME is a bogus mailbox (i.e., does not belong to the
649 recipient, is unwritable, is a symbolic link or is a hard link), procmail will
650 upon startup try to rename it into a file starting
651 with `@BOGUSprefix@$LOGNAME.' and
652 ending in an inode-sequence-code. If this turns out to be impossible,
653 .B ORGMAIL
654 will have
655 .I no
656 initial value, and hence will inhibit delivery without a proper rcfile.
657 .PP
658 If @MAILSPOOLDIR@$LOGNAME already is a valid mailbox, but has got too loose
659 permissions on it, procmail will correct this. To prevent procmail from doing
660 this make sure the u+x bit is set.
661 .PP
662 When delivering to directories, MH folders, or maildir folders, you
663 .B don't
664 need to use lockfiles to prevent several concurrently running procmail
665 programs from messing up.
666 .PP
667 Delivering to MH folders is slightly more time consuming than delivering
668 to normal directories or mailboxes, because procmail has to search for
669 the next available number (instead of having the filename immediately
670 available).
671 .PP
672 On general failure procmail will return EX_CANTCREAT, unless option
673 .B \-@TEMPFAILOPT@
674 is specified, in which case it will return EX_TEMPFAIL.
675 .PP
676 To make `egrepping' of headers more consistent, procmail concatenates all
677 continued header fields; but only internally. When delivering the mail, line
678 breaks will appear as before.
679 .PP
680 If procmail is called under a name not starting with `procmail' (e.g., if it
681 is linked to another name and invoked as such), it comes up in explicit
682 delivery mode, and expects the recipients' names as command line arguments
683 (as if \-@DELIVEROPT@ had been specified).
684 .PP
685 Comsat/biff notifications are done using @COMSATprotocol@. They are sent off
686 once when procmail generates the regular logfile entry. The notification
687 messages have the following extended format (or as close as you can get when
688 final delivery was not to a file):
689 .RS
690 $LOGNAME@offset_of_message_in_mailbox@COMSATxtrsep@absolute_path_to_mailbox
691 .RE
692 .PP
693 Whenever procmail itself opens a file to deliver to, it
694 @KERNEL_LOCKING@.
695 .PP
696 Procmail is NFS-resistant and eight-bit clean.
697 .br
698 .ne 11
699 .SH NOTES
700 Calling up procmail with the \-@HELPOPT1@ or \-@HELPOPT2@ options will cause
701 it to display a command-line help and recipe flag quick-reference page.
702 .PP
703 There exists an excellent newbie FAQ about mailfilters (and procmail
704 in particular); it is maintained by Nancy McGough <[email protected]>
705 and can be obtained by sending a mail to [email protected] with
706 the following in the body:
707 .RS
708 send usenet/news.answers/mail/filtering-faq
709 .RE
710 .PP
711 @CF_procmail@
712 In this case your $HOME/@DOT_FORWARD@ (beware, it
713 .B has
714 to be world readable) file should contain the line below. Be sure to include
715 the single and double quotes, and unless you know your site to be running
716 smrsh (the SendMail Restricted SHell), it must be an
717 .I absolute
718 path.@FW_comment@
719 .PP
720 .na
721 .nf
722 @FW_content@
723 .fi
724 .ad
725 .PP
726 Procmail can also be invoked to postprocess an already filled system
727 mailbox. This can be useful if you don't want to or can't use a
728 $HOME/@DOT_FORWARD@ file (in which case the following script could
729 periodically be called from within
730 .BR cron (1),
731 or whenever you start reading mail):
732 .Sx 17
733 #!/bin/sh
734
735 ORGMAIL=@MAILSPOOLDIR@$LOGNAME
736
737 if cd $HOME &&
738 test \-s $ORGMAIL &&
739 lockfile \-r0 \-l@DEFlocktimeout@ .newmail.lock 2>/dev/null
740 then
741 trap "rm \-f .newmail.lock" 1 2 3 13 15
742 umask 077
743 lockfile \-l@DEFlocktimeout@ \-ml
744 cat $ORGMAIL >>.newmail &&
745 cat /dev/null >$ORGMAIL
746 lockfile \-mu
747 formail \-@FM_SPLIT@ procmail <.newmail &&
748 rm \-f .newmail
749 rm \-f .newmail.lock
750 fi
751 exit 0
752 .Ex
753 .ne 14
754 .SS "A sample small @PROCMAILRC@:"
755 .na
756 .nf
757 PATH=/bin:/usr/bin:@BINDIR@
758 MAILDIR=$HOME/Mail #you'd better make sure it exists
759 DEFAULT=$MAILDIR/mbox #completely optional
760 LOGFILE=$MAILDIR/from #recommended
761
762 :0:
763 * ^From.*berg
764 from_me
765
766 :0
767 * ^Subject:.*Flame
768 /dev/null
769 .fi
770 .ad
771 .PP
772 Other examples for rcfile recipes can be looked up in the
773 .BR procmailex (5)
774 man page.