{
    "mode": "man",
    "parameter": "PROCMAIL",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/PROCMAIL/1/json",
    "generated": "2026-10-22T14:23:54Z",
    "synopsis": "procmail [-ptoY] [-f fromwhom]\n[parameter=value | rcfile] ...\nprocmail [-toY] [-f fromwhom] [-a argument] ...\n-d recipient ...\nprocmail [-ptY] -m [parameter=value] ...  rcfile\n[argument] ...",
    "sections": {
        "NAME": {
            "content": "procmail - autonomous mail processor\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "procmail [-ptoY] [-f fromwhom]\n[parameter=value | rcfile] ...\nprocmail [-toY] [-f fromwhom] [-a argument] ...\n-d recipient ...\nprocmail [-ptY] -m [parameter=value] ...  rcfile\n[argument] ...",
            "subsections": [
                {
                    "name": "procmail -v",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "For a quick start, see NOTES at the end.\n\nProcmail should be invoked automatically over the .forward file mechanism as soon as mail ar‐\nrives.   Alternatively,  when  installed  by  a  system administrator, it can be invoked from\nwithin the mailer immediately.  When invoked, it first sets some environment variables to de‐\nfault values, reads the mail message from stdin until an EOF, separates  the  body  from  the\nheader,  and  then,  if  no  command line arguments are present, it starts to look for a file\nnamed $HOME/.procmailrc.  According to the processing recipes in this file, the mail  message\nthat  just arrived gets distributed into the right folder (and more).  If no rcfile is found,\nor processing of the rcfile falls off the end, procmail will store the mail  in  the  default\nsystem mailbox.\n\nIf  no  rcfiles  and  no  -p have been specified on the command line, procmail will, prior to\nreading $HOME/.procmailrc, interpret commands from /etc/procmailrc (if present).   Care  must\nbe taken when creating /etc/procmailrc, because, if circumstances permit, it will be executed\nwith root privileges (contrary to the $HOME/.procmailrc file of course).\n\nIf running suid root or with root privileges, procmail will be able to perform as a function‐\nally enhanced, backwards compatible mail delivery agent.\n\nProcmail  can  also be used as a general purpose mail filter, i.e., provisions have been made\nto enable procmail to be invoked in a special sendmail rule.\n\nThe rcfile format is described in detail in the procmailrc(5) man page.\n\nThe weighted scoring technique is described in detail in the procmailsc(5) man page.\n\nExamples for rcfile recipes can be looked up in the procmailex(5) man page.\n",
            "subsections": [
                {
                    "name": "Signals",
                    "content": "TERMINATE   Terminate prematurely and requeue the mail.\n\nHANGUP      Terminate prematurely and bounce the mail.\n\nINTERRUPT   Terminate prematurely and bounce the mail.\n\nQUIT        Terminate prematurely and silently lose the mail.\n\nALARM       Force a timeout (see TIMEOUT).\n\nUSR1        Equivalent to a VERBOSE=off.\n\nUSR2        Equivalent to a VERBOSE=on.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "-p",
                    "content": "except  for the value of TZ.  However, in any case: any default values will override any\npreexisting environment variables, i.e., procmail will not pay any attention to any pre‐\ndefined environment variables, it will happily overwrite them  with  its  own  defaults.\nFor  the  list  of environment variables that procmail will preset see the procmailrc(5)\nman page.  If both -p and -m are specified, the list  of  preset  environment  variables\nshrinks to just: LOGNAME, HOME, SHELL, USERSHELL, ORGMAIL and MAILDIR.\n",
                    "flag": "-p"
                },
                {
                    "name": "-t",
                    "content": "tinations you gave, the mail will not bounce, but will return to the mailqueue.  Another\ndelivery-attempt will be made at some time in the future.\n",
                    "flag": "-t"
                },
                {
                    "name": "-f _",
                    "content": "Causes procmail to regenerate the leading `From ' line with fromwhom as the sender  (in‐\nstead  of  -f one could use the alternate and obsolete -r).  If fromwhom consists merely\nof a single `-', then procmail will only update the timestamp on the `From  '  line  (if\npresent, if not, it will generate a new one).\n",
                    "flag": "-f"
                },
                {
                    "name": "-o",
                    "content": "",
                    "flag": "-o"
                },
                {
                    "name": "-Y",
                    "content": "",
                    "flag": "-Y"
                },
                {
                    "name": "-a _",
                    "content": "This will set $1 to be equal to argument.  Each succeeding -a argument will set the next\nnumber  variable  ($2, $3, etc).  It can be used to pass meta information along to proc‐\nmail.  This is typically done by passing along the $@x  information  from  the  sendmail\nmailer rule.\n",
                    "flag": "-a"
                },
                {
                    "name": "-d _",
                    "content": "This  turns  on  explicit  delivery  mode, delivery will be to the local user recipient.\nThis, of course, only is possible if procmail has root privileges (or if procmail is al‐\nready running with the recipient's euid and egid).  Procmail will setuid to the intended\nrecipients and delivers the mail as if it were invoked by the recipient  with  no  argu‐\nments (i.e., if no rcfile is found, delivery is like ordinary mail).  This option is in‐\ncompatible with -p.\n",
                    "flag": "-d"
                },
                {
                    "name": "-m",
                    "content": "specified on the command line.  After the rcfile, procmail will accept an unlimited num‐\nber of arguments.  If the rcfile is an absolute  path  starting  with  /etc/procmailrcs/\nwithout  backward  references  (i.e.  the parent directory cannot be mentioned) procmail\nwill, only if no security violations are found, take on the identity of the owner of the\nrcfile (or symbolic link).  For some advanced usage of this option you  should  look  in\nthe EXAMPLES section below.\n",
                    "flag": "-m"
                }
            ]
        },
        "ARGUMENTS": {
            "content": "Any  arguments  containing an '=' are considered to be environment variable assignments, they\nwill all be evaluated after the default values have been assigned and before the first rcfile\nis opened.\n\nAny other arguments are presumed to be rcfile paths (either absolute, or if they  start  with\n`./'  relative to the current directory; any other relative path is relative to $HOME, unless\nthe -m option has been given, in which case all relative paths are relative  to  the  current\ndirectory); procmail will start with the first one it finds on the command line.  The follow‐\ning  ones will only be parsed if the preceding ones have a not matching HOST-directive entry,\nor in case they should not exist.\n\nIf no rcfiles are specified, it looks for $HOME/.procmailrc.  If not even that can be  found,\nprocessing  will  continue according to the default settings of the environment variables and\nthe ones specified on the command line.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Examples for rcfile recipes can be looked up in the procmailex(5) man page.  A  small  sample\nrcfile can be found in the NOTES section below.\n\nSkip  the  rest of this EXAMPLES section unless you are a system administrator who is vaguely\nfamiliar with sendmail.cf syntax.\n\nThe -m option is typically used when procmail is called from within a rule in the sendmail.cf\nfile.  In order to be able to do this it is convenient to create an extra  `procmail'  mailer\nin  your  sendmail.cf  file  (in  addition to the perhaps already present `local' mailer that\nstarts up procmail).  To create such a `procmail' mailer I'd suggest something like:\n\nMprocmail, P=/usr/bin/procmail, F=mSDFMhun, S=11, R=21,\nA=procmail -m $h $g $u\n\nThis enables you to use rules like the following (most likely in ruleset 0)  to  filter  mail\nthrough the procmail mailer (please note the leading tab to continue the rule, and the tab to\nseparate the comments):\n\nR$*<@some.where>$*\n$#procmail $@/etc/procmailrcs/some.rc $:$1@some.where.procmail$2\nR$*<@$*.procmail>$*\n$1<@$2>$3       Already filtered, map back\n\nAnd /etc/procmailrcs/some.rc could be as simple as:\n\nSENDER = \"<$1>\"                 # fix for empty sender addresses\nSHIFT = 1                       # remove it from $@\n\n:0                              # sink all junk mail\n* ^Subject:.*junk\n/dev/null\n\n:0 w                            # pass along all other mail\n! -oi -f \"$SENDER\" \"$@\"\n\nDo  watch  out  when  sending mail from within the /etc/procmailrcs/some.rc file, if you send\nmail to addresses which match the first rule again, you could be  creating  an  endless  mail\nloop.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/passwd            to set the recipient's LOGNAME, HOME and USERSHELL variable defaults\n\n/var/mail/$LOGNAME     system mailbox; both the system mailbox and the immediate directory it\nis in will be created every time procmail starts and either one is not\npresent\n\n/etc/procmailrc        initial global rcfile\n\n/etc/procmailrcs/      special privileges path for rcfiles\n\n$HOME/.procmailrc      default rcfile\n",
            "subsections": [
                {
                    "name": "/var/mail/$LOGNAME.lock",
                    "content": "lockfile  for  the system mailbox (not automatically used by procmail,\nunless $DEFAULT equals /var/mail/$LOGNAME and procmail  is  delivering\nto $DEFAULT)\n\n/usr/sbin/sendmail     default mail forwarder\n\n????`hostname`        temporary `unique' zero-length files created by procmail\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "procmailrc(5), procmailsc(5), procmailex(5), sh(1), csh(1), mail(1), mailx(1), uucp(1),\naliases(5), sendmail(8), egrep(1), grep(1), biff(1), comsat(8), lockfile(1), formail(1),\ncron(1)\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "Autoforwarding mailbox found\nThe  system  mailbox had its suid or sgid bit set, procmail terminates\nwith EXNOUSER assuming that this mailbox must not be delivered to.\n\nBad substitution of \"x\"\nNot a valid environment variable name specified.\n\nClosing brace unexpected\nThere was no corresponding opening brace (nesting block).\n\nConflicting options    Not all option combinations are useful\n\nConflicting x suppressed\nFlag x is not compatible with some other flag on this recipe.\n\nCouldn't create \"x\"    The system mailbox was missing and could not/will not be created.\n\nCouldn't create maildir part \"x\"\nThe maildir folder \"x\" is missing one or more required  subdirectories\nand procmail could not create them.\n\nCouldn't create or rename temp file \"x\"\nAn  error  occurred  in  the mechanics of  delivering to the directory\nfolder \"x\".\n\nCouldn't determine implicit lockfile from \"x\"\nThere were no `>>' redirectors to be found, using simply `$LOCKEXT' as\nlocallockfile.\n\nCouldn't read \"x\"      Procmail was unable to open an rcfile or it was not a regular file, or\nprocmail couldn't open an MH directory to find  the  highest  numbered\nfile.\n\nCouldn't unlock \"x\"    Lockfile  was already gone, or write permission to the directory where\nthe lockfile is has been denied.\n\nDeadlock attempted on \"x\"\nThe locallockfile specified on this recipe is equal to a still  active\n$LOCKFILE.\n\nDenying special privileges for \"x\"\nProcmail  will not take on the identity that comes with the rcfile be‐\ncause a security violation was found (e.g.  -p or variable assignments\non the command line) or procmail had insufficient privileges to do so.\n\nDescriptor \"x\" was not open\nAs procmail was started, stdin, stdout or  stderr  was  not  connected\n(possibly an attempt to subvert security)\n\nEnforcing stricter permissions on \"x\"\nThe  system  mailbox of the recipient was found to be unsecured, proc‐\nmail secured it.\n\nError while writing to \"x\"\nNonexistent subdirectory, no write permission, pipe died or disk full.\n\nExceeded LINEBUF       Buffer overflow detected, LINEBUF was too small, PROCMAILOVERFLOW has\nbeen set.\n\nMAILDIR is not an absolute path\n\nMAILDIR path too long\n\nORGMAIL is not an absolute path\n\nORGMAIL path too long\n\ndefault rcfile is not an absolute path\n\ndefault rcfile path too long\nThe specified item's full path, when expanded, was longer than LINEBUF\nor didn't start with a file separator.\n\nExcessive output quenched from \"x\"\nThe backquoted expression \"x\" tried to produce too much output for the\ncurrent LINEBUF; the rest was discarded and PROCMAILOVERFLOW has been\nset.\n\nExtraneous x ignored   The action line or other flags on this recipe make x meaningless.\n\nFailed forking \"x\"     Process table is full (and NORESRETRY has been exhausted).\n\nFailed to execute \"x\"  Program not in path, or not executable.\n\nForced unlock denied on \"x\"\nNo write permission in the directory where lockfile  \"x\"  resides,  or\nmore  than  one  procmail  trying  to force a lock at exactly the same\ntime.\n\nForcing lock on \"x\"    Lockfile \"x\" is going to be removed by force because of a timeout (see\nalso: LOCKTIMEOUT).\n\nIncomplete recipe      The start of a recipe was found, but it stranded in an EOF.\n\nInsufficient privileges\nProcmail either needs root privileges, or must have the  right  (e)uid",
            "subsections": [
                {
                    "name": "and (e)",
                    "content": "Invalid regexp \"x\"     The  regular  expression \"x\" contains errors (most likely some missing\nor extraneous parens).\n\nKernel-lock failed     While trying to use the kernel-supported locking calls,  one  of  them\nfailed  (usually  indicates  an OS error), procmail ignores this error\nand proceeds.\n\nKernel-unlock failed   See above.\n\nLock failure on \"x\"    Can only occur if you specify some real weird (and illegal)  lockfile‐\nnames  or if the lockfile could not be created because of insufficient\npermissions or nonexistent subdirectories.\n\nLost \"x\"               Procmail tried to clone itself but could not find back rcfile \"x\"  (it\neither got removed or it was a relative path and you changed directory\nsince procmail opened it last time).\n\nMissing action         The current recipe was found to be incomplete.\n\nMissing closing brace  A nesting block was started, but never finished.\n\nMissing name           The -f option needs an extra argument.\n\nMissing argument       You specified the -a option but forgot the argument.\n\nMissing rcfile         You specified the -m option, procmail expects the name of an rcfile as\nargument.\n\nMissing recipient      You specified the -d option or called procmail under a different name,\nit expects one or more recipients as arguments.\n\nNo space left to finish writing \"x\"\nThe  filesystem containing \"x\" does not have enough free space to per‐\nmit delivery of the message to the file.\n\nOut of memory          The system is out of swap space (and NORESRETRY has been exhausted).\n\nProcessing continued   The unrecognised options on the command line are  ignored,  proceeding\nas usual.\n\nProgram failure (nnn) of \"x\"\nProgram that was started by procmail returned nnn instead of EXITSUC‐\nCESS  (=0);  if  nnn  is negative, then this is the signal the program\ndied on.\n\nQuota exceeded while writing \"x\"\nThe filesize quota for the recipient on the filesystem containing  \"x\"\ndoes not permit delivering the message to the file.\n\nRenaming bogus \"x\" into \"x\"\nThe  system  mailbox  of the recipient was found to be bogus, procmail\nperformed evasive actions.\n\nRescue of unfiltered data succeeded/failed\nA filter returned unsuccessfully, procmail tried to get back the orig‐\ninal text.\n\nSkipped: \"x\"           Couldn't do anything with \"x\" in the rcfile (syntax  error),  ignoring\nit.\n\nSuspicious rcfile \"x\"  The  owner  of  the rcfile was not the recipient or root, the file was\nworld writable, or the directory that contained it was world writable,\nor this was the default rcfile ($HOME/.procmailrc) and either  it  was\ngroup  writable  or the directory that contained it was group writable\n(the rcfile was not used).\n\nTerminating prematurely whilst waiting for ...\nProcmail received a signal while it was waiting for ...\n\nTimeout, terminating \"x\"\nTimeout has occurred on program or filter \"x\".\n\nTimeout, was waiting for \"x\"\nTimeout has occurred on program, filter or file \"x\".  If it was a pro‐\ngram or filter, then it didn't seem to be running anymore.\n\nTruncated file to former size\nThe file could not be delivered to successfully, so the file was trun‐\ncated to its former size.\n\nTruncating \"x\" and retrying lock\n\"x\" does not seem to be a valid filename or the file is not empty.\n\nUnable to treat as directory \"x\"\nEither the suffix on \"x\" would indicate that it should  be  an  MH  or\nmaildir  folder,  or  it  was listed as an second folder into which to\nlink, but it already exists and is not a directory.\n\nUnexpected EOL         Missing closing quote, or trying to escape EOF.\n\nUnknown user \"x\"       The specified recipient does not have a corresponding uid.\n"
                }
            ]
        },
        "EXTENDED DIAGNOSTICS": {
            "content": "Extended diagnostics can be turned on and off through setting the VERBOSE variable.\n\n[pid] time & date      Procmail's pid and a timestamp.  Generated whenever  procmail  logs  a\ndiagnostic and at least a second has elapsed since the last timestamp.\n\nAcquiring kernel-lock  Procmail  now  tries to kernel-lock the most recently opened file (de‐\nscriptor).\n\nAssigning \"x\"          Environment variable assignment.\n\nAssuming identity of the recipient, VERBOSE=off\nDropping all privileges (if any), implicitly turns off extended  diag‐\nnostics.\n\nBypassed locking \"x\"   The  mail  spool  directory  was not accessible to procmail, it relied\nsolely on kernel locks.\n\nExecuting \"x\"          Starting program \"x\".  If it is started by procmail directly  (without\nan  intermediate shell), procmail will show where it separated the ar‐\nguments by inserting commas.\n\nHOST mismatched \"x\"    This host was called \"x\", HOST contained something else.\n\nLocking \"x\"            Creating lockfile \"x\".\n\nLinking to \"x\"         Creating a hardlink between directory folders.\n\nMatch on \"x\"           Condition matched.\n\nMatched \"x\"            Assigned \"x\" to MATCH.\n\nNo match on \"x\"        Condition didn't match, recipe skipped.\n\nNon-zero exitcode (nnn) by \"x\"\nProgram that was started by procmail as a condition or as  the  action\nof  a  recipe  with  the `W' flag returned nnn instead of EXITSUCCESS\n(=0); the usage indicates that this is not an entirely unexpected con‐\ndition.\n\nNotified comsat: \"$LOGNAME@offset:file\"\nSent comsat/biff a notice that mail arrived for user $LOGNAME at `off‐\nset' in `file'.\n\nOpening \"x\"            Opening file \"x\" for appending.\n\nRcfile: \"x\"            Rcfile changed to \"x\".\n\nReiterating kernel-lock\nWhile attempting several locking methods, one of these failed.   Proc‐\nmail will reiterate until they all succeed in rapid succession.\n\nScore: added newtotal \"x\"\nThis  condition  scored `added' points, which resulted in a `newtotal'\nscore.\n\nUnlocking \"x\"          Removing lockfile \"x\" again.\n",
            "subsections": []
        },
        "WARNINGS": {
            "content": "You should create a shell script that uses lockfile(1) before invoking your mail shell on any\nmailbox file other than the system mailbox (unless of course, your mail shell uses  the  same\nlockfiles (local or global) you specified in your rcfile).\n\nIn the unlikely event that you absolutely need to kill procmail before it has finished, first\ntry  and use the regular kill command (i.e., not kill -9, see the subsection Signals for sug‐\ngestions), otherwise some lockfiles might not get removed.\n\nBeware when using the -t option, if procmail repeatedly is unable to deliver the mail  (e.g.,\ndue  to  an incorrect rcfile), the system mailqueue could fill up.  This could aggravate both\nthe local postmaster and other users.\n\nThe /etc/procmailrc file might be executed with root privileges, so be very careful  of  what\nyou  put  in it.  SHELL will be equal to that of the current recipient, so if procmail has to\ninvoke the shell, you'd better set it to some safe value first.  See also: DROPPRIVS.\n\nKeep in mind that if chown(1) is permitted on files in /etc/procmailrcs/, that  they  can  be\nchowned  to  root  (or anyone else) by their current owners.  For maximum security, make sure\nthis directory is executable to root only.\n\nProcmail is not the proper tool for sharing one mailbox among many users, such  as  when  you\nhave  one  POP account for all mail to your domain. It can be done if you manage to configure\nyour MTA to add some headers with the envelope recipient data in order to tell Procmail who a\nmessage is for, but this is usually not the right thing to do.  Perhaps you want to  investi‐\ngate  if  your  MTA  offers  `virtual  user tables', or check out the `multidrop' facility of\nFetchmail.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "After removing a lockfile by force, procmail waits $SUSPEND seconds  before  creating  a  new\nlockfile  so  that  another process that decides to remove the stale lockfile will not remove\nthe newly created lock by mistake.\n\nProcmail uses the regular TERMINATE signal to terminate any runaway filter, but it  does  not\ncheck if the filter responds to that signal and it only sends it to the filter itself, not to\nany of the filter's children.\n\nA continued Content-Length: field is not handled correctly.\n\nThe  embedded newlines in a continued header should be skipped when matching instead of being\ntreated as a single space as they are now.\n",
            "subsections": []
        },
        "MISCELLANEOUS": {
            "content": "If there is an existing Content-Length: field in the header of the mail and the -Y option  is\nnot  specified,  procmail  will trim the field to report the correct size.  Procmail does not\nchange the fieldwidth.\n\nIf there is no Content-Length: field or the -Y option has been specified and procmail appends\nto regular mailfolders, any lines in the body of the message that  look  like  postmarks  are\nprepended  with  `>'  (disarms  bogus  mailheaders).   The regular expression that is used to\nsearch for these postmarks is:\n`\\nFrom '\n\nIf the destination name used in explicit delivery mode is not in /etc/passwd,  procmail  will\nproceed as if explicit delivery mode was not in effect.  If not in explicit delivery mode and\nshould  the uid procmail is running under, have no corresponding /etc/passwd entry, then HOME\nwill default to /, LOGNAME will default to #uid, USERSHELL  will  default  to  /bin/sh,  and\nORGMAIL will default to /tmp/dead.letter.\n\nWhen  in  explicit  delivery  mode,  procmail will generate a leading `From ' line if none is\npresent.  If one is already present procmail will leave it intact.  If procmail  is  not  in‐\nvoked  with  one of the following user or group ids: root, daemon, uucp, mail, x400, network,\nlist, slist, lists or news, but still has to generate or accept a new `From ' line,  it  will\ngenerate an additional `>From ' line to help distinguish fake mails.\n\nFor  security  reasons  procmail  will only use an absolute or $HOME-relative rcfile if it is\nowned by the recipient or root, not world writable, and the directory it is contained  in  is\nnot  world  writable.   The $HOME/.procmailrc file has the additional constraint of not being\ngroup-writable or in a group-writable directory.\n\nIf /var/mail/$LOGNAME is a bogus mailbox (i.e., does not belong  to  the  recipient,  is  un‐\nwritable,  is a symbolic link or is a hard link), procmail will upon startup try to rename it\ninto a file starting with `BOGUS.$LOGNAME.' and ending in an  inode-sequence-code.   If  this\nturns out to be impossible, ORGMAIL will have no initial value, and hence will inhibit deliv‐\nery without a proper rcfile.\n\nIf  /var/mail/$LOGNAME  already  is a valid mailbox, but has got too loose permissions on it,\nprocmail will correct this.  To prevent procmail from doing this make sure  the  u+x  bit  is\nset.\n\nWhen  delivering  to directories, MH folders, or maildir folders, you don't need to use lock‐\nfiles to prevent several concurrently running procmail programs from messing up.\n\nDelivering to MH folders is slightly more time consuming than delivering to  normal  directo‐\nries  or  mailboxes, because procmail has to search for the next available number (instead of\nhaving the filename immediately available).\n\nOn general failure procmail will return EXCANTCREAT, unless option -t is specified, in which\ncase it will return EXTEMPFAIL.\n\nTo make `egrepping' of headers more consistent, procmail concatenates  all  continued  header\nfields; but only internally.  When delivering the mail, line breaks will appear as before.\n\nIf procmail is called under a name not starting with `procmail' (e.g., if it is linked to an‐\nother  name  and invoked as such), it comes up in explicit delivery mode, and expects the re‐\ncipients' names as command line arguments (as if -d had been specified).\n\nComsat/biff notifications are done using udp.  They are sent off once when procmail generates\nthe regular logfile entry.  The notification messages have the following extended format  (or\nas close as you can get when final delivery was not to a file):\n$LOGNAME@offsetofmessageinmailbox:absolutepathtomailbox\n\nWhenever  procmail itself opens a file to deliver to, it consistently uses the following ker‐\nnel locking strategies: fcntl(2).\n\nProcmail is NFS-resistant and eight-bit clean.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "Calling up procmail with the -h or -? options will cause it to display  a  command-line  help\nand recipe flag quick-reference page.\n\nThere  exists  an  excellent newbie FAQ about mailfilters (and procmail in particular); it is\nmaintained by Nancy McGough <nancym@ii.com> and can be obtained by sending a  mail  to  mail-\nserver@rtfm.mit.edu with the following in the body:\nsend usenet/news.answers/mail/filtering-faq\n\nIf procmail is not installed globally as the default mail delivery agent (ask your system ad‐\nministrator),  you have to make sure it is invoked when your mail arrives.  In this case your\n$HOME/.forward (beware, it has to be world readable) file should contain the line below.   Be\nsure  to  include  the  single and double quotes, and unless you know your site to be running\nsmrsh (the SendMail Restricted SHell), it must be an absolute path.\n\n\"|exec /usr/bin/procmail\"\n\nSome mailers (notably exim) do not currently accept the above syntax.  In such case use  this\ninstead:\n\n|/usr/bin/procmail\n\nProcmail  can  also  be invoked to postprocess an already filled system mailbox.  This can be\nuseful if you don't want to or can't use a $HOME/.forward file (in which case  the  following\nscript could periodically be called from within cron(1), or whenever you start reading mail):\n\n#!/bin/sh\n\nORGMAIL=/var/mail/$LOGNAME\n\nif cd $HOME &&\ntest -s $ORGMAIL &&\nlockfile -r0 -l1024 .newmail.lock 2>/dev/null\nthen\ntrap \"rm -f .newmail.lock\" 1 2 3 13 15\numask 077\nlockfile -l1024 -ml\ncat $ORGMAIL >>.newmail &&\ncat /dev/null >$ORGMAIL\nlockfile -mu\nformail -s procmail <.newmail &&\nrm -f .newmail\nrm -f .newmail.lock\nfi\nexit 0\n",
            "subsections": [
                {
                    "name": "A sample small $HOME/.procmailrc:",
                    "content": "PATH=/usr/local/bin:/usr/bin:/bin\nMAILDIR=$HOME/Mail      #you'd better make sure it exists\nDEFAULT=$MAILDIR/mbox   #completely optional\nLOGFILE=$MAILDIR/from   #recommended\n\n:0:\n* ^From.*berg\nfromme\n\n:0\n* ^Subject:.*Flame\n/dev/null\n\nOther examples for rcfile recipes can be looked up in the procmailex(5) man page.\n"
                }
            ]
        },
        "SOURCE": {
            "content": "This   program   is  part  of  the  procmail  mail-processing-package  (v3.24)  available  at\nhttp://www.procmail.org/ or ftp.procmail.org in pub/procmail/.\n",
            "subsections": []
        },
        "MAILINGLIST": {
            "content": "There exists a mailinglist for questions relating to any program in the procmail package:\n<procmail-users@procmail.org>\nfor submitting questions/answers.\n<procmail-users-request@procmail.org>\nfor subscription requests.\n\nIf you would like to stay informed about new versions and official patches send  a  subscrip‐\ntion request to\nprocmail-announce-request@procmail.org\n(this is a readonly list).\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Stephen R. van den Berg\n<srb@cuci.nl>\n\nBuGless                                   PROCMAIL(1)",
            "subsections": []
        }
    },
    "summary": "procmail - autonomous mail processor",
    "flags": [
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "except for the value of TZ. However, in any case: any default values will override any preexisting environment variables, i.e., procmail will not pay any attention to any pre‐ defined environment variables, it will happily overwrite them with its own defaults. For the list of environment variables that procmail will preset see the procmailrc(5) man page. If both -p and -m are specified, the list of preset environment variables shrinks to just: LOGNAME, HOME, SHELL, USERSHELL, ORGMAIL and MAILDIR."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "tinations you gave, the mail will not bounce, but will return to the mailqueue. Another delivery-attempt will be made at some time in the future."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Causes procmail to regenerate the leading `From ' line with fromwhom as the sender (in‐ stead of -f one could use the alternate and obsolete -r). If fromwhom consists merely of a single `-', then procmail will only update the timestamp on the `From ' line (if present, if not, it will generate a new one)."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-Y",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "This will set $1 to be equal to argument. Each succeeding -a argument will set the next number variable ($2, $3, etc). It can be used to pass meta information along to proc‐ mail. This is typically done by passing along the $@x information from the sendmail mailer rule."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "This turns on explicit delivery mode, delivery will be to the local user recipient. This, of course, only is possible if procmail has root privileges (or if procmail is al‐ ready running with the recipient's euid and egid). Procmail will setuid to the intended recipients and delivers the mail as if it were invoked by the recipient with no argu‐ ments (i.e., if no rcfile is found, delivery is like ordinary mail). This option is in‐ compatible with -p."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "specified on the command line. After the rcfile, procmail will accept an unlimited num‐ ber of arguments. If the rcfile is an absolute path starting with /etc/procmailrcs/ without backward references (i.e. the parent directory cannot be mentioned) procmail will, only if no security violations are found, take on the identity of the owner of the rcfile (or symbolic link). For some advanced usage of this option you should look in the EXAMPLES section below."
        }
    ],
    "examples": [
        "Examples for rcfile recipes can be looked up in the procmailex(5) man page.  A  small  sample",
        "rcfile can be found in the NOTES section below.",
        "Skip  the  rest of this EXAMPLES section unless you are a system administrator who is vaguely",
        "familiar with sendmail.cf syntax.",
        "The -m option is typically used when procmail is called from within a rule in the sendmail.cf",
        "file.  In order to be able to do this it is convenient to create an extra  `procmail'  mailer",
        "in  your  sendmail.cf  file  (in  addition to the perhaps already present `local' mailer that",
        "starts up procmail).  To create such a `procmail' mailer I'd suggest something like:",
        "Mprocmail, P=/usr/bin/procmail, F=mSDFMhun, S=11, R=21,",
        "A=procmail -m $h $g $u",
        "This enables you to use rules like the following (most likely in ruleset 0)  to  filter  mail",
        "through the procmail mailer (please note the leading tab to continue the rule, and the tab to",
        "separate the comments):",
        "R$*<@some.where>$*",
        "$#procmail $@/etc/procmailrcs/some.rc $:$1@some.where.procmail$2",
        "R$*<@$*.procmail>$*",
        "$1<@$2>$3       Already filtered, map back",
        "And /etc/procmailrcs/some.rc could be as simple as:",
        "SENDER = \"<$1>\"                 # fix for empty sender addresses",
        "SHIFT = 1                       # remove it from $@",
        ":0                              # sink all junk mail",
        "* ^Subject:.*junk",
        "/dev/null",
        ":0 w                            # pass along all other mail",
        "! -oi -f \"$SENDER\" \"$@\"",
        "Do  watch  out  when  sending mail from within the /etc/procmailrcs/some.rc file, if you send",
        "mail to addresses which match the first rule again, you could be  creating  an  endless  mail",
        "loop."
    ],
    "see_also": [
        {
            "name": "procmailrc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/procmailrc/5/json"
        },
        {
            "name": "procmailsc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/procmailsc/5/json"
        },
        {
            "name": "procmailex",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/procmailex/5/json"
        },
        {
            "name": "sh",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/sh/1/json"
        },
        {
            "name": "csh",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/csh/1/json"
        },
        {
            "name": "mail",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mail/1/json"
        },
        {
            "name": "mailx",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mailx/1/json"
        },
        {
            "name": "uucp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/uucp/1/json"
        },
        {
            "name": "aliases",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/aliases/5/json"
        },
        {
            "name": "sendmail",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sendmail/8/json"
        },
        {
            "name": "egrep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/egrep/1/json"
        },
        {
            "name": "grep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/grep/1/json"
        },
        {
            "name": "biff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/biff/1/json"
        },
        {
            "name": "comsat",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/comsat/8/json"
        },
        {
            "name": "lockfile",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/lockfile/1/json"
        },
        {
            "name": "formail",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/formail/1/json"
        },
        {
            "name": "cron",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/cron/1/json"
        }
    ]
}