1PROCMAILRC(5)                 File Formats Manual                PROCMAILRC(5)
2
3
4

NAME

6       procmailrc - procmail rcfile
7

SYNOPSIS

9       $HOME/.procmailrc
10

DESCRIPTION

12       For a quick start, see NOTES at the end of the procmail(1) man page.
13
14       The  rcfile  can  contain a mixture of environment variable assignments
15       (some of which have special meanings to  procmail),  and  recipes.   In
16       their  most  simple appearance, the recipes are simply one line regular
17       expressions that are searched for in the header of the  arriving  mail.
18       The  first  recipe that matches is used to determine where the mail has
19       to go (usually a file).  If processing falls off the end of the rcfile,
20       procmail will deliver the mail to $DEFAULT.
21
22       There  are two kinds of recipes: delivering and non-delivering recipes.
23       If a delivering recipe is found to match, procmail considers  the  mail
24       (you  guessed  it) delivered and will cease processing the rcfile after
25       having successfully executed the action line of the recipe.  If a  non-
26       delivering recipe is found to match, processing of the rcfile will con‐
27       tinue after the action line of this recipe has been executed.
28
29       Delivering recipes are those that cause header and/or body of the  mail
30       to  be:  written  into  a file, absorbed by a program or forwarded to a
31       mailaddress.
32
33       Non-delivering recipes are: those that cause the output of a program or
34       filter  to  be  captured back by procmail or those that start a nesting
35       block.
36
37       You can tell procmail to treat a delivering recipe as if it were a non-
38       delivering  recipe  by  specifying the `c' flag on such a recipe.  This
39       will make procmail generate a carbon copy of the mail by delivering  it
40       to this recipe, yet continue processing the rcfile.
41
42       By  using  any  number  of  recipes you can presort your mail extremely
43       straightforward into several mailfolders.  Bear in mind though that the
44       mail  can arrive concurrently in these mailfolders (if several procmail
45       programs happen to run at the same time, not unlikely if a lot of  mail
46       arrives).   To  make sure this does not result in a mess, proper use of
47       lockfiles is highly recommended.
48
49       The environment variable assignments and recipes can be  freely  inter‐
50       mixed  in the rcfile. If any environment variable has a special meaning
51       to procmail, it will be used appropriately  the  moment  it  is  parsed
52       (i.e., you can change the current directory whenever you want by speci‐
53       fying a new MAILDIR, switch lockfiles by  specifying  a  new  LOCKFILE,
54       change the umask at any time, etc., the possibilities are endless :-).
55
56       The  assignments  and  substitutions of these environment variables are
57       handled exactly like in sh(1) (that includes all  possible  quotes  and
58       escapes),  with the added bonus that blanks around the '=' sign are ig‐
59       nored and that, if an environment variable appears without  a  trailing
60       '=',  it  will  be  removed from the environment.  Any program in back‐
61       quotes started by procmail will have the entire mail at its stdin.
62
63   Comments
64       A word beginning with # and all the following characters up to  a  NEW‐
65       LINE are ignored.  This does not apply to condition lines, which cannot
66       be commented.
67
68   Recipes
69       A line starting with ':' marks the beginning of a recipe.  It  has  the
70       following format:
71
72              :0 [flags] [ : [locallockfile] ]
73              <zero or more conditions (one per line)>
74              <exactly one action line>
75
76       Conditions start with a leading `*', everything after that character is
77       passed on to the internal  egrep  literally,  except  for  leading  and
78       trailing whitespace.  These regular expressions are completely compati‐
79       ble to the normal egrep(1) extended regular expressions.  See also  Ex‐
80       tended regular expressions.
81
82       Conditions  are  anded;  if  there are no conditions the result will be
83       true by default.
84
85       Flags can be any of the following:
86
87       H    Egrep the header (default).
88
89       B    Egrep the body.
90
91       D    Tell the internal egrep to distinguish  between  upper  and  lower
92            case (contrary to the default which is to ignore case).
93
94       A    This recipe will not be executed unless the conditions on the last
95            preceding recipe (on the current block-nesting level) without  the
96            `A' or `a' flag matched as well.  This allows you to chain actions
97            that depend on a common condition.
98
99       a    Has the same meaning as the `A' flag, with the  additional  condi‐
100            tion that the immediately preceding recipe must have been success‐
101            fully completed before this recipe is executed.
102
103       E    This recipe only executes if the immediately preceding recipe  was
104            not  executed.  Execution of this recipe also disables any immedi‐
105            ately following recipes with the 'E' flag.   This  allows  you  to
106            specify `else if' actions.
107
108       e    This  recipe  only  executes  if  the immediately preceding recipe
109            failed (i.e., the action line was attempted, but  resulted  in  an
110            error).
111
112       h    Feed the header to the pipe, file or mail destination (default).
113
114       b    Feed the body to the pipe, file or mail destination (default).
115
116       f    Consider the pipe as a filter.
117
118       c    Generate a carbon copy of this mail.  This only makes sense on de‐
119            livering recipes.  The only non-delivering recipe this flag has an
120            effect  on  is  on  a nesting block, in order to generate a carbon
121            copy this will clone the running procmail process (lockfiles  will
122            not be inherited), whereby the clone will proceed as usual and the
123            parent will jump across the block.
124
125       w    Wait for the filter or program to finish and  check  its  exitcode
126            (normally  ignored);  if the filter is unsuccessful, then the text
127            will not have been filtered.
128
129       W    Has the same meaning as the `w' flag, but will suppress any  `Pro‐
130            gram failure' message.
131
132       i    Ignore  any  write  errors on this recipe (i.e., usually due to an
133            early closed pipe).
134
135       r    Raw mode, do not try to ensure the mail ends with an  empty  line,
136            write it out as is.
137
138       There  are  some  special  conditions you can use that are not straight
139       regular expressions.  To select them, the condition must start with:
140
141       !    Invert the condition.
142
143       $    Evaluate the remainder of this condition according to  sh(1)  sub‐
144            stitution  rules  inside  double  quotes, skip leading whitespace,
145            then reparse it.
146
147       ?    Use the exitcode of the specified program.
148
149       <    Check if the total length of the mail is shorter than  the  speci‐
150            fied (in decimal) number of bytes.
151
152       >    Analogous to '<'.
153
154       variablename ??
155            Match  the  remainder  of this condition against the value of this
156            environment variable (which cannot be a pseudo variable).  A  spe‐
157            cial  case  is if variablename is equal to `B', `H', `HB' or `BH';
158            this merely overrides the default header/body search area  defined
159            by the initial flags on this recipe.
160
161       \    To quote any of the above at the start of the line.
162
163   Local lockfile
164       If you put a second (trailing) ':' on the first recipe line, then proc‐
165       mail will use a locallockfile (for this recipe only).  You can  option‐
166       ally  specify  the locallockfile to use; if you don't however, procmail
167       will use the destination filename (or the filename following the  first
168       '>>') and will append $LOCKEXT to it.
169
170   Recipe action line
171       The action line can start with the following characters:
172
173       !      Forwards to all the specified mail addresses.
174
175       |      Starts  the  specified program, possibly in $SHELL if any of the
176              characters $SHELLMETAS are spotted.  You can optionally  prepend
177              this  pipe symbol with variable=, which will cause stdout of the
178              program to be captured in  the  environment  variable  (procmail
179              will not terminate processing the rcfile at this point).  If you
180              specify just this pipe symbol, without any program,  then  proc‐
181              mail will pipe the mail to stdout.
182
183       {      Followed  by  at  least  one space, tab or newline will mark the
184              start of a nesting block.  Everything up till the  next  closing
185              brace  will  depend on the conditions specified for this recipe.
186              Unlimited nesting is permitted.  The closing brace exists merely
187              to delimit the block, it will not cause procmail to terminate in
188              any way.  If the end of a block is reached processing will  con‐
189              tinue  as  usual after the block.  On a nesting block, the flags
190              `H' and `B' only affect the conditions leading up to the  block,
191              the flags `h' and `b' have no effect whatsoever.
192
193       Anything  else  will be taken as a mailbox name (either a filename or a
194       directory,  absolute  or  relative  to  the  current   directory   (see
195       MAILDIR)).   If  it  is a (possibly yet nonexistent) filename, the mail
196       will be appended to it.
197
198       If it is a directory, the mail will be delivered to  a  newly  created,
199       guaranteed  to be unique file named $MSGPREFIX* in the specified direc‐
200       tory.  If the mailbox name ends in "/.", then this  directory  is  pre‐
201       sumed  to  be  an MH folder; i.e., procmail will use the next number it
202       finds available.  If the mailbox name ends in "/", then this  directory
203       is  presumed  to  be  a maildir folder; i.e., procmail will deliver the
204       message to a file in a subdirectory named "tmp" and rename it to be in‐
205       side  a subdirectory named "new".  If the mailbox is specified to be an
206       MH folder or maildir folder, procmail will create the necessary  direc‐
207       tories  if they don't exist, rather than treat the mailbox as a non-ex‐
208       istent filename.  When procmail is delivering to directories,  you  can
209       specify multiple directories to deliver to (procmail will do so utilis‐
210       ing hardlinks).
211
212   Environment variable defaults
213       LOGNAME, HOME and USER_SHELL
214                             Your (the recipient's) defaults
215
216       SHELL                 /bin/sh
217
218       PATH                  $HOME/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lo‐
219                             cal/bin :/usr/X11R6/bin  (Except  during the pro‐
220                             cessing of an /etc/procmailrc file, when it  will
221                             be set to `/usr/local/bin:/bin'.)
222
223       SHELLMETAS            &|<>~;?*[
224
225       SHELLFLAGS            -c
226
227       ORGMAIL               /var/spool/mail/$LOGNAME
228                             (Unless  -m  has been specified, in which case it
229                             is unset)
230
231       MAILDIR               $HOME
232                             (Unless the name of the first successfully opened
233                             rcfile  starts with `./' or if -m has been speci‐
234                             fied, in which case it defaults to `.')
235
236       DEFAULT               $ORGMAIL
237
238       MSGPREFIX             msg.
239
240       SENDMAIL              /usr/sbin/sendmail
241
242       SENDMAILFLAGS         -oi
243
244       HOST                  The current hostname
245
246       COMSAT                no
247                             (If an rcfile is specified on the command line)
248
249       PROCMAIL_VERSION      3.24
250
251       LOCKEXT               .lock
252
253       Other cleared or preset environment variables are IFS, ENV and PWD.
254
255       For security reasons, upon startup procmail will wipe out all  environ‐
256       ment variables that are suspected of modifying the behavior of the run‐
257       time linker.
258
259   Environment
260       Before you get lost in the multitude of environment variables, keep  in
261       mind that all of them have reasonable defaults.
262
263       MAILDIR     Current  directory  while procmail is executing (that means
264                   that all paths are relative to $MAILDIR).
265
266       DEFAULT     Default mailbox file (if not told otherwise, procmail  will
267                   dump  mail  in  this mailbox).  Procmail will automatically
268                   use $DEFAULT$LOCKEXT as lockfile prior to writing  to  this
269                   mailbox.   You  do  not need to set this variable, since it
270                   already points to the standard system mailbox.
271
272       LOGFILE     This file will also contain any error  or  diagnostic  mes‐
273                   sages  from  procmail  (normally none :-) or any other pro‐
274                   grams started by procmail.  If this file is not  specified,
275                   any  diagnostics  or  error messages will be mailed back to
276                   the sender.  See also LOGABSTRACT.
277
278       VERBOSE     You can turn on extended diagnostics by setting this  vari‐
279                   able  to `yes' or `on', to turn it off again set it to `no'
280                   or `off'.
281
282       LOGABSTRACT Just before procmail exits it logs an abstract of  the  de‐
283                   livered  message  in $LOGFILE showing the `From ' and `Sub‐
284                   ject:' fields of the header, what folder it finally went to
285                   and  how  long (in bytes) the message was.  By setting this
286                   variable to `no',  generation  of  this  abstract  is  sup‐
287                   pressed.   If you set it to `all', procmail will log an ab‐
288                   stract for every successful delivering recipe it processes.
289
290       LOG         Anything assigned to this  variable  will  be  appended  to
291                   $LOGFILE.
292
293       ORGMAIL     Usually  the  system  mailbox  (ORiGinal MAILbox).  If, for
294                   some obscure reason (like `filesystem full') the mail could
295                   not  be  delivered,  then this mailbox will be the last re‐
296                   sort.  If procmail fails to save the mail  in  here  (deep,
297                   deep  trouble  :-),  then  the mail will bounce back to the
298                   sender.
299
300       LOCKFILE    Global semaphore file.  If this file already exists,  proc‐
301                   mail  will  wait  until  it has gone before proceeding, and
302                   will create it  itself  (cleaning  it  up  when  ready,  of
303                   course).  If more than one lockfile are specified, then the
304                   previous one will be removed before trying  to  create  the
305                   new  one.   The  use  of  a global lockfile is discouraged,
306                   whenever possible use locallockfiles (on a per  recipe  ba‐
307                   sis) instead.
308
309       LOCKEXT     Default extension that is appended to a destination file to
310                   determine what local lockfile to use (only if turned on, on
311                   a per-recipe basis).
312
313       LOCKSLEEP   Number  of seconds procmail will sleep before retrying on a
314                   lockfile (if it already existed); if not specified, it  de‐
315                   faults to 8 seconds.
316
317       LOCKTIMEOUT Number of seconds that have to have passed since a lockfile
318                   was last modified/created before procmail decides that this
319                   must  be  an  erroneously leftover lockfile that can be re‐
320                   moved by force now.  If zero, then no timeout will be  used
321                   and  procmail  will  wait forever until the lockfile is re‐
322                   moved; if not specified, it defaults to 1024 seconds.  This
323                   variable  is  useful to prevent indefinite hangups of send‐
324                   mail/procmail.  Procmail is immune to clock skew across ma‐
325                   chines.
326
327       TIMEOUT     Number  of seconds that have to have passed before procmail
328                   decides that some child it started must  be  hanging.   The
329                   offending  program  will  receive  a  TERMINATE signal from
330                   procmail, and processing of the rcfile will  continue.   If
331                   zero,  then  no timeout will be used and procmail will wait
332                   forever until the child has terminated; if  not  specified,
333                   it defaults to 960 seconds.
334
335       MSGPREFIX   Filename prefix that is used when delivering to a directory
336                   (not used when delivering to a maildir or an MH directory).
337
338       HOST        If this is not the hostname of the machine,  processing  of
339                   the current rcfile will immediately cease. If other rcfiles
340                   were specified on the command line,  processing  will  con‐
341                   tinue with the next one.  If all rcfiles are exhausted, the
342                   program will terminate, but  will  not  generate  an  error
343                   (i.e.,  to  the  mailer it will seem that the mail has been
344                   delivered).
345
346       UMASK       The name says it all (if it doesn't, then forget about this
347                   one  :-).   Anything assigned to UMASK is taken as an octal
348                   number.  If not specified, the umask defaults to  077.   If
349                   the  umask permits o+x, all the mailboxes procmail delivers
350                   to directly will receive an o+x mode change.  This  can  be
351                   used to check if new mail arrived.
352
353       SHELLMETAS  If  any of the characters in SHELLMETAS appears in the line
354                   specifying a filter or program, the line  will  be  fed  to
355                   $SHELL instead of being executed directly.
356
357       SHELLFLAGS  Any invocation of $SHELL will be like:
358                   "$SHELL" "$SHELLFLAGS" "$*";
359
360       SENDMAIL    If  you're  not  using  the forwarding facility don't worry
361                   about this one.  It specifies the program being  called  to
362                   forward any mail.
363                   It gets invoked as: "$SENDMAIL" $SENDMAILFLAGS "$@";
364
365       NORESRETRY  Number of retries that are to be made if any `process table
366                   full', `file table full', `out of memory' or `out  of  swap
367                   space'  error  should  occur.   If this number is negative,
368                   then procmail will retry indefinitely; if not specified, it
369                   defaults  to  4  times.   The retries occur with a $SUSPEND
370                   second interval.  The idea behind this is  that  if,  e.g.,
371                   the  swap  space has been exhausted or the process table is
372                   full, usually several other  programs  will  either  detect
373                   this  as well and abort or crash 8-), thereby freeing valu‐
374                   able resources for procmail.
375
376       SUSPEND     Number of seconds that procmail will pause  if  it  has  to
377                   wait  for  something that is currently unavailable (memory,
378                   fork, etc.); if not specified, it will default to  16  sec‐
379                   onds.  See also: LOCKSLEEP.
380
381       LINEBUF     Length  of the internal line buffers, cannot be set smaller
382                   than 128.  All lines read from the rcfile should not exceed
383                   $LINEBUF  characters  before  and  after expansion.  If not
384                   specified, it defaults to 2048.   This  limit,  of  course,
385                   does not apply to the mail itself, which can have arbitrary
386                   line lengths, or could be a binary file  for  that  matter.
387                   See also PROCMAIL_OVERFLOW.
388
389       DELIVERED   If  set  to `yes' procmail will pretend (to the mail agent)
390                   the mail has been delivered.  If mail cannot  be  delivered
391                   after  having  met this assignment (set to `yes'), the mail
392                   will be lost (i.e., it will not bounce).
393
394       TRAP        When procmail terminates of its own accord and not  because
395                   it  received a signal, it will execute the contents of this
396                   variable.  A copy of the mail can be read from stdin.   Any
397                   output  produced  by this command will be appended to $LOG‐
398                   FILE.  Possible uses for TRAP  are:  removal  of  temporary
399                   files,  logging  customised abstracts, etc.  See also EXIT‐
400                   CODE and LOGABSTRACT.
401
402       EXITCODE    By default, procmail returns an exitcode of zero  (success)
403                   if  it  successfully  delivered  the message or if the HOST
404                   variable was misset and there were no more rcfiles  on  the
405                   command  line;  otherwise it returns failure.  Before doing
406                   so, procmail examines the value of this variable.  If it is
407                   set  to a positive numeric value, procmail will instead use
408                   that value as its exitcode.  If this variable  is  set  but
409                   empty  and  TRAP  is set, procmail will set the exitcode to
410                   whatever the TRAP program returns.  If this variable is not
411                   set,  procmail  will  set  it shortly before calling up the
412                   TRAP program.
413
414       LASTFOLDER  This variable is assigned to by procmail whenever it is de‐
415                   livering  to  a  folder or program.  It always contains the
416                   name of the last file (or program) procmail  delivered  to.
417                   If  the  last delivery was to several directory folders to‐
418                   gether then $LASTFOLDER will contain the  hardlinked  file‐
419                   names as a space separated list.
420
421       MATCH       This  variable  is  assigned  to by procmail whenever it is
422                   told to extract text from a  matching  regular  expression.
423                   It  will  contain  all text matching the regular expression
424                   past the `\/' token.
425
426       SHIFT       Assigning a positive value to this variable  has  the  same
427                   effect  as  the  `shift' command in sh(1).  This command is
428                   most useful to extract extra arguments passed  to  procmail
429                   when acting as a generic mailfilter.
430
431       INCLUDERC   Names  an  rcfile (relative to the current directory) which
432                   will be included here as if it were part of the current rc‐
433                   file.  Nesting is permitted and only limited by systems re‐
434                   sources (memory and file descriptors).  As no  checking  is
435                   done  on  the permissions or ownership of the rcfile, users
436                   of INCLUDERC should make sure that only trusted users  have
437                   write  access to the included rcfile or the directory it is
438                   in.  Command line assignments to INCLUDERC have no effect.
439
440       SWITCHRC    Names an rcfile (relative  to  the  current  directory)  to
441                   which  processing  will  be  switched.  If the named rcfile
442                   doesn't exist or is not a normal file or /dev/null then  an
443                   error  will  be  logged and processing will continue in the
444                   current rcfile.  Otherwise, processing of the  current  rc‐
445                   file  will be aborted and the named rcfile started.  Unset‐
446                   ting SWITCHRC aborts processing of the current rcfile as if
447                   it  had  ended  at  the  assignment.  As with INCLUDERC, no
448                   checking is done on the permissions or ownership of the rc‐
449                   file and command line assignments have no effect.
450
451       PROCMAIL_VERSION
452                   The version number of the running procmail binary.
453
454       PROCMAIL_OVERFLOW
455                   This  variable will be set to a non-empty value if procmail
456                   detects a buffer overflow.  See the BUGS section below  for
457                   other details of operation when overflow occurs.
458
459       COMSAT      Comsat(8)/biff(1)  notification is on by default, it can be
460                   turned off by setting this variable to `no'.  Alternatively
461                   the  biff-service can be customised by setting it to either
462                   `service@', `@hostname', or `service@hostname'.   When  not
463                   specified it defaults to biff@localhost.
464
465       DROPPRIVS   If  set to `yes' procmail will drop all privileges it might
466                   have had (suid or sgid).  This is only useful if  you  want
467                   to  guarantee  that  the bottom half of the /etc/procmailrc
468                   file is executed on behalf of the recipient.
469
470   Extended regular expressions
471       The following tokens are known to both the procmail internal egrep  and
472       the  standard  egrep(1) (beware that some egrep implementations include
473       other non-standard extensions; in particular, the repetition operator {
474       is not supported by procmail's egrep):
475
476       ^         Start of a line.
477
478       $         End of a line.
479
480       .         Any character except a newline.
481
482       a*        Any sequence of zero or more a's.
483
484       a+        Any sequence of one or more a's.
485
486       a?        Either zero or one a.
487
488       [^-a-d]   Any  character which is not either a dash, a, b, c, d or new‐
489                 line.
490
491       de|abc    Either the sequence `de' or `abc'.
492
493       (abc)*    Zero or more times the sequence `abc'.
494
495       \.        Matches a single dot; use \ to quote any of the magic charac‐
496                 ters  to get rid of their special meaning.  See also $\ vari‐
497                 able substitution.
498
499       These were only samples, of course, any  more  complex  combination  is
500       valid as well.
501
502       The following token meanings are special procmail extensions:
503
504       ^ or $    Match a newline (for multiline matches).
505
506       ^^        Anchor  the  expression at the very start of the search area,
507                 or if encountered at the end of the expression, anchor it  at
508                 the very end of the search area.
509
510       \< or \>  Match  the character before or after a word.  They are merely
511                 a shorthand for `[^a-zA-Z0-9_]', but can also match newlines.
512                 Since they match actual characters, they are only suitable to
513                 delimit words, not to delimit inter-word space.
514
515       \/        Splits the expression in two parts.  Everything matching  the
516                 right  part  will  be assigned to the MATCH environment vari‐
517                 able.
518

EXAMPLES

520       Look in the procmailex(5) man page.
521

CAVEATS

523       Continued lines in an action line that specifies a program always  have
524       to  end  in a backslash, even if the underlying shell would not need or
525       want the backslash to indicate continuation.  This is due  to  the  two
526       pass  parsing  process  needed (first procmail, then the shell (or not,
527       depending on SHELLMETAS)).
528
529       Don't put comments on the  regular  expression  condition  lines  in  a
530       recipe, these lines are fed to the internal egrep literally (except for
531       continuation backslashes at the end of a line).
532
533       Leading whitespace on continued regular expression condition  lines  is
534       usually  ignored  (so  that they can be indented), but not on continued
535       condition lines that are evaluated according to the sh(1)  substitution
536       rules inside double quotes.
537
538       Watch  out  for  deadlocks  when doing unhealthy things like forwarding
539       mail to your own account.  Deadlocks can be broken  by  proper  use  of
540       LOCKTIMEOUT.
541
542       Any  default  values  that  procmail has for some environment variables
543       will always override the ones that were already defined.  If you really
544       want  to  override the defaults, you either have to put them in the rc‐
545       file or on the command line as arguments.
546
547       The /etc/procmailrc file cannot change the PATH setting  seen  by  user
548       rcfiles  as  the  value  is reset when procmail finishes the /etc/proc‐
549       mailrc file.  While future enhancements are expected in this area,  re‐
550       compiling procmail with the desired value is currently the only correct
551       solution.
552
553       Environment variables set inside the shell-interpreted-`|' action  part
554       of  a  recipe will not retain their value after the recipe has finished
555       since they are set in a subshell of procmail.  To make sure  the  value
556       of  an  environment variable is retained you have to put the assignment
557       to the variable before the leading `|' of a recipe, so that it can cap‐
558       ture stdout of the program.
559
560       If you specify only a `h' or a `b' flag on a delivering recipe, and the
561       recipe matches, then, unless the `c' flag is present as well, the  body
562       respectively the header of the mail will be silently lost.
563

SEE ALSO

565       procmail(1), procmailsc(5), procmailex(5), sh(1), csh(1), mail(1),
566       mailx(1), uucp(1), aliases(5), sendmail(8), egrep(1), regexp(5),
567       grep(1), biff(1), comsat(8), lockfile(1), formail(1)
568

BUGS

570       The  only substitutions of environment variables that can be handled by
571       procmail  itself  are  of  the  type  $name,  ${name},   ${name:-text},
572       ${name:+text},  ${name-text}, ${name+text}, $\name, $#, $n, $$, $?, $_,
573       $- and $=; whereby $\name will be substituted by the all-magic-regular-
574       expression-characters-disarmed  equivalent  of $name, $_ by the name of
575       the current rcfile, $- by $LASTFOLDER and $= will contain the score  of
576       the  last  recipe.  Furthermore, the result of $\name substitution will
577       never be split on whitespace.  When the -a or -m options are  used,  $#
578       will  expand  to  the  number  of  arguments so specified and "$@" (the
579       quotes are required) will expand to the specified arguments.   However,
580       "$@" will only be expanded when used in the argument list to a program,
581       and then only one such occurrence will be expanded.
582
583       Unquoted variable expansions performed by procmail are always split  on
584       space, tab, and newline characters; the IFS variable is not used inter‐
585       nally.
586
587       Procmail does not support the expansion of `~'.
588
589       A line buffer of length $LINEBUF is used when  processing  the  rcfile,
590       any  expansions  that don't fit within this limit will be truncated and
591       PROCMAIL_OVERFLOW will be set.  If the overflowing line is a  condition
592       or  an action line, then it will be considered failed and procmail will
593       continue processing.  If it is a variable assignment  or  recipe  start
594       line then procmail will abort the entire rcfile.
595
596       If  the  global lockfile has a relative path, and the current directory
597       is not the same as when the global lockfile was created, then the glob‐
598       al  lockfile will not be removed if procmail exits at that point (reme‐
599       dy: use absolute paths to specify global lockfiles).
600
601       If an rcfile has a relative path and when the rcfile  is  first  opened
602       MAILDIR  contains  a relative path, and if at one point procmail is in‐
603       structed to clone itself and the current directory  has  changed  since
604       the  rcfile  was opened, then procmail will not be able to clone itself
605       (remedy: use an absolute path to reference  the  rcfile  or  make  sure
606       MAILDIR contains an absolute path as the rcfile is opened).
607
608       A  locallockfile  on  the  recipe that marks the start of a non-forking
609       nested block does not work as expected.
610
611       When capturing stdout from a recipe into an environment  variable,  ex‐
612       actly one trailing newline will be stripped.
613
614       Some non-optimal and non-obvious regexps set MATCH to an incorrect val‐
615       ue.  The regexp can be made to work by removing one  or  more  unneeded
616       '*', '+', or '?' operators on the left-hand side of the \/ token.
617

MISCELLANEOUS

619       If the regular expression contains `^TO_' it will be substituted by
620       `(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope
621       |Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)', which should catch
622       all destination specifications containing a specific address.
623
624       If the regular expression contains `^TO' it will be substituted by
625       `(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope
626       |Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)', which should catch all
627       destination specifications containing a specific word.
628
629       If the regular expression contains `^FROM_DAEMON' it will be substitut‐
630       ed by `(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple
631       recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From
632       )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?
633       |daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)
634       |r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)
635       |mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-
636       z0-9][-_a-z0-9]*)?[%@>\t ][^<)]*(\(.*\).*)?)?$([^>]|$)))', which should
637       catch mails coming from most daemons (how's that for a regular
638       expression :-).
639
640       If the regular expression contains `^FROM_MAILER' it will be substitut‐
641       ed by `(^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From
642       )([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mail(er)?
643       |daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|s(erv(ices?
644       |er)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t
645       ][^<)]*(\(.*\).*)?)?$([^>]|$))' (a stripped down version of
646       `^FROM_DAEMON'), which should catch mails coming from most mailer-
647       daemons.
648
649       When  assigning  boolean values to variables like VERBOSE, DELIVERED or
650       COMSAT, procmail accepts as true every string starting with: a non-zero
651       value,  `on',  `y', `t' or `e'.  False is every string starting with: a
652       zero value, `off', `n', `f' or `d'.
653
654       If the action line of a recipe specifies a program, a  sole  backslash-
655       newline  pair in it on an otherwise empty line will be converted into a
656       newline.
657
658       The regular expression engine built  into  procmail  does  not  support
659       named character classes.
660

NOTES

662       Since  unquoted  leading  whitespace is generally ignored in the rcfile
663       you can indent everything to taste.
664
665       The leading `|' on the action line to specify a program  or  filter  is
666       stripped before checking for $SHELLMETAS.
667
668       Files included with the INCLUDERC directive containing only environment
669       variable assignments can be shared with sh.
670
671       The current behavior of assignments on the command  line  to  INCLUDERC
672       and  SWITCHRC is not guaranteed, has been changed once already, and may
673       be changed again or removed in future releases.
674
675       For really complicated processing you can even consider  calling  proc‐
676       mail recursively.
677
678       In  the old days, the `:0' that marks the beginning of a recipe, had to
679       be changed to `:n', whereby `n' denotes the number of  conditions  that
680       follow.
681

AUTHORS

683       Stephen R. van den Berg
684              <srb@cuci.nl>
685
686
687
688                                    BuGless                      PROCMAILRC(5)
Impressum