NAME

cleanup - canonicalize and enqueue Postfix message

SYNOPSIS


cclleeaannuupp [generic Postfix daemon options]

DESCRIPTION

The cclleeaannuupp(8) daemon processes inbound mail, inserts it into the iinnccoommiinngg mail queue, and informs the queue manager of its arrival.

The cclleeaannuupp(8) daemon always performs the following transformations:

· Insert missing message headers: (RReesseenntt--) FFrroomm::,
TToo::, MMeessssaaggee--IIdd::, and DDaattee::.
· Transform envelope and header addresses to the standard
_u_s_e_r_@_f_u_l_l_y_-_q_u_a_l_i_f_i_e_d_-_d_o_m_a_i_n form that is expected by other Postfix programs. This task is delegated to the ttrriivviiaall--rreewwrriittee(8) daemon.
· Eliminate duplicate envelope recipient addresses.

The following address transformations are optional:

· Optionally, rewrite all envelope and header addresses according
to the mappings specified in the ccaannoonniiccaall(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 mmaassqquueerraaddee__ddoommaaiinnss parameter, except for user names listed in mmaassqquueerraaddee__eexxcceeppttiioonnss). By default, address masquerading does not affect envelope recipients.
· Optionally, expand envelope recipients according to information
found in the vviirrttuuaall(5) lookup tables.

