{
    "content": [
        {
            "type": "text",
            "text": "# CLEANUP(8postfix) (man)\n\n**Summary:** cleanup - canonicalize and enqueue Postfix message\n\n**Synopsis:** cleanup [generic Postfix daemon options]\n\n## See Also\n\n- trivial-rewrite(8)\n- qmgr(8)\n- headerchecks(5)\n- bodychecks(5)\n- canonical(5)\n- virtual(5)\n- postconf(5)\n- master(5)\n- master(8)\n- postlogd(8)\n- syslogd(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (41 lines)\n- **STANDARDS** (8 lines)\n- **DIAGNOSTICS** (2 lines)\n- **BUGS** (3 lines)\n- **CONFIGURATION PARAMETERS** (6 lines)\n- **COMPATIBILITY CONTROLS** (28 lines)\n- **BUILT-IN CONTENT FILTERING CONTROLS** (40 lines)\n- **BEFORE QUEUE MILTER CONTROLS** (80 lines)\n- **MIME PROCESSING CONTROLS** (30 lines)\n- **AUTOMATIC BCC RECIPIENT CONTROLS** (14 lines)\n- **ADDRESS TRANSFORMATION CONTROLS** (59 lines)\n- **RESOURCE AND RATE CONTROLS** (47 lines)\n- **SMTPUTF8 CONTROLS** (14 lines)\n- **MISCELLANEOUS CONTROLS** (27 lines) — 2 subsections\n  - myhostname (see 'postconf -d' output) (2 lines)\n  - myorigin ($myhostname) (38 lines)\n- **FILES** (3 lines)\n- **SEE ALSO** (12 lines)\n- **README FILES** (4 lines)\n- **LICENSE** (16 lines)\n\n## Full Content\n\n### NAME\n\ncleanup - canonicalize and enqueue Postfix message\n\n### SYNOPSIS\n\ncleanup [generic Postfix daemon options]\n\n### DESCRIPTION\n\nThe  cleanup(8)  daemon  processes inbound mail, inserts it into the incoming mail queue, and\ninforms the queue manager of its arrival.\n\nThe cleanup(8) daemon performs the following transformations:\n\n•      Insert missing message headers: (Resent-) From:, To:, Message-Id:, and Date:.\nThis is enabled with the localheaderrewriteclients  and  alwaysaddmissingheaders\nparameter settings.\n\n•      Transform  envelope  and  header addresses to the standard user@fully-qualified-domain\nform that is expected by other Postfix programs.  This task depends on the trivial-re‐‐\nwrite(8) daemon.\nThe  header  transformation is enabled with the localheaderrewriteclients parameter\nsetting.\n\n•      Eliminate duplicate envelope recipient addresses.\nThis is enabled with the duplicatefilterlimit parameter setting.\n\n•      Remove message headers: Bcc, Content-Length, Resent-Bcc, Return-Path.\nThis is enabled with the messagedropheaders parameter setting.\n\n•      Optionally, rewrite all envelope and header addresses according to the mappings speci‐\nfied in the canonical(5) lookup tables.\nThe  header  transformation is enabled with the localheaderrewriteclients parameter\nsetting.\n\n•      Optionally, masquerade envelope sender addresses and message  header  addresses  (i.e.\nstrip  host  or  domain information below all domains listed in the masqueradedomains\nparameter, except for user names listed in masqueradeexceptions).   By  default,  ad‐\ndress masquerading does not affect envelope recipients.\nThe  header  transformation is enabled with the localheaderrewriteclients parameter\nsetting.\n\n•      Optionally, expand envelope recipients according to  information  found  in  the  vir‐‐\ntualaliasmaps lookup tables.\n\nThe  cleanup(8) daemon performs sanity checks on the content of each message. When it finds a\nproblem, by default it returns a diagnostic status to the cleanup service client, and  leaves\nit  up  to  the  client  to  deal with the problem. Alternatively, the client can request the\ncleanup(8) daemon to bounce the message back to the sender in case of trouble.\n\n### STANDARDS\n\nRFC 822 (ARPA Internet Text Messages)\nRFC 2045 (MIME: Format of Internet Message Bodies)\nRFC 2046 (MIME: Media Types)\nRFC 2822 (Internet Message Format)\nRFC 3463 (Enhanced Status Codes)\nRFC 3464 (Delivery status notifications)\nRFC 5322 (Internet Message Format)\n\n### DIAGNOSTICS\n\nProblems and transactions are logged to syslogd(8) or postlogd(8).\n\n### BUGS\n\nTable-driven rewriting rules make it hard to express if then else and other logical relation‐\nships.\n\n### CONFIGURATION PARAMETERS\n\nChanges  to  main.cf are picked up automatically, as cleanup(8) processes run for only a lim‐\nited amount of time. Use the command \"postfix reload\" to speed up a change.\n\nThe text below provides only a parameter summary. See postconf(5) for more details  including\nexamples.\n\n### COMPATIBILITY CONTROLS\n\nundisclosedrecipientsheader (see 'postconf -d' output)\nMessage  header  that the Postfix cleanup(8) server inserts when a message contains no\nTo: or Cc: message header.\n\nAvailable in Postfix version 2.1 only:\n\nenableerrorsto (no)\nReport mail delivery errors to the address specified with the non-standard  Errors-To:\nmessage  header,  instead of the envelope sender address (this feature is removed with\nPostfix version 2.2, is turned off by default with Postfix version 2.1, and is  always\nturned on with older Postfix versions).\n\nAvailable in Postfix version 2.6 and later:\n\nalwaysaddmissingheaders (no)\nAlways add (Resent-) From:, To:, Date: or Message-ID: headers when not present.\n\nAvailable in Postfix version 2.9 and later:\n\nenablelongqueueids (no)\nEnable long, non-repeating, queue IDs (queue file names).\n\nAvailable in Postfix version 3.0 and later:\n\nmessagedropheaders (bcc, content-length, resent-bcc, return-path)\nNames  of  message  headers  that  the  cleanup(8)  daemon  will remove after applying\nheaderchecks(5) and before invoking Milter applications.\n\n### BUILT-IN CONTENT FILTERING CONTROLS\n\nPostfix built-in content filtering is meant to stop a flood of worms or viruses. It is not  a\ngeneral content filter.\n\nbodychecks (empty)\nOptional  lookup tables for content inspection as specified in the bodychecks(5) man‐\nual page.\n\nheaderchecks (empty)\nOptional lookup tables for content inspection of primary non-MIME message headers,  as\nspecified in the headerchecks(5) manual page.\n\nAvailable in Postfix version 2.0 and later:\n\nbodycheckssizelimit (51200)\nHow  much  text  in  a  message body segment (or attachment, if you prefer to use that\nterm) is subjected to bodychecks inspection.\n\nmimeheaderchecks ($headerchecks)\nOptional lookup tables for content inspection of MIME related message headers, as  de‐\nscribed in the headerchecks(5) manual page.\n\nnestedheaderchecks ($headerchecks)\nOptional  lookup tables for content inspection of non-MIME message headers in attached\nmessages, as described in the headerchecks(5) manual page.\n\nAvailable in Postfix version 2.3 and later:\n\nmessagerejectcharacters (empty)\nThe set of characters that Postfix will reject in message content.\n\nmessagestripcharacters (empty)\nThe set of characters that Postfix will remove from message content.\n\nAvailable in Postfix version 3.9, 3.8.5, 3.7.10, 3.6.14, 3.5.24, and later:\n\ncleanupreplacestraycrlf (yes)\nReplace each stray <CR> or <LF> character in message content with a  space  character,\nto  prevent  outbound SMTP smuggling, and to make the evaluation of Postfix-added DKIM\nor other signatures independent from how a remote mail server handles such characters.\n\n### BEFORE QUEUE MILTER CONTROLS\n\nAs of version 2.3, Postfix supports the Sendmail version 8  Milter  (mail  filter)  protocol.\nWhen  mail  is not received via the smtpd(8) server, the cleanup(8) server will simulate SMTP\nevents to the extent that this is possible. For details see the MILTERREADME document.\n\nnonsmtpdmilters (empty)\nA list of Milter (mail filter) applications for new mail that does not arrive via  the\nPostfix smtpd(8) server.\n\nmilterprotocol (6)\nThe  mail  filter  protocol version and optional protocol extensions for communication\nwith a Milter application; prior to Postfix 2.6 the default protocol is 2.\n\nmilterdefaultaction (tempfail)\nThe default action when a Milter (mail filter) response is unavailable  (for  example,\nbad Postfix configuration or Milter failure).\n\nmiltermacrodaemonname ($myhostname)\nThe {daemonname} macro value for Milter (mail filter) applications.\n\nmiltermacrov ($mailname $mailversion)\nThe {v} macro value for Milter (mail filter) applications.\n\nmilterconnecttimeout (30s)\nThe time limit for connecting to a Milter (mail filter) application, and for negotiat‐\ning protocol options.\n\nmiltercommandtimeout (30s)\nThe time limit for sending an SMTP command to a Milter (mail filter) application,  and\nfor receiving the response.\n\nmiltercontenttimeout (300s)\nThe  time limit for sending message content to a Milter (mail filter) application, and\nfor receiving the response.\n\nmilterconnectmacros (see 'postconf -d' output)\nThe macros that are sent to Milter (mail filter) applications after completion  of  an\nSMTP connection.\n\nmilterhelomacros (see 'postconf -d' output)\nThe  macros  that are sent to Milter (mail filter) applications after the SMTP HELO or\nEHLO command.\n\nmiltermailmacros (see 'postconf -d' output)\nThe macros that are sent to Milter (mail filter) applications after the SMTP MAIL FROM\ncommand.\n\nmilterrcptmacros (see 'postconf -d' output)\nThe  macros  that are sent to Milter (mail filter) applications after the SMTP RCPT TO\ncommand.\n\nmilterdatamacros (see 'postconf -d' output)\nThe macros that are sent to version 4 or higher Milter (mail filter) applications  af‐\nter the SMTP DATA command.\n\nmilterunknowncommandmacros (see 'postconf -d' output)\nThe  macros that are sent to version 3 or higher Milter (mail filter) applications af‐\nter an unknown SMTP command.\n\nmilterendofdatamacros (see 'postconf -d' output)\nThe macros that are sent to  Milter  (mail  filter)  applications  after  the  message\nend-of-data.\n\nAvailable in Postfix version 2.5 and later:\n\nmilterendofheadermacros (see 'postconf -d' output)\nThe  macros  that  are  sent to Milter (mail filter) applications after the end of the\nmessage header.\n\nAvailable in Postfix version 2.7 and later:\n\nmilterheaderchecks (empty)\nOptional lookup tables for content inspection of message headers that are produced  by\nMilter applications.\n\nAvailable in Postfix version 3.1 and later:\n\nmiltermacrodefaults (empty)\nOptional  list  of  name=value  pairs that specify default values for arbitrary macros\nthat Postfix may send to Milter applications.\n\n### MIME PROCESSING CONTROLS\n\nAvailable in Postfix version 2.0 and later:\n\ndisablemimeinputprocessing (no)\nTurn off MIME processing while receiving mail.\n\nmimeboundarylengthlimit (2048)\nThe maximal length of MIME multipart boundary strings.\n\nmimenestinglimit (100)\nThe maximal recursion level that the MIME processor will handle.\n\nstrict8bitmime (no)\nEnable both strict7bitheaders and strict8bitmimebody.\n\nstrict7bitheaders (no)\nReject mail with 8-bit text in message headers.\n\nstrict8bitmimebody (no)\nReject 8-bit message body text without 8-bit MIME content encoding information.\n\nstrictmimeencodingdomain (no)\nReject mail with invalid Content-Transfer-Encoding: information for the  message/*  or\nmultipart/* MIME content types.\n\nAvailable in Postfix version 2.5 and later:\n\ndetect8bitencodingheader (yes)\nAutomatically  detect  8BITMIME  body content by looking at Content-Transfer-Encoding:\nmessage headers; historically, this behavior was hard-coded to be \"always on\".\n\n### AUTOMATIC BCC RECIPIENT CONTROLS\n\nPostfix can automatically add BCC (blind carbon copy) when mail enters the mail system:\n\nalwaysbcc (empty)\nOptional address that receives a \"blind carbon copy\" of each message that is  received\nby the Postfix mail system.\n\nAvailable in Postfix version 2.1 and later:\n\nsenderbccmaps (empty)\nOptional BCC (blind carbon-copy) address lookup tables, indexed by sender address.\n\nrecipientbccmaps (empty)\nOptional BCC (blind carbon-copy) address lookup tables, indexed by recipient address.\n\n### ADDRESS TRANSFORMATION CONTROLS\n\nAddress  rewriting  is delegated to the trivial-rewrite(8) daemon.  The cleanup(8) server im‐\nplements table driven address mapping.\n\nemptyaddressrecipient (MAILER-DAEMON)\nThe recipient of mail addressed to the null address.\n\ncanonicalmaps (empty)\nOptional address mapping lookup tables for message headers and envelopes.\n\nrecipientcanonicalmaps (empty)\nOptional address mapping lookup tables for envelope and header recipient addresses.\n\nsendercanonicalmaps (empty)\nOptional address mapping lookup tables for envelope and header sender addresses.\n\nmasqueradeclasses (envelopesender, headersender, headerrecipient)\nWhat addresses are subject to address masquerading.\n\nmasqueradedomains (empty)\nOptional list of domains whose subdomain structure will be stripped off in  email  ad‐\ndresses.\n\nmasqueradeexceptions (empty)\nOptional  list of user names that are not subjected to address masquerading, even when\ntheir addresses match $masqueradedomains.\n\npropagateunmatchedextensions (canonical, virtual)\nWhat address lookup tables copy an address extension from the lookup key to the lookup\nresult.\n\nAvailable before Postfix version 2.0:\n\nvirtualmaps (empty)\nOptional lookup tables with a) names of domains for which all addresses are aliased to\naddresses in other local or remote domains, and b) addresses that are aliased  to  ad‐\ndresses in other local or remote domains.\n\nAvailable in Postfix version 2.0 and later:\n\nvirtualaliasmaps ($virtualmaps)\nOptional lookup tables that alias specific mail addresses or domains to other local or\nremote address.\n\nAvailable in Postfix version 2.2 and later:\n\ncanonicalclasses (envelopesender, enveloperecipient, headersender, headerrecipient)\nWhat addresses are subject to canonicalmaps address mapping.\n\nrecipientcanonicalclasses (enveloperecipient, headerrecipient)\nWhat addresses are subject to recipientcanonicalmaps address mapping.\n\nsendercanonicalclasses (envelopesender, headersender)\nWhat addresses are subject to sendercanonicalmaps address mapping.\n\nremoteheaderrewritedomain (empty)\nDon't rewrite message headers from remote clients at all when this parameter is empty;\notherwise,  rewrite message headers and append the specified domain name to incomplete\naddresses.\n\n### RESOURCE AND RATE CONTROLS\n\nduplicatefilterlimit (1000)\nThe maximal number of  addresses  remembered  by  the  address  duplicate  filter  for\naliases(5) or virtual(5) alias expansion, or for showq(8) queue displays.\n\nheadersizelimit (102400)\nThe maximal amount of memory in bytes for storing a message header.\n\nhopcountlimit (50)\nThe  maximal  number of Received:  message headers that is allowed in the primary mes‐\nsage headers.\n\ninflowdelay (1s)\nTime to pause before accepting a new message, when the message  arrival  rate  exceeds\nthe message delivery rate.\n\nmessagesizelimit (10240000)\nThe maximal size in bytes of a message, including envelope information.\n\nAvailable in Postfix version 2.0 and later:\n\nheaderaddresstokenlimit (10240)\nThe maximal number of address tokens are allowed in an address message header.\n\nmimeboundarylengthlimit (2048)\nThe maximal length of MIME multipart boundary strings.\n\nmimenestinglimit (100)\nThe maximal recursion level that the MIME processor will handle.\n\nqueuefileattributecountlimit (100)\nThe  maximal  number  of (name=value) attributes that may be stored in a Postfix queue\nfile.\n\nAvailable in Postfix version 2.1 and later:\n\nvirtualaliasexpansionlimit (1000)\nThe maximal number of addresses that virtual alias expansion produces from each origi‐\nnal recipient.\n\nvirtualaliasrecursionlimit (1000)\nThe maximal nesting depth of virtual alias expansion.\n\nAvailable in Postfix version 3.0 and later:\n\nvirtualaliasaddresslengthlimit (1000)\nThe maximal length of an email address after virtual alias expansion.\n\n### SMTPUTF8 CONTROLS\n\nPreliminary SMTPUTF8 support is introduced with Postfix 3.0.\n\nsmtputf8enable (yes)\nEnable preliminary SMTPUTF8 support for the protocols described in RFC 6531..6533.\n\nsmtputf8autodetectclasses (sendmail, verify)\nDetect that a message requires SMTPUTF8 support for the specified mail origin classes.\n\nAvailable in Postfix version 3.2 and later:\n\nenableidna2003compatibility (no)\nEnable  'transitional'  compatibility  between  IDNA2003 and IDNA2008, when converting\nUTF-8 domain names to/from the ASCII form that is used for DNS lookups.\n\n### MISCELLANEOUS CONTROLS\n\nconfigdirectory (see 'postconf -d' output)\nThe default location of the Postfix main.cf and master.cf configuration files.\n\ndaemontimeout (18000s)\nHow much time a Postfix daemon process may take to handle a request before it is  ter‐\nminated by a built-in watchdog timer.\n\ndelayloggingresolutionlimit (2)\nThe  maximal  number  of  digits after the decimal point when logging sub-second delay\nvalues.\n\ndelaywarningtime (0h)\nThe time after which the sender receives a copy of the message headers of mail that is\nstill queued.\n\nipctimeout (3600s)\nThe  time  limit  for  sending or receiving information over an internal communication\nchannel.\n\nmaxidle (100s)\nThe maximum amount of time that an idle Postfix daemon process waits for  an  incoming\nconnection before terminating voluntarily.\n\nmaxuse (100)\nThe  maximal number of incoming connections that a Postfix daemon process will service\nbefore terminating voluntarily.\n\n#### myhostname (see 'postconf -d' output)\n\nThe internet hostname of this mail system.\n\n#### myorigin ($myhostname)\n\nThe domain name that locally-posted mail appears to come from, and that locally posted\nmail is delivered to.\n\nprocessid (read-only)\nThe process ID of a Postfix command or daemon process.\n\nprocessname (read-only)\nThe process name of a Postfix command or daemon process.\n\nqueuedirectory (see 'postconf -d' output)\nThe location of the Postfix top-level queue directory.\n\nsoftbounce (no)\nSafety net to keep mail queued that would otherwise be returned to the sender.\n\nsyslogfacility (mail)\nThe syslog facility of Postfix logging.\n\nsyslogname (see 'postconf -d' output)\nA  prefix  that is prepended to the process name in syslog records, so that, for exam‐\nple, \"smtpd\" becomes \"prefix/smtpd\".\n\nAvailable in Postfix version 2.1 and later:\n\nenableoriginalrecipient (yes)\nEnable support for the original recipient address after an address is rewritten  to  a\ndifferent address (for example with aliasing or with canonical mapping).\n\nAvailable in Postfix 3.3 and later:\n\nservicename (read-only)\nThe master.cf service name of a Postfix daemon process.\n\nAvailable in Postfix 3.5 and later:\n\ninfologaddressformat (external)\nThe email address form that will be used in non-debug logging (info, warning, etc.).\n\n### FILES\n\n/etc/postfix/canonical*, canonical mapping table\n/etc/postfix/virtual*, virtual mapping table\n\n### SEE ALSO\n\ntrivial-rewrite(8), address rewriting\nqmgr(8), queue manager\nheaderchecks(5), message header content inspection\nbodychecks(5), body parts content inspection\ncanonical(5), canonical address lookup table format\nvirtual(5), virtual alias lookup table format\npostconf(5), configuration parameters\nmaster(5), generic daemon options\nmaster(8), process manager\npostlogd(8), Postfix logging\nsyslogd(8), system logging\n\n### README FILES\n\nUse \"postconf readmedirectory\" or \"postconf htmldirectory\" to locate this information.\nADDRESSREWRITINGREADME Postfix address manipulation\nCONTENTINSPECTIONREADME content inspection\n\n### LICENSE\n\nThe Secure Mailer license must be distributed with this software.\n\nAUTHOR(S)\nWietse Venema\nIBM T.J. Watson Research\nP.O. Box 704\nYorktown Heights, NY 10598, USA\n\nWietse Venema\nGoogle, Inc.\n111 8th Avenue\nNew York, NY 10011, USA\n\n\n\nCLEANUP(8postfix)\n\n"
        }
    ],
    "structuredContent": {
        "command": "CLEANUP",
        "section": "8postfix",
        "mode": "man",
        "summary": "cleanup - canonicalize and enqueue Postfix message",
        "synopsis": "cleanup [generic Postfix daemon options]",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "trivial-rewrite",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/trivial-rewrite/8/json"
            },
            {
                "name": "qmgr",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/qmgr/8/json"
            },
            {
                "name": "headerchecks",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/headerchecks/5/json"
            },
            {
                "name": "bodychecks",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/bodychecks/5/json"
            },
            {
                "name": "canonical",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/canonical/5/json"
            },
            {
                "name": "virtual",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/virtual/5/json"
            },
            {
                "name": "postconf",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/postconf/5/json"
            },
            {
                "name": "master",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/master/5/json"
            },
            {
                "name": "master",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/master/8/json"
            },
            {
                "name": "postlogd",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/postlogd/8/json"
            },
            {
                "name": "syslogd",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/syslogd/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 41,
                "subsections": []
            },
            {
                "name": "STANDARDS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "CONFIGURATION PARAMETERS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY CONTROLS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "BUILT-IN CONTENT FILTERING CONTROLS",
                "lines": 40,
                "subsections": []
            },
            {
                "name": "BEFORE QUEUE MILTER CONTROLS",
                "lines": 80,
                "subsections": []
            },
            {
                "name": "MIME PROCESSING CONTROLS",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "AUTOMATIC BCC RECIPIENT CONTROLS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "ADDRESS TRANSFORMATION CONTROLS",
                "lines": 59,
                "subsections": []
            },
            {
                "name": "RESOURCE AND RATE CONTROLS",
                "lines": 47,
                "subsections": []
            },
            {
                "name": "SMTPUTF8 CONTROLS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "MISCELLANEOUS CONTROLS",
                "lines": 27,
                "subsections": [
                    {
                        "name": "myhostname (see 'postconf -d' output)",
                        "lines": 2
                    },
                    {
                        "name": "myorigin ($myhostname)",
                        "lines": 38
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "README FILES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 16,
                "subsections": []
            }
        ]
    }
}