Penguin
Blame: procmailrc(5)
EditPageHistoryDiffInfoLikePages
Annotated edit history of procmailrc(5) version 5 showing authors affecting page license. View with all changes included.
Rev Author # Line
1 perry 1 PROCMAILRC
2 !!!PROCMAILRC
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 EXAMPLES
7 CAVEATS
8 SEE ALSO
9 BUGS
10 MISCELLANEOUS
11 NOTES
12 AUTHORS
13 ----
14 !!NAME
15
16
17 procmailrc - procmail rcfile
18 !!SYNOPSIS
19
20
21 __$HOME/.procmailrc__
22 !!DESCRIPTION
23
24
25 For a quick start, see __NOTES__ at the end of the
26 procmail(1) man page.
27
28
29 The rcfile can contain a mixture of environment variable
30 assignments (some of which have special meanings to
31 procmail), and recipes. In their most simple appearance, the
32 recipes are simply one line regular expressions that are
33 searched for in the header of the arriving mail. The first
34 recipe that matches is used to determine where the mail has
35 to go (usually a file). If processing falls off the end of
36 the rcfile, procmail will deliver the mail to
37 __$DEFAULT__.
38
39
40 There are two kinds of recipes: delivering and
41 non-delivering recipes. If a ''delivering recipe'' is
42 found to match, procmail considers the mail (you guessed it)
43 delivered and will ''cease processing'' the rcfile after
44 having successfully executed the action line of the recipe.
45 If a ''non-delivering recipe'' is found to match,
46 processing of the rcfile will ''continue'' after the
47 action line of this recipe has been executed.
48
49
50 Delivering recipes are those that cause header and/or body
51 of the mail to be: written into a file, absorbed by a
52 program or forwarded to a mailaddress.
53
54
55 Non-delivering recipes are: those that cause the output of a
56 program or filter to be captured back by procmail or those
57 that start a nesting block.
58
59
60 You can tell procmail to treat a ''delivering recipe'' as
61 if it were a non-delivering recipe by specifying the `c'
62 flag on such a recipe. This will make procmail generate a
63 ''carbon copy'' of the mail by delivering it to this
64 recipe, yet continue processing the rcfile.
65
66
67 By using any number of recipes you can presort your mail
68 extremely straightforward into several mailfolders. Bear in
69 mind though that the mail can arrive concurrently in these
70 mailfolders (if several procmail programs happen to run at
71 the same time, not unlikely if a lot of mail arrives). To
72 make sure this does not result in a mess, proper use of
73 lockfiles is highly recommended.
74
75
76 The environment variable __assignments__ and
77 __recipes__ can be freely intermixed in the rcfile. If
78 any environment variable has a special meaning to procmail,
79 it will be used appropriately the moment it is parsed (i.e.,
80 you can change the current directory whenever you want by
81 specifying a new __MAILDIR__, switch lockfiles by
82 specifying a new __LOCKFILE__, change the umask at any
83 time, etc., the possibilities are endless :-).
84
85
86 The assignments and substitutions of these environment
87 variables are handled exactly like in sh(1) (that
88 includes all possible quotes and escapes), with the added
89 bonus that blanks around the '=' sign are ignored and that,
90 if an environment variable appears without a trailing '=',
91 it will be removed from the environment. Any program in
92 backquotes started by procmail will have the entire mail at
93 its stdin.
94
95
96 __Comments__
97
98
99 A word beginning with # and all the following characters up
100 to a NEWLINE are ignored. This does not apply to condition
101 lines, which cannot be commented.
102
103
104 __Recipes__
105
106
107 A line starting with ':' marks the beginning of a recipe. It
108 has the following format:
109
110
111 :0 [[''flags''] [[ : [[''locallockfile''] ]
112 ''Conditions start with a leading `*', everything after that character is passed on to the internal egrep __literally__, except for leading and trailing whitespace. These regular expressions are __completely__ compatible to the normal egrep(1) extended regular expressions. See also __Extended regular expressions__.
113
114
115 Conditions are anded; if there are no conditions the result
116 will be true by default.
117
118
119 ''Flags'' can be any of the following:
120
121
122 __H__
123
124
125 Egrep the header (default).
126
127
128 __B__
129
130
131 Egrep the body.
132
133
134 __D__
135
136
137 Tell the internal egrep to distinguish between upper and
138 lower case (contrary to the default which is to ignore
139 case).
140
141
142 __A__
143
144
145 This recipe will not be executed unless the conditions on
146 the last preceding recipe (on the current block-nesting
147 level) without the `A' or `a' flag matched as well. This
148 allows you to chain actions that depend on a common
149 condition.
150
151
152 __a__
153
154
155 Has the same meaning as the `A' flag, with the additional
156 condition that the immediately preceding recipe must have
157 been ''successfully'' completed before this recipe is
158 executed.
159
160
161 __E__
162
163
164 This recipe only executes if the immediately preceding
165 recipe was not executed. Execution of this recipe also
166 disables any immediately following recipes with the 'E'
167 flag. This allows you to specify `else if'
168 actions.
169
170
171 __e__
172
173
174 This recipe only executes if the immediately preceding
175 recipe ''failed'' (i.e., the action line was attempted,
176 but resulted in an error).
177
178
179 __h__
180
181
182 Feed the header to the pipe, file or mail destination
183 (default).
184
185
186 __b__
187
188
189 Feed the body to the pipe, file or mail destination
190 (default).
191
192
193 __f__
194
195
196 Consider the pipe as a filter.
197
198
199 __c__
200
201
202 Generate a __carbon copy__ of this mail. This only makes
203 sense on ''delivering'' recipes. The only non-delivering
204 recipe this flag has an effect on is on a nesting block, in
205 order to generate a carbon copy this will __clone__ the
206 running procmail process (lockfiles will not be inherited),
207 whereby the clone will proceed as usual and the parent will
208 jump across the block.
209
210
211 __w__
212
213
214 Wait for the filter or program to finish and check its
215 exitcode (normally ignored); if the filter is unsuccessful,
216 then the text will not have been filtered.
217
218
219 __W__
220
221
222 Has the same meaning as the `w' flag, but will suppress any
223 `Program failure' message.
224
225
226 __i__
227
228
229 Ignore any write errors on this recipe (i.e., usually due to
230 an early closed pipe).
231
232
233 __r__
234
235
236 Raw mode, do not try to ensure the mail ends with an empty
237 line, write it out as is.
238
239
240 There are some special conditions you can use that are not
241 straight regular expressions. To select them, the condition
242 must start with:
243
244
245 __!__
246
247
248 Invert the condition.
249
250
251 __$__
252
253
254 Evaluate the remainder of this condition according to
255 sh(1) substitution rules inside double quotes, skip
256 leading whitespace, then reparse it.
257
258
259 __?__
260
261
262 Use the exitcode of the specified program.
263
264
265 ____
266
267
268 Check if the total length of the mail is shorter than the
269 specified (in decimal) number of bytes.
270
271
272 ____
273
274
275 Analogous to '
276
277
278 __variablename__ ''??''
279
280
281 Match the remainder of this condition against the value of
282 this environment variable (which cannot be a pseudo
283 variable). A special case is if variablename is equal to
284 `B', `H', `HB' or `BH'; this merely overrides the default
285 header/body search area defined by the initial flags on this
286 recipe.
287
288
289 __\__
290
291
292 To quote any of the above at the start of the
293 line.
294
295
296 __Local lockfile__
297
298
299 If you put a second (trailing) ':' on the first recipe line,
300 then procmail will use a ''locallockfile'' (for this
301 recipe only). You can optionally specify the locallockfile
302 to use; if you don't however, procmail will use the
303 destination filename (or the filename following the first
304 '''
305
306
307 __Recipe action line__
308
309
310 The action line can start with the following
311 characters:
312
313
314 __!__
315
316
317 Forwards to all the specified mail addresses.
318
319
320 __|__
321
322
323 Starts the specified program, possibly in $SHELL if any of
324 the characters $SHELLMETAS are spotted. You can optionally
325 prepend this pipe symbol with ''variable='', which will
326 cause stdout of the program to be captured in the
327 environment ''variable'' (procmail will __not__
328 terminate processing the rcfile at this point). If you
329 specify just this pipe symbol, without any program, then
330 procmail will pipe the mail to stdout.
331
332
333 __{__
334
335
336 Followed by at least one space, tab or newline will mark the
337 start of a nesting block. Everything up till the next
338 closing brace will depend on the conditions specified for
339 this recipe. Unlimited nesting is permitted. The closing
340 brace exists merely to delimit the block, it will ''not''
341 cause procmail to terminate in any way. If the end of a
342 block is reached processing will continue as usual after the
343 block. On a nesting block, the flags `H' and `B' only affect
344 the conditions leading up to the block, the flags `h' and
345 `b' have no effect whatsoever.
346
347
348 Anything else will be taken as a mailbox name (either a
349 filename or a directory, absolute or relative to the current
350 directory (see MAILDIR)). If it is a (possibly yet
351 nonexistent) filename, the mail will be appended to
352 it.
353
354
355 If it is a directory, the mail will be delivered to a newly
356 created, guaranteed to be unique file named $MSGPREFIX* in
357 the specified directory. If the mailbox name ends in
358
359
360 __Environment variable defaults__
361
362
363 __LOGNAME, HOME and SHELL__
364
365
366 Your (the recipient's) defaults
367
368
369 __PATH__ $HOME/bin :/usr/local/bin:/usr/bin:/bin (Except
370 during the processing of an /etc/procmailrc file, when it
371 will be set to `/usr/local/bin:/usr/bin
372 :/bin'.)
373
374
375 __SHELLMETAS__ __
376
377
378 __SHELLFLAGS__ -c
379
380
381 __ORGMAIL__ /var/mail/$LOGNAME
382
383
384 (Unless __-m__ has been specified, in which case it is
385 unset)
386
387
388 __MAILDIR__ $HOME
389
390
391 (Unless the name of the first successfully opened rcfile
392 starts with `./' or if __-m__ has been specified, in
393 which case it defaults to `.')
394
395
396 __DEFAULT__ $ORGMAIL
397
398
399 __MSGPREFIX__ msg.
400
401
402 __SENDMAIL__ /usr/sbin/sendmail
403
404
405 __SENDMAILFLAGS__ -oi
406
407
408 __HOST__ The current hostname
409
410
411 __COMSAT__ no
412
413
414 (If an rcfile is specified on the command line)
415
416
417 __PROCMAIL_VERSION__
418
419
420 3.22
421
422
423 __LOCKEXT__ .lock
424
425
426 Other cleared or preset environment variables are IFS, ENV
427 and PWD.
428
429
430 For security reasons, upon startup procmail will wipe out
431 all environment variables that are suspected of modifying
432 the behavior of the runtime linker.
433
434
435 __Environment__
436
437
438 Before you get lost in the multitude of environment
439 variables, keep in mind that all of them have reasonable
440 defaults.
441
442
443 __MAILDIR__
444
445
446 Current directory while procmail is executing (that means
447 that all paths are relative to $MAILDIR).
448
449
450 __DEFAULT__
451
452
453 Default __mailbox__ file (if not told otherwise, procmail
454 will dump mail in this mailbox). Procmail will automatically
455 use $DEFAULT$LOCKEXT as lockfile prior to writing to this
456 mailbox. You do not need to set this variable, since it
457 already points to the standard system mailbox.
458
459
460 __LOGFILE__
461
462
463 This file will also contain any error or diagnostic messages
464 from procmail (normally none :-) or any other programs
465 started by procmail. If this file is not specified, any
466 diagnostics or error messages will be mailed back to the
467 sender. See also __LOGABSTRACT__.
468
469
470 __VERBOSE__
471
472
473 You can turn on ''extended diagnostics'' by setting this
474 variable to `yes' or `on', to turn it off again set it to
475 `no' or `off'.
476
477
478 __LOGABSTRACT__
479
480
481 Just before procmail exits it logs an abstract of the
482 delivered message in $LOGFILE showing the `From ' and
483 `Subject:' fields of the header, what folder it finally went
484 to and how long (in bytes) the message was. By setting this
485 variable to `no', generation of this abstract is suppressed.
486 If you set it to `all', procmail will log an abstract for
487 every successful ''delivering recipe'' it
488 processes.
489
490
491 __LOG__ Anything assigned to this variable will be
492 appended to $LOGFILE.
493
494
495 __ORGMAIL__
496
497
498 Usually the system mailbox (__OR__i__G__inal
499 __MAIL__box). If, for some obscure reason (like
500 `__filesystem full__') the mail could not be delivered,
501 then this mailbox will be the last resort. If procmail fails
502 to save the mail in here (deep, deep trouble :-), then the
503 mail will bounce back to the sender.
504
505
506 __LOCKFILE__
507
508
509 Global semaphore file. If this file already exists, procmail
510 will wait until it has gone before proceeding, and will
511 create it itself (cleaning it up when ready, of course). If
512 more than one ''lockfile'' are specified, then the
513 previous one will be removed before trying to create the new
514 one. The use of a global lockfile is discouraged, whenever
515 possible use locallockfiles (on a per recipe basis)
516 instead.
517
518
519 __LOCKEXT__
520
521
522 Default extension that is appended to a destination file to
523 determine what local ''lockfile'' to use (only if turned
524 on, on a per-recipe basis).
525
526
527 __LOCKSLEEP__
528
529
530 Number of seconds procmail will sleep before retrying on a
531 ''lockfile'' (if it already existed); if not specified,
532 it defaults to 8 seconds.
533
534
535 __LOCKTIMEOUT__
536
537
538 Number of seconds that have to have passed since a
539 ''lockfile'' was last modified/created before procmail
540 decides that this must be an erroneously leftover lockfile
541 that can be removed by force now. If zero, then no timeout
542 will be used and procmail will wait forever until the
543 lockfile is removed; if not specified, it defaults to 1024
544 seconds. This variable is useful to prevent indefinite
545 hangups of __sendmail__/procmail. Procmail is immune to
546 clock skew across machines.
547
548
549 __TIMEOUT__
550
551
552 Number of seconds that have to have passed before procmail
553 decides that some child it started must be hanging. The
554 offending program will receive a TERMINATE signal from
555 procmail, and processing of the rcfile will continue. If
556 zero, then no timeout will be used and procmail will wait
557 forever until the child has terminated; if not specified, it
558 defaults to 960 seconds.
559
560
561 __MSGPREFIX__
562
563
564 Filename prefix that is used when delivering to a directory
565 (not used when delivering to a maildir or an MH
566 directory).
567
568
569 __HOST__ If this is not the ''hostname'' of the
570 machine, processing of the current ''rcfile'' will
571 immediately cease. If other rcfiles were specified on the
572 command line, processing will continue with the next one. If
573 all rcfiles are exhausted, the program will terminate, but
574 will not generate an error (i.e., to the mailer it will seem
575 that the mail has been delivered).
576
577
578 __UMASK__
579
580
581 The name says it all (if it doesn't, then forget about this
582 one :-). Anything assigned to UMASK is taken as an
583 __octal__ number. If not specified, the umask defaults to
584 077. If the umask permits o+x, all the mailboxes procmail
585 delivers to directly will receive an o+x mode change. This
586 can be used to check if new mail arrived.
587
588
589 __SHELLMETAS__
590
591
592 If any of the characters in SHELLMETAS appears in the line
593 specifying a filter or program, the line will be fed to
594 $SHELL instead of being executed directly.
595
596
597 __SHELLFLAGS__
598
599
600 Any invocation of $SHELL will be like:
601
602
603 __SENDMAIL__
604
605
606 If you're not using the ''forwarding'' facility don't
607 worry about this one. It specifies the program being called
608 to forward any mail.
609 It gets invoked as:
610
611
612 __NORESRETRY__
613
614
615 Number of retries that are to be made if any `__process
616 table full__', `__file table full__', `__out of
617 memory__' or `__out of swap space__' error should
618 occur. If this number is negative, then procmail will retry
619 indefinitely; if not specified, it defaults to 4 times. The
620 retries occur with a $SUSPEND second interval. The idea
621 behind this is that if, e.g., the ''swap space'' has been
622 exhausted or the ''process table'' is full, usually
623 several other programs will either detect this as well and
624 abort or crash 8-), thereby freeing valuable
625 ''resources'' for procmail.
626
627
628 __SUSPEND__
629
630
631 Number of seconds that procmail will pause if it has to wait
632 for something that is currently unavailable (memory, fork,
633 etc.); if not specified, it will default to 16 seconds. See
634 also: __LOCKSLEEP__.
635
636
637 __LINEBUF__
638
639
640 Length of the internal line buffers, cannot be set smaller
641 than 128. All lines read from the ''rcfile'' should not
642 exceed $LINEBUF characters before and after expansion. If
643 not specified, it defaults to 2048. This limit, of course,
644 does ''not'' apply to the mail itself, which can have
645 arbitrary line lengths, or could be a binary file for that
646 matter. See also PROCMAIL_OVERFLOW.
647
648
649 __DELIVERED__
650
651
652 If set to `yes' procmail will pretend (to the mail agent)
653 the mail has been delivered. If mail cannot be delivered
654 after having met this assignment (set to `yes'), the mail
655 will be lost (i.e., it will not bounce).
656
657
658 __TRAP__ When procmail terminates of its own accord and
659 not because it received a signal, it will execute the
660 contents of this variable. A copy of the mail can be read
661 from stdin. Any output produced by this command will be
662 appended to $LOGFILE. Possible uses for TRAP are: removal of
663 temporary files, logging customised abstracts, etc. See also
664 __EXITCODE__ and __LOGABSTRACT__.
665
666
667 __EXITCODE__
668
669
670 By default, procmail returns an exitcode of zero (success)
671 if it successfully delivered the message or if the
672 __HOST__ variable was misset and there were no more
673 rcfiles on the command line; otherwise it returns failure.
674 Before doing so, procmail examines the value of this
675 variable. If it is set to a positive numeric value, procmail
676 will instead use that value as its exitcode. If this
677 variable is set but empty and __TRAP__ is set, procmail
678 will set the exitcode to whatever the __TRAP__ program
679 returns. If this variable is not set, procmail will set it
680 shortly before calling up the __TRAP__
681 program.
682
683
684 __LASTFOLDER__
685
686
687 This variable is assigned to by procmail whenever it is
688 delivering to a folder or program. It always contains the
689 name of the last file (or program) procmail delivered to. If
690 the last delivery was to several directory folders together
691 then $LASTFOLDER will contain the hardlinked filenames as a
692 space separated list.
693
694
695 __MATCH__
696
697
698 This variable is assigned to by procmail whenever it is told
699 to extract text from a matching regular expression. It will
700 contain all text matching the regular expression past the
701 `__/__' token.
702
703
704 __SHIFT__
705
706
707 Assigning a positive value to this variable has the same
708 effect as the `shift' command in sh(1). This command
709 is most useful to extract extra arguments passed to procmail
710 when acting as a generic mailfilter.
711
712
713 __INCLUDERC__
714
715
716 Names an rcfile (relative to the current directory) which
717 will be included here as if it were part of the current
718 rcfile. Nesting is permitted and only limited by systems
719 resources (memory and file descriptors). As no checking is
720 done on the permissions or ownership of the rcfile, users of
721 __INCLUDERC__ should make sure that only trusted users
722 have write access to the included rcfile or the directory it
723 is in. Command line assignments to __INCLUDERC__ have no
724 effect.
725
726
727 __SWITCHRC__
728
729
730 Names an rcfile (relative to the current directory) to which
731 processing will be switched. If the named rcfile doesn't
732 exist or is not a normal file or /dev/null then an error
733 will be logged and processing will continue in the current
734 rcfile. Otherwise, processing of the current rcfile will be
735 aborted and the named rcfile started. Unsetting
736 __SWITCHRC__ aborts processing of the current rcfile as
737 if it had ended at the assignment. As with __INCLUDERC__,
738 no checking is done on the permissions or ownership of the
739 rcfile and command line assignments have no
740 effect.
741
742
743 __PROCMAIL_VERSION__
744
745
746 The version number of the running procmail
747 binary.
748
749
750 __PROCMAIL_OVERFLOW__
751
752
753 This variable will be set to a non-empty value if procmail
754 detects a buffer overflow. See the __BUGS__ section below
755 for other details of operation when overflow
756 occurs.
757
758
759 __COMSAT__
760
761
762 comsat(8)/biff(1) notification is on by
763 default, it can be turned off by setting this variable to
764 `no'. Alternatively the biff-service can be customised by
765 setting it to either `service@', `@hostname', or
766 `service@hostname'. When not specified it defaults to
767 biff@localhost.
768
769
770 __DROPPRIVS__
771
772
773 If set to `yes' procmail will drop all privileges it might
774 have had (suid or sgid). This is only useful if you want to
775 guarantee that the bottom half of the /etc/procmailrc file
776 is executed on behalf of the recipient.
777
778
779 __Extended regular expressions__
780
781
782 The following tokens are known to both the procmail internal
783 egrep and the standard egrep(1) (beware that some
784 egrep implementations include other non-standard
785 extensions):
786
787
788 __^__ Start of a line.
789
790
791 __$__ End of a line.
792
793
794 __.__ Any character except a newline.
795
796
797 __a*__ Any sequence of zero or more a's.
798
799
800 __a+__ Any sequence of one or more a's.
801
802
803 __a?__ Either zero or one a.
804
805
806 __[[^-a-d]__
807
808
809 Any character which is __not__ either a dash, a, b, c, d
810 or newline.
811
812
813 __de|abc__
814
815
816 Either the sequence `de' or `abc'.
817
818
819 __(abc)*__
820
821
822 Zero or more times the sequence `abc'.
823
824
825 __.__ Matches a single dot; use \ to quote any of the
826 magic characters to get rid of their special meaning. See
827 also $\ variable substitution.
828
829
830 These were only samples, of course, any more complex
831 combination is valid as well.
832
833
834 The following token meanings are special procmail
835 extensions:
836
837
838 __^__ or __$__
839
840
841 Match a newline (for multiline matches).
842
843
844 __^^__ Anchor the expression at the very start of the
845 search area, or if encountered at the end of the expression,
846 anchor it at the very end of the search area.
847
848
849 ____ or ____
850
851
852 Match the character before or after a word. They are merely
853 a shorthand for `[[^a-zA-Z0-9_]', but can also match
854 newlines. Since they match actual characters, they are only
855 suitable to delimit words, not to delimit inter-word
856 space.
857
858
859 __/__ Splits the expression in two parts. Everything
860 matching the right part will be assigned to the MATCH
861 environment variable.
862 !!EXAMPLES
863
864
865 Look in the procmailex(5) man page.
866 !!CAVEATS
867
868
869 Continued lines in an action line that specifies a program
870 always have to end in a backslash, even if the underlying
871 shell would not need or want the backslash to indicate
872 continuation. This is due to the two pass parsing process
873 needed (first procmail, then the shell (or not, depending on
874 __SHELLMETAS__)).
875
876
877 Don't put comments on the regular expression condition lines
878 in a recipe, these lines are fed to the internal egrep
879 ''literally'' (except for continuation backslashes at the
880 end of a line).
881
882
883 Leading whitespace on continued regular expression condition
884 lines is usually ignored (so that they can be indented), but
885 __not__ on continued condition lines that are evaluated
886 according to the sh(1) substitution rules inside
887 double quotes.
888
889
890 Watch out for deadlocks when doing unhealthy things like
891 forwarding mail to your own account. Deadlocks can be broken
892 by proper use of __LOCKTIMEOUT__.
893
894
895 Any default values that procmail has for some environment
896 variables will __always__ override the ones that were
897 already defined. If you really want to override the
898 defaults, you either have to put them in the __rcfile__
899 or on the command line as arguments.
900
901
902 The /etc/procmailrc file cannot change the PATH setting seen
903 by user rcfiles as the value is reset when procmail finishes
904 the /etc/procmailrc file. While future enhancements are
905 expected in this area, recompiling procmail with the desired
906 value is currently the only correct solution.
907
908
909 Environment variables set __inside__ the
910 shell-interpreted-`|' action part of a recipe will
911 __not__ retain their value after the recipe has finished
912 since they are set in a subshell of procmail. To make sure
913 the value of an environment variable is retained you have to
914 put the assignment to the variable before the leading `|' of
915 a recipe, so that it can capture stdout of the
916 program.
917
918
919 If you specify only a `h' or a `b' flag on a delivering
920 recipe, and the recipe matches, then, unless the `c' flag is
921 present as well, the body respectively the header of the
922 mail will be silently lost.
923 !!SEE ALSO
924
925
926 procmail(1), procmailsc(5),
927 procmailex(5), sh(1), csh(1),
928 mail(1), mailx(1), binmail(1),
929 uucp(1), aliases(5), sendmail(8),
930 egrep(1), regexp(5), grep(1),
931 biff(1), comsat(8), lockfile(1),
932 formail(1)
933 !!BUGS
934
935
936 The only substitutions of environment variables that can be
937 handled by procmail itself are of the type $name, ${name},
938 ${name:-text}, ${name:+text}, ${name-text}, ${name+text},
939 $name, $#, $n, $$, $?, $_, $- and $=; whereby $name will be
940 substituted by the all-magic-regu-
941 lar-expression-characters-disarmed equivalent of $name, $_
942 by the name of the current rcfile, $- by $LASTFOLDER and $=
943 will contain the score of the last recipe. Further- more,
944 the result of $name substitution will never be split on
945 whitespace. When the __-a__ or __-m__ options are
946 used, $# will expand to the number of arguments so specified
947 and
948 __
949
950
951 Unquoted variable expansions performed by procmail are al-
952 ways split on space, tab, and newline characters; the IFS
953 variable is not used internally.
954
955
956 Procmail does not support the expansion of `~'.
957
958
959 A line buffer of length $LINEBUF is used when processing the
960 ''rcfile'', any expansions that don't fit within this
961 lim- it will be truncated and PROCMAIL_OVERFLOW will be set.
962 If the overflowing line is a condition or an action line,
963 then it will be considered failed and procmail will con-
964 tinue processing. If it is a variable assignment or recipe
965 start line then procmail will abort the entire rc-
966 file.
967
968
969 If the global lockfile has a ''relative'' path, and the
970 cur- rent directory is not the same as when the global
971 lockfile was created, then the global lockfile will not be
972 removed if procmail exits at that point (remedy: use
973 ''absolute'' paths to specify global
974 lockfiles).
975
976
977 If an rcfile has a ''relative'' path and when the rcfile
978 is first opened __MAILDIR__ contains a relative path, and
979 if at one point procmail is instructed to clone itself and
980 the current directory has changed since the rcfile was
981 opened, then procmail will not be able to clone itself
982 (remedy: use an ''absolute'' path to reference the rcfile
983 or make sure MAILDIR contains an absolute path as the rcfile
984 is opened).
985
986
987 A locallockfile on the recipe that marks the start of a
988 non-forking nested block does not work as
989 expected.
990
991
992 When capturing stdout from a recipe into an environment
993 variable, exactly one trailing newline will be
994 stripped.
995
996
997 Some non-optimal and non-obvious regexps set MATCH to an
998 incorrect value. The regexp can be made to work by remov-
999 ing one or more unneeded
1000 !!MISCELLANEOUS
1001
1002
1003 If the regular expression contains `__^TO___' it will be
5 AristotlePagaltzis 1004 sub- stituted by `__(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To)
1 perry 1005 :(.*[[^-a-zA-Z0-9_.])?)__', which should catch all
1006 destination specifications containing a specific
1007 ''address''.
1008
1009
1010 If the regular expression contains `__^TO__' it will be
5 AristotlePagaltzis 1011 sub- stituted by `__(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[[^a-zA-Z])?)__',
1 perry 1012 which should catch all destination specifications containing
1013 a specific ''word''.
1014
1015
1016 If the regular expression contains `__^FROM_DAEMON__' it
1017 will be substituted by
1018 `__(^(Mailing-List:|Precedence:.*(junk |bulk|list)|To:
5 AristotlePagaltzis 1019 Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|
1 perry 1020 __', which should catch mails coming from most
1021 daemons (how's that for a regular expression
1022 :-).
1023
1024
1025 If the regular expression contains `__^FROM_MAILER__' it
1026 will be substituted by `__(^(((Resent-)?(From|Sender)
1027 |X-Envelope-From):|
1028 __' (a stripped down version of
1029 `__^FROM_DAEMON__'), which should catch mails coming from
1030 most mailer-daemons.
1031
1032
1033 When assigning boolean values to variables like VERBOSE,
1034 DELIVERED or COMSAT, procmail accepts as true every string
1035 starting with: a non-zero value, `on', `y', `t' or `e'.
1036 False is every string starting with: a zero value, `off',
1037 `n', `f' or `d'.
1038
1039
1040 If the action line of a recipe specifies a program, a sole
1041 backslash-newline pair in it on an otherwise empty line will
1042 be converted into a newline.
1043
1044
1045 The regular expression engine built into procmail does not
1046 support named character classes.
1047 !!NOTES
1048
1049
1050 Since unquoted leading whitespace is generally ignored in
1051 the rcfile you can indent everything to taste.
1052
1053
1054 The leading `|' on the action line to specify a program or
1055 filter is stripped before checking for
1056 $SHELLMETAS.
1057
1058
1059 Files included with the INCLUDERC directive containing on-
1060 ly environment variable assignments can be shared with
1061 sh.
1062
1063
1064 The current behavior of assignments on the command line to
1065 __INCLUDERC__ and __SWITCHRC__ is not guaranteed, has
1066 been changed once already, and may be changed again or
1067 removed in fu- ture releases.
1068
1069
1070 For ''really'' complicated processing you can even
1071 consider calling __procmail__ recursively.
1072
1073
1074 In the old days, the `:0' that marks the beginning of a
1075 recipe, had to be changed to `:n', whereby `n' denotes the
1076 number of conditions that follow.
1077 !!AUTHORS
1078
1079
1080 Stephen R. van den Berg
1081
1082
1083
1084 Philip A. Guenther
1085
1086
1087
1088 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.