The cclleeaannuupp(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 cclleeaannuupp(8) daemon to bounce the message back to the sender in case of trouble.

STANDARDS


RFC 822 (ARPA Internet Text Messages)
RFC 2045 (MIME: Format of Internet Message Bodies)
RFC 2046 (MIME: Media Types)
RFC 3463 (Enhanced Status Codes)
RFC 3464 (Delivery status notifications)

DIAGNOSTICS

Problems and transactions are logged to ssyyssllooggdd(8).

BUGS

Table-driven rewriting rules make it hard to express iiff tthheenn eellssee and other logical relationships.

CONFIGURATION PARAMETERS



Changes to mmaaiinn..ccff are picked up automatically, as
cclleeaannuupp(8)
processes run for only a limited amount of time. Use the command
"ppoossttffiixx rreellooaadd" to speed up a change.
        

The text below provides only a parameter summary. See ppoossttccoonnff(5) for more details including examples.

COMPATIBILITY CONTROLS



uunnddiisscclloosseedd__rreecciippiieennttss__hheeaaddeerr ((TToo:: uunnddiisscclloosseedd--rreecciippiieennttss::;;)) Message header that the Postfix cclleeaannuupp(8) server inserts when a
message contains no To: or Cc: message header.

Available in Postfix version 2.1 only:

eennaabbllee__eerrrroorrss__ttoo ((nnoo)) 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:

aallwwaayyss__aadddd__mmiissssiinngg__hheeaaddeerrss ((nnoo)) Always add (Resent-) From:, To:, Date: or Message-ID: headers
when not present.

BUILT-IN CONTENT FILTERING CONTROLS



Postfix built-in content filtering is meant to stop a flood of
worms or viruses. It is not a general content filter.
bbooddyy__cchheecckkss ((eemmppttyy)) Optional lookup tables for content inspection as specified in
the bbooddyy__cchheecckkss(5) manual page.
hheeaaddeerr__cchheecckkss ((eemmppttyy)) Optional lookup tables for content inspection of primary non-MIME
message headers, as specified in the hheeaaddeerr__cchheecckkss(5) manual page.

Available in Postfix version 2.0 and later:

bbooddyy__cchheecckkss__ssiizzee__lliimmiitt ((5511220000)) How much text in a message body segment (or attachment, if you
prefer to use that term) is subjected to body_checks inspection.
mmiimmee__hheeaaddeerr__cchheecckkss (($$hheeaaddeerr__cchheecckkss)) Optional lookup tables for content inspection of MIME related
message headers, as described in the hheeaaddeerr__cchheecckkss(5) manual page.
nneesstteedd__hheeaaddeerr__cchheecckkss (($$hheeaaddeerr__cchheecckkss)) Optional lookup tables for content inspection of non-MIME message
headers in attached messages, as described in the hheeaaddeerr__cchheecckkss(5) manual page.

Available in Postfix version 2.3 and later:

mmeessssaaggee__rreejjeecctt__cchhaarraacctteerrss ((eemmppttyy)) The set of characters that Postfix will reject in message
content.
mmeessssaaggee__ssttrriipp__cchhaarraacctteerrss ((eemmppttyy)) The set of characters that Postfix will remove from message
content.

BEFORE QUEUE MILTER CONTROLS



As of version 2.3, Postfix supports the Sendmail version 8
Milter (mail filter) protocol. When mail is not received via
the smtpd(8) server, the cleanup(8) server will simulate
SMTP events to the extent that this is possible. For details
see the MILTER_README document.
nnoonn__ssmmttppdd__mmiilltteerrss ((eemmppttyy)) A list of Milter (mail filter) applications for new mail that
does not arrive via the Postfix ssmmttppdd(8) server.
mmiilltteerr__pprroottooccooll ((66)) The mail filter protocol version and optional protocol extensions
for communication with a Milter application; prior to Postfix 2.6 the default protocol is 2.
mmiilltteerr__ddeeffaauulltt__aaccttiioonn ((tteemmppffaaiill)) The default action when a Milter (mail filter) application is
unavailable or mis-configured.
mmiilltteerr__mmaaccrroo__ddaaeemmoonn__nnaammee (($$mmyyhhoossttnnaammee)) The {daemon_name} macro value for Milter (mail filter) applications.
mmiilltteerr__mmaaccrroo__vv (($$mmaaiill__nnaammee $$mmaaiill__vveerrssiioonn)) The {v} macro value for Milter (mail filter) applications.
mmiilltteerr__ccoonnnneecctt__ttiimmeeoouutt ((3300ss)) The time limit for connecting to a Milter (mail filter)
application, and for negotiating protocol options.
mmiilltteerr__ccoommmmaanndd__ttiimmeeoouutt ((3300ss)) The time limit for sending an SMTP command to a Milter (mail
filter) application, and for receiving the response.
mmiilltteerr__ccoonntteenntt__ttiimmeeoouutt ((330000ss)) The time limit for sending message content to a Milter (mail
filter) application, and for receiving the response.
mmiilltteerr__ccoonnnneecctt__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to Milter (mail filter) applications
after completion of an SMTP connection.
mmiilltteerr__hheelloo__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to Milter (mail filter) applications
after the SMTP HELO or EHLO command.
mmiilltteerr__mmaaiill__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to Milter (mail filter) applications
after the SMTP MAIL FROM command.
mmiilltteerr__rrccpptt__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to Milter (mail filter) applications
after the SMTP RCPT TO command.
mmiilltteerr__ddaattaa__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to version 4 or higher Milter (mail
filter) applications after the SMTP DATA command.
mmiilltteerr__uunnkknnoowwnn__ccoommmmaanndd__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to version 3 or higher Milter (mail
filter) applications after an unknown SMTP command.
mmiilltteerr__eenndd__ooff__ddaattaa__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to Milter (mail filter) applications
after the message end-of-data.

Available in Postfix version 2.5 and later:

mmiilltteerr__eenndd__ooff__hheeaaddeerr__mmaaccrrooss ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The macros that are sent to Milter (mail filter) applications
after the end of the message header.

MIME PROCESSING CONTROLS



Available in Postfix version 2.0 and later:
ddiissaabbllee__mmiimmee__iinnppuutt__pprroocceessssiinngg ((nnoo)) Turn off MIME processing while receiving mail.
mmiimmee__bboouunnddaarryy__lleennggtthh__lliimmiitt ((22004488)) The maximal length of MIME multipart boundary strings.
mmiimmee__nneessttiinngg__lliimmiitt ((110000)) The maximal recursion level that the MIME processor will handle.
ssttrriicctt__88bbiittmmiimmee ((nnoo)) Enable both strict_7bit_headers and strict_8bitmime_body.
ssttrriicctt__77bbiitt__hheeaaddeerrss ((nnoo)) Reject mail with 8-bit text in message headers.
ssttrriicctt__88bbiittmmiimmee__bbooddyy ((nnoo)) Reject 8-bit message body text without 8-bit MIME content encoding
information.
ssttrriicctt__mmiimmee__eennccooddiinngg__ddoommaaiinn ((nnoo)) Reject mail with invalid Content-Transfer-Encoding: information
for the message/* or multipart/* MIME content types.

Available in Postfix version 2.5 and later:

ddeetteecctt__88bbiitt__eennccooddiinngg__hheeaaddeerr ((yyeess)) Automatically detect 8BITMIME body content by looking at
Content-Transfer-Encoding: message headers; historically, this behavior was hard-coded to be "always on".

AUTOMATIC BCC RECIPIENT CONTROLS



Postfix can automatically add BCC (blind carbon copy)
when mail enters the mail system:
aallwwaayyss__bbcccc ((eemmppttyy)) 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:

sseennddeerr__bbcccc__mmaappss ((eemmppttyy)) Optional BCC (blind carbon-copy) address lookup tables, indexed
by sender address.
rreecciippiieenntt__bbcccc__mmaappss ((eemmppttyy)) Optional BCC (blind carbon-copy) address lookup tables, indexed by
recipient address.

ADDRESS TRANSFORMATION CONTROLS



Address rewriting is delegated to the ttrriivviiaall--rreewwrriittee(8) daemon.
The cclleeaannuupp(8) server implements table driven address mapping.
eemmppttyy__aaddddrreessss__rreecciippiieenntt ((MMAAIILLEERR--DDAAEEMMOONN)) The recipient of mail addressed to the null address.
ccaannoonniiccaall__mmaappss ((eemmppttyy)) Optional address mapping lookup tables for message headers and
envelopes.
rreecciippiieenntt__ccaannoonniiccaall__mmaappss ((eemmppttyy)) Optional address mapping lookup tables for envelope and header
recipient addresses.
sseennddeerr__ccaannoonniiccaall__mmaappss ((eemmppttyy)) Optional address mapping lookup tables for envelope and header
sender addresses.
mmaassqquueerraaddee__ccllaasssseess ((eennvveellooppee__sseennddeerr,, hheeaaddeerr__sseennddeerr,, hheeaaddeerr__rreecciippiieenntt)) What addresses are subject to address masquerading.
mmaassqquueerraaddee__ddoommaaiinnss ((eemmppttyy)) Optional list of domains whose subdomain structure will be stripped
off in email addresses.
mmaassqquueerraaddee__eexxcceeppttiioonnss ((eemmppttyy)) Optional list of user names that are not subjected to address
masquerading, even when their address matches $masquerade_domains.
pprrooppaaggaattee__uunnmmaattcchheedd__eexxtteennssiioonnss ((ccaannoonniiccaall,, vviirrttuuaall)) What address lookup tables copy an address extension from the lookup
key to the lookup result.

Available before Postfix version 2.0:

vviirrttuuaall__mmaappss ((eemmppttyy)) 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:

vviirrttuuaall__aalliiaass__mmaappss (($$vviirrttuuaall__mmaappss)) Optional lookup tables that alias specific mail addresses or domains
to other local or remote address.

Available in Postfix version 2.2 and later:

ccaannoonniiccaall__ccllaasssseess ((eennvveellooppee__sseennddeerr,, eennvveellooppee__rreecciippiieenntt,, hheeaaddeerr__sseennddeerr,, hheeaaddeerr__rreecciippiieenntt)) What addresses are subject to canonical_maps address mapping.
rreecciippiieenntt__ccaannoonniiccaall__ccllaasssseess ((eennvveellooppee__rreecciippiieenntt,, hheeaaddeerr__rreecciippiieenntt)) What addresses are subject to recipient_canonical_maps address
mapping.
sseennddeerr__ccaannoonniiccaall__ccllaasssseess ((eennvveellooppee__sseennddeerr,, hheeaaddeerr__sseennddeerr)) What addresses are subject to sender_canonical_maps address
mapping.
rreemmoottee__hheeaaddeerr__rreewwrriittee__ddoommaaiinn ((eemmppttyy)) 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.

RESOURCE AND RATE CONTROLS



dduupplliiccaattee__ffiilltteerr__lliimmiitt ((11000000)) The maximal number of addresses remembered by the address
duplicate filter for aalliiaasseess(5) or vviirrttuuaall(5) alias expansion, or for sshhoowwqq(8) queue displays.
hheeaaddeerr__ssiizzee__lliimmiitt ((110022440000)) The maximal amount of memory in bytes for storing a message header.
hhooppccoouunntt__lliimmiitt ((5500)) The maximal number of Received: message headers that is allowed
in the primary message headers.
iinn__ffllooww__ddeellaayy ((11ss)) Time to pause before accepting a new message, when the message
arrival rate exceeds the message delivery rate.
mmeessssaaggee__ssiizzee__lliimmiitt ((1100224400000000)) The maximal size in bytes of a message, including envelope information.

Available in Postfix version 2.0 and later:

hheeaaddeerr__aaddddrreessss__ttookkeenn__lliimmiitt ((1100224400)) The maximal number of address tokens are allowed in an address
message header.
mmiimmee__bboouunnddaarryy__lleennggtthh__lliimmiitt ((22004488)) The maximal length of MIME multipart boundary strings.
mmiimmee__nneessttiinngg__lliimmiitt ((110000)) The maximal recursion level that the MIME processor will handle.
qquueeuuee__ffiillee__aattttrriibbuuttee__ccoouunntt__lliimmiitt ((110000)) The maximal number of (name=value) attributes that may be stored
in a Postfix queue file.

Available in Postfix version 2.1 and later:

vviirrttuuaall__aalliiaass__eexxppaannssiioonn__lliimmiitt ((11000000)) The maximal number of addresses that virtual alias expansion produces
from each original recipient.
vviirrttuuaall__aalliiaass__rreeccuurrssiioonn__lliimmiitt ((11000000)) The maximal nesting depth of virtual alias expansion.

MISCELLANEOUS CONTROLS



ccoonnffiigg__ddiirreeccttoorryy ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The default location of the Postfix main.cf and master.cf
configuration files.
ddaaeemmoonn__ttiimmeeoouutt ((1188000000ss)) How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
ddeellaayy__llooggggiinngg__rreessoolluuttiioonn__lliimmiitt ((22)) The maximal number of digits after the decimal point when logging
sub-second delay values.
ddeellaayy__wwaarrnniinngg__ttiimmee ((00hh)) The time after which the sender receives the message headers of
mail that is still queued.
iippcc__ttiimmeeoouutt ((33660000ss)) The time limit for sending or receiving information over an internal
communication channel.
mmaaxx__iiddllee ((110000ss)) The maximum amount of time that an idle Postfix daemon process waits
for an incoming connection before terminating voluntarily.
mmaaxx__uussee ((110000)) The maximal number of incoming connections that a Postfix daemon
process will service before terminating voluntarily.
mmyyhhoossttnnaammee ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The internet hostname of this mail system.
mmyyoorriiggiinn (($$mmyyhhoossttnnaammee)) The domain name that locally-posted mail appears to come
from, and that locally posted mail is delivered to.
pprroocceessss__iidd ((rreeaadd--oonnllyy)) The process ID of a Postfix command or daemon process.
pprroocceessss__nnaammee ((rreeaadd--oonnllyy)) The process name of a Postfix command or daemon process.
qquueeuuee__ddiirreeccttoorryy ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The location of the Postfix top-level queue directory.
ssoofftt__bboouunnccee ((nnoo)) Safety net to keep mail queued that would otherwise be returned to
the sender.
ssyysslloogg__ffaacciilliittyy ((mmaaiill)) The syslog facility of Postfix logging.
ssyysslloogg__nnaammee ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The mail system name that is prepended to the process name in syslog
records, so that "smtpd" becomes, for example, "postfix/smtpd".

Available in Postfix version 2.1 and later:

eennaabbllee__oorriiggiinnaall__rreecciippiieenntt ((yyeess)) Enable support for the X-Original-To message header.

FILES


/etc/postfix/canonical*, canonical mapping table
/etc/postfix/virtual*, virtual mapping table

SEE ALSO


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

README FILES



Use "ppoossttccoonnff rreeaaddmmee__ddiirreeccttoorryy" or
"ppoossttccoonnff hhttmmll__ddiirreeccttoorryy" to locate this information.

ADDRESS_REWRITING_README Postfix address manipulation
CONTENT_INSPECTION_README content inspection

LICENSE



The Secure Mailer license must be distributed with this software.

AUTHOR(S)


Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA