cleanup - canonicalize and enqueue Postfix message
cleanup [generic Postfix daemon options]
The cleanup(8) daemon processes inbound mail, inserts it
into the incoming mail queue, and informs the queue manager of its
arrival.
The cleanup(8) daemon always performs the following
transformations:
- Insert missing message headers: (Resent-) From:, To:,
Message-Id:, and Date:.
- Transform envelope and header addresses to the standard
user@fully-qualified-domain form that is expected by other Postfix
programs. This task is delegated to the trivial-rewrite(8)
daemon.
- Eliminate duplicate envelope recipient addresses.
- Remove message headers: Bcc, Content-Length,
Resent-Bcc, Return-Path.
The following address transformations are optional:
- Optionally, rewrite all envelope and header addresses according to the
mappings specified in the canonical(5) lookup tables.
- Optionally, masquerade envelope sender addresses and message header
addresses (i.e. strip host or domain information below all domains listed
in the masquerade_domains parameter, except for user names listed
in masquerade_exceptions). By default, address masquerading does
not affect envelope recipients.
- Optionally, expand envelope recipients according to information found in
the virtual(5) lookup tables.
The cleanup(8) daemon performs sanity checks on the content
of each message. When it finds a problem, by default it returns a diagnostic
status to the client, and leaves it up to the client to deal with the
problem. Alternatively, the client can request the cleanup(8) daemon
to bounce the message back to the sender in case of trouble.
RFC 822 (ARPA Internet Text Messages)
RFC 2045 (MIME: Format of Internet Message Bodies)
RFC 2046 (MIME: Media Types)
RFC 2822 (Internet Message Format)
RFC 3463 (Enhanced Status Codes)
RFC 3464 (Delivery status notifications)
RFC 5322 (Internet Message Format)
Problems and transactions are logged to syslogd(8).
Table-driven rewriting rules make it hard to express if
then else and other logical relationships.
Changes to main.cf are picked up automatically, as
cleanup(8) processes run for only a limited amount of time. Use the
command "postfix reload" to speed up a change.
The text below provides only a parameter summary. See
postconf(5) for more details including examples.
- Message header that the Postfix cleanup(8) server inserts when a
message contains no To: or Cc: message header.
Available in Postfix version 2.1 only:
- enable_errors_to
(no)
- Report mail delivery errors to the address specified with the non-standard
Errors-To: message header, instead of the envelope sender address (this
feature is removed with Postfix version 2.2, is turned off by default with
Postfix version 2.1, and is always turned on with older Postfix
versions).
Available in Postfix version 2.6 and later:
- Always add (Resent-) From:, To:, Date: or Message-ID: headers when not
present.
Available in Postfix version 2.9 and later:
- enable_long_queue_ids
(no)
- Enable long, non-repeating, queue IDs (queue file names).
Available in Postfix version 3.0 and later:
- Names of message headers that the cleanup(8) daemon will remove
after applying header_checks(5) and before invoking Milter
applications.
Postfix built-in content filtering is meant to stop a flood of
worms or viruses. It is not a general content filter.
- body_checks
(empty)
- Optional lookup tables for content inspection as specified in the
body_checks(5) manual page.
- Optional lookup tables for content inspection of primary non-MIME message
headers, as specified in the header_checks(5) manual page.
Available in Postfix version 2.0 and later:
- body_checks_size_limit
(51200)
- How much text in a message body segment (or attachment, if you prefer to
use that term) is subjected to body_checks inspection.
- Optional lookup tables for content inspection of MIME related message
headers, as described in the header_checks(5) manual page.
- Optional lookup tables for content inspection of non-MIME message headers
in attached messages, as described in the header_checks(5) manual
page.
Available in Postfix version 2.3 and later:
- message_reject_characters
(empty)
- The set of characters that Postfix will reject in message content.
- message_strip_characters
(empty)
- The set of characters that Postfix will remove from message content.
Available in Postfix version 2.0 and later:
- disable_mime_input_processing
(no)
- Turn off MIME processing while receiving mail.
- mime_boundary_length_limit
(2048)
- The maximal length of MIME multipart boundary strings.
- mime_nesting_limit
(100)
- The maximal recursion level that the MIME processor will handle.
- strict_8bitmime
(no)
- Enable both strict_7bit_headers and strict_8bitmime_body.
- Reject mail with 8-bit text in message headers.
- strict_8bitmime_body
(no)
- Reject 8-bit message body text without 8-bit MIME content encoding
information.
- strict_mime_encoding_domain
(no)
- Reject mail with invalid Content-Transfer-Encoding: information for the
message/* or multipart/* MIME content types.
Available in Postfix version 2.5 and later:
- Automatically detect 8BITMIME body content by looking at
Content-Transfer-Encoding: message headers; historically, this behavior
was hard-coded to be "always on".
Postfix can automatically add BCC (blind carbon copy) when mail
enters the mail system:
- always_bcc
(empty)
- Optional address that receives a "blind carbon copy" of each
message that is received by the Postfix mail system.
Available in Postfix version 2.1 and later:
- sender_bcc_maps
(empty)
- Optional BCC (blind carbon-copy) address lookup tables, indexed by sender
address.
- recipient_bcc_maps
(empty)
- Optional BCC (blind carbon-copy) address lookup tables, indexed by
recipient address.
Address rewriting is delegated to the trivial-rewrite(8)
daemon. The cleanup(8) server implements table driven address
mapping.
- empty_address_recipient
(MAILER-DAEMON)
- The recipient of mail addressed to the null address.
- canonical_maps
(empty)
- Optional address mapping lookup tables for message headers and
envelopes.
- recipient_canonical_maps
(empty)
- Optional address mapping lookup tables for envelope and header recipient
addresses.
- sender_canonical_maps
(empty)
- Optional address mapping lookup tables for envelope and header sender
addresses.
- masquerade_classes
(envelope_sender, header_sender, header_recipient)
- What addresses are subject to address masquerading.
- masquerade_domains
(empty)
- Optional list of domains whose subdomain structure will be stripped off in
email addresses.
- masquerade_exceptions
(empty)
- Optional list of user names that are not subjected to address
masquerading, even when their address matches $masquerade_domains.
- propagate_unmatched_extensions
(canonical, virtual)
- What address lookup tables copy an address extension from the lookup key
to the lookup result.
Available before Postfix version 2.0:
- virtual_maps
(empty)
- Optional lookup tables with a) names of domains for which all addresses
are aliased to addresses in other local or remote domains, and b)
addresses that are aliased to addresses in other local or remote
domains.
Available in Postfix version 2.0 and later:
- virtual_alias_maps
($virtual_maps)
- Optional lookup tables that alias specific mail addresses or domains to
other local or remote address.
Available in Postfix version 2.2 and later:
- canonical_classes
(envelope_sender, envelope_recipient, header_sender,
header_recipient)
- What addresses are subject to canonical_maps address mapping.
- recipient_canonical_classes
(envelope_recipient, header_recipient)
- What addresses are subject to recipient_canonical_maps address
mapping.
- sender_canonical_classes
(envelope_sender, header_sender)
- What addresses are subject to sender_canonical_maps address mapping.
- remote_header_rewrite_domain
(empty)
- Don't rewrite message headers from remote clients at all when this
parameter is empty; otherwise, rewrite message headers and append the
specified domain name to incomplete addresses.
Preliminary SMTPUTF8 support is introduced with Postfix 3.0.
- smtputf8_enable
(yes)
- Enable preliminary SMTPUTF8 support for the protocols described in RFC
6531..6533.
- smtputf8_autodetect_classes
(sendmail, verify)
- Detect that a message requires SMTPUTF8 support for the specified mail
origin classes.
Available in Postfix version 3.2 and later:
- enable_idna2003_compatibility
(no)
- Enable 'transitional' compatibility between IDNA2003 and IDNA2008, when
converting UTF-8 domain names to/from the ASCII form that is used for DNS
lookups.
/etc/postfix/canonical*, canonical mapping table
/etc/postfix/virtual*, virtual mapping table
trivial-rewrite(8), address rewriting
qmgr(8), queue manager
header_checks(5), message header content inspection
body_checks(5), body parts content inspection
canonical(5), canonical address lookup table format
virtual(5), virtual alias lookup table format
postconf(5), configuration parameters
master(5), generic daemon options
master(8), process manager
syslogd(8), system logging
Use "postconf readme_directory" or
"postconf html_directory" to locate this information.
ADDRESS_REWRITING_README Postfix address manipulation
CONTENT_INSPECTION_README content inspection
The Secure Mailer license must be distributed with this
software.
Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA