msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
Robustness: make_dirs() now continues when a missing
directory is created by another process.
+20000720
+
+ Feature: the queue manager now logs the number of recipients
+ when opening a queue file (a zero recipient count is logged
+ with older queue files). File: global/opened.c.
+
20000726
Robustness: added watchdog_pat() routine to keep the watchdog
20000821
- Feature: added -r (replace) option to postalias and postmap.
+ Feature: added -r (replace key+value) option to postalias
+ and postmap.
Cleanup: smtpd now replies with 555 when the client sends
unrecognized RCPT TO parameters, as required by RFC 1869
client or sender until we have completed some investigation,
after which we will either reject or accept.
+ However, the code is turned off because it is not finished.
+
20000905
Robustness: the dns client now rejects malformed domain
Convenience: INSTALL.sh now imports default settings from
the process environment, in order to make scripting easier.
+ Portability: INSTALL.sh now systematically skips over CVS,
+ RCS and SCCS cruft.
+
Portability: another fix for NEXTSTEP (Masaki MURASE).
File: util/spawn_command.h.
+
+20000920
+
+ Cleanup: in a transport table entry, do not ignore port
+ numbers specified as [host]:port. In fact, this is now
+ becoming the preferred form, in order to avoid parsing
+ problems with IPV6 addresses. Postfix supports both forms
+ for a while but prints a warning for the old form. Problem
+ reported by Claus Fischer @ werhats.at
+
+ Bugfix: missing initialization for state->sasl_method can
+ cause permit_sasl_authenticated to always succeed. Report
+ and fix by Lutz Jaenicke @ aet.TU-Cottbus.DE.
+
+ FAQ: added notes about how to delete, copy or restore queue
+ files in a safe manner.
Incompatible changes with snapshot-20000919
===========================================
-The queue manager to delivery agent protocol has changed. This does
-not affect the format of queue files, but means that you cannot
-use this software with queue managers or delivery agents of prior
-Postfix versions.
-
-Change in address rewriting: Errors-To:, Reply-To: and Return-Receipt:
+The notation of [host:port] in transport tables etc. is going away
+but it is still supported. The preferred form is now [host]:port.
+This change is necessary to support IPV6 address forms which use
+":" as part of the numeric IP address. In a future release, Postfix
+will log a warning message when it encounters the [host:port] form.
+
+After "make install" you need to "postfix reload". The protocol
+between queue manager and delivery agent protocol has changed. This
+does not affect the format of existing queue files, you just cannot
+mix this Postfix version with queue managers or delivery agents
+from prior Postfix versions.
+
+In mail headers, Errors-To:, Reply-To: and Return-Receipt: addresses
are now rewritten as a sender address (was: recipient).
+Postfix no longer inserts Sender: message headers.
+
+The queue manager now logs the original number of recipients when
+opening queue file.
+
+The local delivery agent no longer appends a blank line when
+delivering to command.
+
Major changes with snapshot-20000919
====================================
with mail user agents.
The header_checks and body_checks features can now be used to strip
-out unwanted data. Specify IGNORE and the data will go disappear.
+out unwanted data. Specify IGNORE and the data will disappear.
+
+Specify "test_home_directory = yes" to prevent mail from being
+delivered to a user whose home directory is not mounted.
-Postfix no longer inserts a Sender: message header when the
-From: address differs from the envelope sender address.
+The pipe mailer has a size limit (size=nnn) command-line argument.
Incompatible changes with snapshot-20000625 (never released)
===========================================
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
* Unique string for multi-part message boundaries.
*/
vstring_sprintf(boundary, "%s.%ld/%s",
- queue_id, event_time(), var_myhostname);
+ queue_id, (long) event_time(), var_myhostname);
#define NULL_SENDER MAIL_ADDR_EMPTY /* special address */
#define NULL_CLEANUP_FLAGS 0
* Unique string for multi-part message boundaries.
*/
vstring_sprintf(boundary, "%s.%ld/%s",
- queue_id, event_time(), var_myhostname);
+ queue_id, (long) event_time(), var_myhostname);
#define NULL_SENDER MAIL_ADDR_EMPTY /* special address */
#define NULL_CLEANUP_FLAGS 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
char time_stamp[1024]; /* XXX locale dependent? */
struct tm *tp;
TOK822 *token;
- char *from;
/*
* Add a missing (Resent-)Message-Id: header. The message ID gives the
#
# Normally, the table serves as input to the postmap(1) com-
# mand. The result, an indexed file in dbm or db format, is
-# used for fast searching by the mail system. After an
-# update it may take a minute or so before the change
-# becomes visible. Issue a postfix reload command to elimi-
-# nate the delay.
+# used for fast searching by the mail system. Execute the
+# command postmap /etc/postfix/access in order to rebuild
+# the indexed file after changing the access table.
#
-# When the table is provided via other means such as NIS,
-# LDAP or SQL, the same lookups are done as for ordinary
+# When the table is provided via other means such as NIS,
+# LDAP or SQL, the same lookups are done as for ordinary
# indexed files.
#
-# Alternatively, the table can be provided as a regular-
+# Alternatively, the table can be provided as a regular-
# expression map where patterns are given as regular expres-
-# sions. In that case, the lookups are done in a slightly
+# sions. In that case, the lookups are done in a slightly
# different way as described below.
#
# TABLE FORMAT
# The format of the access table is as follows:
#
# blanks and comments
-# Blank lines are ignored, as are lines beginning
+# Blank lines are ignored, as are lines beginning
# with `#'.
#
# pattern action
#
# PATTERNS
# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, patterns are
+# networked tables such as NIS, LDAP or SQL, patterns are
# tried in the order as listed below:
#
# user@domain
# Matches the specified mail address.
#
# domain.name
-# Matches the domain.name itself and any subdomain
-# thereof, either in hostnames or in mail addresses.
+# Matches the domain.name itself and any subdomain
+# thereof, either in hostnames or in mail addresses.
# Top-level domains will never be matched.
#
-# user@ Matches all mail addresses with the specified user
+# user@ Matches all mail addresses with the specified user
# part.
#
# 1
#
# net.work
#
-# net Matches any host address in the specified network.
-# A network address is a sequence of one or more
+# net Matches any host address in the specified network.
+# A network address is a sequence of one or more
# octets separated by ".".
#
# ACTIONS
# [45]XX text
-# Reject the address etc. that matches the pattern,
+# Reject the address etc. that matches the pattern,
# and respond with the numerical code and text.
#
# REJECT Reject the address etc. that matches the pattern. A
# Accept the address etc. that matches the pattern.
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# This section describes how the table lookups change when
# the table is given in the form of regular expressions. For
-# a description of regular expression lookup table syntax,
+# a description of regular expression lookup table syntax,
# see regexp_table(5) or pcre_table(5).
#
-# Each pattern is a regular expression that is applied to
+# Each pattern is a regular expression that is applied to
# the entire string being looked up. Depending on the appli-
-# cation, that string is an entire client hostname, an
+# cation, that string is an entire client hostname, an
# entire client IP address, or an entire mail address. Thus,
-# no parent domain or parent network search is done, and
-# user@domain mail addresses are not broken up into their
+# no parent domain or parent network search is done, and
+# user@domain mail addresses are not broken up into their
# user@ and domain constituent parts.
#
-# Patterns are applied in the order as specified in the
-# table, until a pattern is found that matches the search
+# Patterns are applied in the order as specified in the
+# table, until a pattern is found that matches the search
# string.
#
-# Actions are the same as with normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Actions are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# BUGS
-# The table format does not understand quoting conventions.
+# The table format does not understand quoting conventions.
#
# SEE ALSO
# postmap(1) create mapping table
# ACCESS(5) ACCESS(5)
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
# aliases - format of the Postfix alias database
#
# SYNOPSIS
-# postalias [-c config_dir] [-v] [file_type:]input_file
+# newaliases
#
# DESCRIPTION
# The aliases file provides a system-wide mechanism to redi-
#
# The file serves as input to the postalias(1) command. The
# result, an indexed file in dbm or db format, is used for
-# fast lookup by the mail system. After an update it may
-# take a minute or so before the change becomes visible.
-# Issue a postfix reload command to eliminate the delay.
+# fast lookup by the mail system. Execute the command
+# newaliases in order to rebuild the indexed file after
+# changing the Postfix alias database.
#
# The input and output file formats are expected to be com-
# patible with Sendmail version 8, and are expected to be
#
# Normally, the file serves as input to the postmap(1) com-
# mand. The result, an indexed file in dbm or db format, is
-# used for fast searching by the mail system. After an
-# update it may take a minute or so before the change
-# becomes visible. Issue a postfix reload command to elimi-
-# nate the delay.
+# used for fast searching by the mail system. Execute the
+# command postmap /etc/postfix/canonical in order to rebuild
+# the indexed file after changing the canonical table.
#
-# When the table is provided via other means such as NIS,
-# LDAP or SQL, the same lookups are done as for ordinary
+# When the table is provided via other means such as NIS,
+# LDAP or SQL, the same lookups are done as for ordinary
# indexed files.
#
-# Alternatively, the table can be provided as a regular-
+# Alternatively, the table can be provided as a regular-
# expression map where patterns are given as regular expres-
-# sions. In that case, the lookups are done in a slightly
+# sions. In that case, the lookups are done in a slightly
# different way as described below.
#
-# The canonical mapping affects both message header
+# The canonical mapping affects both message header
# addresses (i.e. addresses that appear inside messages) and
-# message envelope addresses (for example, the addresses
-# that are used in SMTP protocol commands). Think Sendmail
+# message envelope addresses (for example, the addresses
+# that are used in SMTP protocol commands). Think Sendmail
# rule set S3, if you like.
#
-# Typically, one would use the canonical table to replace
-# login names by Firstname.Lastname, or to clean up
+# Typically, one would use the canonical table to replace
+# login names by Firstname.Lastname, or to clean up
# addresses produced by legacy mail systems.
#
-# The canonical mapping is not to be confused with virtual
+# The canonical mapping is not to be confused with virtual
# domain support. Use the virtual(5) map for that purpose.
#
-# The canonical mapping is not to be confused with local
+# The canonical mapping is not to be confused with local
# aliasing. Use the aliases(5) map for that purpose.
#
# TABLE FORMAT
# The format of the canonical table is as follows:
#
# blanks and comments
-# Blank lines are ignored, as are lines beginning
+# Blank lines are ignored, as are lines beginning
# with `#'.
#
# pattern result
-# When pattern matches a mail address, replace it by
+# When pattern matches a mail address, replace it by
# the corresponding result.
#
+# With lookups from indexed files such as DB or DBM, or from
+#
# 1
#
# CANONICAL(5) CANONICAL(5)
#
-# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, patterns are
+# networked tables such as NIS, LDAP or SQL, patterns are
# tried in the order as listed below:
#
# user@domain address
-# user@domain is replaced by address. This form has
+# user@domain is replaced by address. This form has
# the highest precedence.
#
-# This form useful to clean up addresses produced by
-# legacy mail systems. It can also be used to pro-
-# duce Firstname.Lastname style addresses, but see
+# This form useful to clean up addresses produced by
+# legacy mail systems. It can also be used to pro-
+# duce Firstname.Lastname style addresses, but see
# below for a simpler solution.
#
# user address
# user@site is replaced by address when site is equal
-# to $myorigin, when site is listed in $mydestina-
+# to $myorigin, when site is listed in $mydestina-
# tion, or when it is listed in $inet_interfaces.
#
-# This form is useful for replacing login names by
+# This form is useful for replacing login names by
# Firstname.Lastname.
#
# @domain address
-# Every address in domain is replaced by address.
+# Every address in domain is replaced by address.
# This form has the lowest precedence.
#
-# In all the above forms, when address has the form @other-
+# In all the above forms, when address has the form @other-
# domain, the result is the same user in otherdomain.
#
# ADDRESS EXTENSION
-# When table lookup fails, and the address localpart con-
-# tains the optional recipient delimiter (e.g.,
-# user+foo@domain), the search is repeated for the unex-
-# tended address (e.g. user@domain), and the unmatched
+# When table lookup fails, and the address localpart con-
+# tains the optional recipient delimiter (e.g.,
+# user+foo@domain), the search is repeated for the unex-
+# tended address (e.g. user@domain), and the unmatched
# extension is propagated to the result of table lookup. The
# matching order is: user+foo@domain, user@domain, user+foo,
# user, and @domain.
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# This section describes how the table lookups change when
# the table is given in the form of regular expressions. For
-# a description of regular expression lookup table syntax,
+# a description of regular expression lookup table syntax,
# see regexp_table(5) or pcre_table(5).
#
-# Each pattern is a regular expression that is applied to
+# Each pattern is a regular expression that is applied to
# the entire address being looked up. Thus, user@domain mail
-# addresses are not broken up into their user and @domain
+# addresses are not broken up into their user and @domain
# constituent parts, nor is user+foo broken up into user and
# foo.
#
-# Patterns are applied in the order as specified in the
-# table, until a pattern is found that matches the search
+# Patterns are applied in the order as specified in the
+# table, until a pattern is found that matches the search
# string.
#
-# Results are the same as with normal indexed file lookups,
+# Results are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
#
# 2
#
# CANONICAL(5) CANONICAL(5)
#
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# from the pattern can be interpolated as $1, $2 and so on.
#
# BUGS
-# The table format does not understand quoting conventions.
+# The table format does not understand quoting conventions.
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# canonical_maps
# Other parameters of interest:
#
# inet_interfaces
-# The network interface addresses that this system
+# The network interface addresses that this system
# receives mail on.
#
# masquerade_domains
-# List of domains that hide their subdomain struc-
+# List of domains that hide their subdomain struc-
# ture.
#
# masquerade_exceptions
-# List of user names that are not subject to address
+# List of user names that are not subject to address
# masquerading.
#
# mydestination
-# List of domains that this mail system considers
+# List of domains that this mail system considers
# local.
#
# myorigin
# CANONICAL(5) CANONICAL(5)
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
#
# Normally, the file serves as input to the postmap(1) com-
# mand. The result, an indexed file in dbm or db format, is
-# used for fast searching by the mail system. After an
-# update issue a postfix reload command to make the change
-# visible.
+# used for fast searching by the mail system. Execute the
+# command postmap /etc/postfix/relocated in order to rebuild
+# the indexed file after changing the relocated table.
#
# When the table is provided via other means such as NIS,
# LDAP or SQL, the same lookups are done as for ordinary
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
-# Specify a domain, host, host:port, [address] or [address:port].
-# Use the form [destination] to turn off MX lookups. See also the
-# default_transport parameter if you're connected via UUCP.
+# Specify a domain, host, host:port, [host]:port, [address] or
+# [address]:port. Use the form [name] to turn off MX lookups. See
+# also the default_transport parameter if you're connected via UUCP.
#
# relayhost = $mydomain
# relayhost = gateway.my.domain
#
# Normally, the file serves as input to the postmap(1) com-
# mand. The result, an indexed file in dbm or db format, is
-# used for fast searching by the mail system. After updating
-# this table, issue the postfix reload command to make the
-# change visible.
+# used for fast searching by the mail system. Execute the
+# command postmap /etc/postfix/transport in order to rebuild
+# the indexed file after changing the transport table.
#
# When the table is provided via other means such as NIS,
# LDAP or SQL, the same lookups are done as for ordinary
#
# The interpretation of the nexthop field is transport
# dependent. In the case of SMTP, specify host:service for a
-# non-default server port, and use [host] or [host:port] in
+# non-default server port, and use [host] or [host]:port in
# order to disable MX (mail exchanger) DNS lookups. The []
# form can also be used with IP addresses instead of host-
# names.
#
# EXAMPLES
-# In order to send mail for foo.org and its subdomains
-# via the uucp transport to the UUCP host named foo:
+# In order to send mail for foo.org and its subdomains via
+# the uucp transport to the UUCP host named foo:
#
# foo.org uucp:foo
# .foo.org uucp:foo
#
-# When no nexthop host name is specified, the destination domain
-# name is used instead. For example, the following directs mail for
-# user@foo.org via the slow transport to a mail
-# exchanger for foo.org. The slow transport could be
-# something that runs at most one delivery process at a time:
+# When no nexthop host name is specified, the destination
+# domain name is used instead. For example, the following
+# directs mail for user@foo.org via the slow transport to a
+# mail exchanger for foo.org. The slow transport could be
+# something that runs at most one delivery process at a
+# time:
#
# foo.org slow:
#
-# When no transport is specified, the default transport is
+# When no transport is specified, the default transport is
# used, as specified via the default_transport configuration
-# parameter. The following sends all mail for foo.org and its
-# subdomains to host gateway.foo.org:
+# parameter. The following sends all mail for foo.org and
+# its subdomains to host gateway.foo.org:
#
# foo.org :[gateway.foo.org]
# .foo.org :[gateway.foo.org]
#
-# In the above example, the [] are used to suppress MX lookups.
-# The result would likely point to your local machine.
+# In the above example, the [] are used to suppress MX
+# lookups. The result would likely point to your local
+# machine.
#
-# In the case of delivery via SMTP, one may specify
-# hostname:service instead of just a host:
+# In the case of delivery via SMTP, one may specify host-
+# name:service instead of just a host:
#
# foo.org smtp:bar.org:2025
#
-# This directs mail for user@foo.org to host bar.org
-# port 2025. Instead of a numerical port a symbolic name may be
-# used. Specify [] around the destination in order to disable MX lookups.
+# This directs mail for user@foo.org to host bar.org port
+# 2025. Instead of a numerical port a symbolic name may be
+# used. Specify [] around the hostname in order to disable
+# MX lookups.
#
# The error mailer can be used to bounce mail:
#
-# .foo.org error:mail for *.foo.org is not deliverable
-#
-# This causes all mail for user@anythingfoo.org
-# to be bounced.
+# .foo.org error:mail for *.foo.org is not deliv-
+# erable
#
# 2
#
# TRANSPORT(5) TRANSPORT(5)
#
+# This causes all mail for user@anything.foo.org to be
+# bounced.
+#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# This section describes how the table lookups change when
# the table is given in the form of regular expressions. For
-# a description of regular expression lookup table syntax,
+# a description of regular expression lookup table syntax,
# see regexp_table(5) or pcre_table(5).
#
-# Each pattern is a regular expression that is applied to
+# Each pattern is a regular expression that is applied to
# the entire domain being looked up. Thus, some.domain.hier-
# archy is not broken up into parent domains.
#
-# Patterns are applied in the order as specified in the
-# table, until a pattern is found that matches the search
+# Patterns are applied in the order as specified in the
+# table, until a pattern is found that matches the search
# string.
#
-# Results are the same as with normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Results are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# transport_maps
# Other parameters of interest:
#
# default_transport
-# The transport to use when no transport is explic-
+# The transport to use when no transport is explic-
# itly specified.
#
# relayhost
# regexp_table(5) format of POSIX regular expression tables
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# 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
#
# 3
#
+# TRANSPORT(5) TRANSPORT(5)
+#
+# Yorktown Heights, NY 10598, USA
+#
+# 4
+#
#
# Normally, the file serves as input to the postmap(1) com-
# mand. The result, an indexed file in dbm or db format, is
-# used for fast searching by the mail system. After an
-# update it may take a minute or so before the change
-# becomes visible. Issue a postfix reload command to elimi-
-# nate the delay.
+# used for fast searching by the mail system. Execute the
+# command postmap /etc/postfix/virtual in order to rebuild
+# the indexed file after changing the virtual table.
#
-# When the table is provided via other means such as NIS,
-# LDAP or SQL, the same lookups are done as for ordinary
+# When the table is provided via other means such as NIS,
+# LDAP or SQL, the same lookups are done as for ordinary
# indexed files.
#
-# Alternatively, the table can be provided as a regular-
+# Alternatively, the table can be provided as a regular-
# expression map where patterns are given as regular expres-
-# sions. In that case, the lookups are done in a slightly
+# sions. In that case, the lookups are done in a slightly
# different way as described below.
#
# TABLE FORMAT
-# Typical support for a virtual domain looks like the fol-
+# Typical support for a virtual domain looks like the fol-
# lowing:
#
# virtual.domain anything (right-hand content does not matter)
+# postmaster@virtual.domain postmaster
# user1@virtual.domain address1
# user2@virtual.domain address2, address3
#
# With this, the SMTP server accepts mail for virtual.domain
-# and rejects mail for unknown@virtual.domain as undeliver-
+# and rejects mail for unknown@virtual.domain as undeliver-
# able.
#
-# The format of the virtual table is as follows, mappings
+# The format of the virtual table is as follows, mappings
# being tried in the order as listed in this manual page:
#
# blanks and comments
-# Blank lines are ignored, as are lines beginning
+# Blank lines are ignored, as are lines beginning
# with `#'.
#
# 1
# VIRTUAL(5) VIRTUAL(5)
#
# pattern result
-# When pattern matches a mail address, replace it by
+# When pattern matches a mail address, replace it by
# the corresponding result.
#
# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, patterns are
+# networked tables such as NIS, LDAP or SQL, patterns are
# tried in the order as listed below:
#
# user@domain address, address, ...
-# Mail for user@domain is redirected to address.
+# Mail for user@domain is redirected to address.
# This form has the highest precedence.
#
# user address, address, ...
-# Mail for user@site is redirected to address when
-# site is equal to $myorigin, when site is listed in
+# Mail for user@site is redirected to address when
+# site is equal to $myorigin, when site is listed in
# $mydestination, or when it is listed in
# $inet_interfaces.
#
-# This functionality overlaps with functionality of
+# This functionality overlaps with functionality of
# the local alias(5) database. The difference is that
-# virtual mapping can be applied to non-local
+# virtual mapping can be applied to non-local
# addresses.
#
# @domain address, address, ...
-# Mail for any user in domain is redirected to
+# Mail for any user in domain is redirected to
# address. This form has the lowest precedence.
#
-# In all the above forms, when address has the form @other-
-# domain, the result is the same user in otherdomain. This
+# In all the above forms, when address has the form @other-
+# domain, the result is the same user in otherdomain. This
# works for the first address in the expansion only.
#
# ADDRESS EXTENSION
-# When the search fails, and the address localpart contains
-# the optional recipient delimiter (e.g., user+foo@domain),
-# the search is repeated for the unextended address (e.g.
+# When the search fails, and the address localpart contains
+# the optional recipient delimiter (e.g., user+foo@domain),
+# the search is repeated for the unextended address (e.g.
# user@domain), and the unmatched address extension is prop-
-# agated to the result of expansion. The matching order is:
+# agated to the result of expansion. The matching order is:
# user+foo@domain, user@domain, user+foo, user, and @domain.
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# This section describes how the table lookups change when
# the table is given in the form of regular expressions. For
-# a description of regular expression lookup table syntax,
+# a description of regular expression lookup table syntax,
# see regexp_table(5) or pcre_table(5).
#
-# Each pattern is a regular expression that is applied to
+# Each pattern is a regular expression that is applied to
# the entire address being looked up. Thus, user@domain mail
-# addresses are not broken up into their user and @domain
+# addresses are not broken up into their user and @domain
# constituent parts, nor is user+foo broken up into user and
# foo.
#
-# Patterns are applied in the order as specified in the
-# table, until a pattern is found that matches the search
+# Patterns are applied in the order as specified in the
+# table, until a pattern is found that matches the search
# string.
#
# 2
#
# VIRTUAL(5) VIRTUAL(5)
#
-# Results are the same as with normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Results are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# BUGS
-# The table format does not understand quoting conventions.
+# The table format does not understand quoting conventions.
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# virtual_maps
# Other parameters of interest:
#
# inet_interfaces
-# The network interface addresses that this system
+# The network interface addresses that this system
# receives mail on.
#
# mydestination
-# List of domains that this mail system considers
+# List of domains that this mail system considers
# local.
#
# myorigin
# regexp_table(5) format of POSIX regular expression tables
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
return (MAIL_OPEN_NO);
}
if (!S_ISREG(statp->st_mode)) {
- msg_warn("%s: uid %d: not a regular file", *path, statp->st_uid);
+ msg_warn("%s: uid %ld: not a regular file", *path, (long) statp->st_uid);
return (MAIL_OPEN_NO);
}
if ((statp->st_mode & S_IRWXU) != MAIL_QUEUE_STAT_READY)
return (MAIL_OPEN_NO);
if (statp->st_nlink > 1) {
- msg_warn("%s: uid %d: file has %d links", *path,
- statp->st_uid, (int) statp->st_nlink);
+ msg_warn("%s: uid %ld: file has %d links", *path,
+ (long) statp->st_uid, (int) statp->st_nlink);
}
return (MAIL_OPEN_YES);
}
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-20000919"
+#define DEF_MAIL_VERSION "Snapshot-20000920"
extern char *var_mail_version;
/* LICENSE
<li><a href="#other_transports">Other transports: UUCP, FAX, etc.</a>
+<li><a href="#queue_maint">Postfix queue maintenance</a>
+
<li><a href="#compiling_installing">Compiling and installing Postfix</a>
</ul>
<li><a href="#incoming">Too much mail in the incoming queue</a>
+<li><a href="#delay">Postfix responds slowly to incoming SMTP connections</a>
+
</ul>
<a name="receiving"><h3>Receiving mail via the network</h3>
</ul>
+<a name="queue_maint"><h3>Postfix queue maintenance</h3></a>
+
+<ul>
+
+<li><a href="#deleting">Deleting a message from the Postfix queue</a>
+
+<li><a href="#copying">Moving or restoring the Postfix queue</a>
+
+</ul>
+
<a name="compiling_installing"><h3>Compiling and installing Postfix</h3>
<ul>
<p>
-Your problem is that the disk is saturated with I/O from receiving
-mail, so that the Postfix queue manager gets insufficient chance
-to process the requests (many SMTP server processes against one
-poor queue manager).
+Your problem could be that the disk is saturated with I/O from
+receiving mail, so that the Postfix queue manager gets insufficient
+chance to process the requests (many SMTP server processes are
+competing for disk access against one poor queue manager).
<p>
<p>
<pre>
+ queue_directory = /my/own/queue/directory
myhostname = foo1.my.domain
inet_interfaces = $myhostname
</pre>
<hr>
+<a name="deleting"><h3>Deleting a message from the Postfix queue</h3></a>
+
+To delete ONE message with queue id ABCDEF from the Postfix queue,
+it is not necessary to stop Postfix.
+
+<p>
+
+<pre>
+ # cd /var/spool/postfix
+ # find incoming active deferred -name ABCDEF -print | sed 1q | xargs rm
+</pre>
+
+<p>
+
+The above command is safe because it deletes at most one file.
+There is no risk of deleting newly arrived mail that happens to get
+the same queue file name.
+
+<p>
+
+If you have to delete a large amount of mail, it is safer to stop
+Postfix first.
+
+<p>
+<pre>
+ # postfix stop
+ # cd /var/spool/postfix
+ # find incoming active deferred defer -type f -print |
+ fgrep -xf /file/with/queue-ids | xargs rm
+ # postfix start
+</pre>
+
+<p>
+
+Do not use the above command on a running Postfix system, because
+it can delete files that belong to new mail that arrives while you
+are deleting queue files.
+
+<hr>
+
+<a name="copying"><h3>Moving or restoring the Postfix queue</h3></a>
+
+It is not safe to simply copy Postfix queue files from one file
+system (or backup) to another file system. The reason for this is
+that queue file names must be unique across the Postfix <b>incoming</b>,
+<b>active</b> and <b>deferred</b> queue directories. If two queue
+files have the same file (base) name, then one of the queue files
+may be lost as files are moved from queue directory to queue
+directory.
+
+<p>
+
+Postfix names a queue file after its inode number and after the
+microsecond part of the time of day. Thus, if a queue file has a
+name based on someone elses inode number there is a small chance
+that the file name will collide with another queue file.
+
+<p>
+
+To avoid queue file name collisions when copying queue files,
+restore queue files in the maildrop directory instead.
+
+<p>
+<pre>
+ # postfix stop
+ ... restore queue files under the maildrop directory...
+ # postfix start
+</pre>
+
+<p>
+
+When Postfix is started, it will pick up queue files from the
+maildrop directory and will give them proper queue file names.
+
+<hr>
+
<a name="bind"><h3>Undefined symbols: ___dn_expand, ___res_init etc.</h3></a>
Question: When I build Postfix I get the following errors:
The interpretation of the <i>nexthop</i> field is transport
dependent. In the case of SMTP, specify <i>host</i>:<i>service</i> for a
- non-default server port, and use [<i>host</i>] or [<i>host</i>:<i>port</i>] in
+ non-default server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
order to disable MX (mail exchanger) DNS lookups. The []
form can also be used with IP addresses instead of host-
names.
This directs mail for <i>user</i>@<b>foo.org</b> to host <b>bar.org</b> port
<b>2025</b>. Instead of a numerical port a symbolic name may be
- used. Specify [] around the destination in order to dis-
- able MX lookups.
+ used. Specify [] around the hostname in order to disable
+ MX lookups.
The error mailer can be used to bounce mail:
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
*
* Skip this command if it was already delivered to as this user.
*/
- if (been_here(state.dup_filter, "command %d %s", usr_attr.uid, command))
+ if (been_here(state.dup_filter, "command %ld %s", (long) usr_attr.uid, command))
return (0);
/*
if (S_ISREG(st.st_mode) == 0) {
msg_warn("file %s is not a regular file", STR(path));
} else if (st.st_uid != 0 && st.st_uid != usr_attr.uid) {
- msg_warn("file %s has bad owner uid %d", STR(path), st.st_uid);
+ msg_warn("file %s has bad owner uid %ld",
+ STR(path), (long) st.st_uid);
} else if (st.st_mode & 002) {
msg_warn("file %s is world writable", STR(path));
} else if ((fd = open_as(STR(path), O_RDONLY, 0, usr_attr.uid, usr_attr.gid)) < 0) {
*
* Skip this file if it was already delivered to as this user.
*/
- if (been_here(state.dup_filter, "file %d %s", usr_attr.uid, path))
+ if (been_here(state.dup_filter, "file %ld %s", (long) usr_attr.uid, path))
return (0);
/*
* Deliver. From here on, no early returns or we have a memory leak.
*/
if (msg_verbose)
- msg_info("deliver_file (%d,%d): %s", usr_attr.uid, usr_attr.gid, path);
+ msg_info("deliver_file (%ld,%ld): %s",
+ (long) usr_attr.uid, (long) usr_attr.gid, path);
if (vstream_fseek(state.msg_attr.fp, state.msg_attr.offset, SEEK_SET) < 0)
msg_fatal("seek queue file %s: %m", state.msg_attr.queue_id);
why = vstring_alloc(100);
path, STR(why));
#endif
} else if (mail_copy(COPY_ATTR(state.msg_attr), dst, S_ISREG(st.st_mode) ?
- copy_flags : (copy_flags & ~MAIL_COPY_TOFILE), "\n", why)) {
+ copy_flags : (copy_flags & ~MAIL_COPY_TOFILE), "\n", why)) {
status = defer_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr),
"cannot append destination file %s: %s",
path, STR(why));
*
* Don't process this include file more than once as this particular user.
*/
- if (been_here(state.dup_filter, "include %d %s", usr_attr.uid, path))
+ if (been_here(state.dup_filter, "include %ld %s", (long) usr_attr.uid, path))
return (0);
state.msg_attr.exp_from = state.msg_attr.local;
*/
if (usr_attr.uid == 0) {
if ((file_pwd = mypwuid(st.st_uid)) == 0) {
- msg_warn("cannot find username for uid %d", st.st_uid);
+ msg_warn("cannot find username for uid %ld", (long) st.st_uid);
return (defer_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr),
"%s: cannot find :include: file owner", path));
}
chown_gid = usr_attr.gid;
}
if (msg_verbose)
- msg_info("spool_uid/gid %d/%d chown_uid/gid %d/%d",
- spool_uid, spool_gid, chown_uid, chown_gid);
+ msg_info("spool_uid/gid %ld/%ld chown_uid/gid %ld/%ld",
+ (long) spool_uid, (long) spool_gid,
+ (long) chown_uid, (long) chown_gid);
/*
* Lock the mailbox and open/create the mailbox file. Depending on the
The interpretation of the \fInexthop\fR field is transport
dependent. In the case of SMTP, specify \fIhost\fR:\fIservice\fR for a
-non-default server port, and use [\fIhost\fR] or [\fIhost\fR:\fIport\fR]
+non-default server port, and use [\fIhost\fR] or [\fIhost\fR]:\fIport\fR
in order to disable MX (mail exchanger) DNS lookups. The [] form
can also be used with IP addresses instead of hostnames.
.SH EXAMPLES
This directs mail for \fIuser\fR@\fBfoo.org\fR to host \fBbar.org\fR
port \fB2025\fR. Instead of a numerical port a symbolic name may be
-used. Specify [] around the destination in order to disable MX lookups.
+used. Specify [] around the hostname in order to disable MX lookups.
The error mailer can be used to bounce mail:
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
-TPIPE_PARAMS
-TPLMYSQL
-TQMGR_ENTRY
+-TQMGR_JOB
-TQMGR_MESSAGE
+-TQMGR_PEER
-TQMGR_QUEUE
+-TQMGR_RCPT
-TQMGR_RCPT_LIST
-TQMGR_RECIPIENT
-TQMGR_SCAN
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
/* qmgr_bounce_recipient - bounce one message recipient */
-void qmgr_bounce_recipient(QMGR_MESSAGE *message, QMGR_RCPT * recipient,
+void qmgr_bounce_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
const char *format,...)
{
va_list ap;
/* qmgr_entry_select - select queue entry for delivery */
-QMGR_ENTRY *qmgr_entry_select(QMGR_PEER * peer)
+QMGR_ENTRY *qmgr_entry_select(QMGR_PEER *peer)
{
QMGR_ENTRY *entry;
QMGR_QUEUE *queue;
/* qmgr_entry_create - create queue todo entry */
-QMGR_ENTRY *qmgr_entry_create(QMGR_PEER * peer, QMGR_MESSAGE *message)
+QMGR_ENTRY *qmgr_entry_create(QMGR_PEER *peer, QMGR_MESSAGE *message)
{
QMGR_ENTRY *entry;
QMGR_QUEUE *queue = peer->queue;
/* qmgr_job_link - append the job to the job list, according to the time it was queued */
-static void qmgr_job_link(QMGR_JOB * job)
+static void qmgr_job_link(QMGR_JOB *job)
{
QMGR_TRANSPORT *transport = job->transport;
QMGR_MESSAGE *message = job->message;
/* qmgr_job_move_limits - move unused recipient slots to the next job */
-void qmgr_job_move_limits(QMGR_JOB * job)
+void qmgr_job_move_limits(QMGR_JOB *job)
{
QMGR_TRANSPORT *transport = job->transport;
QMGR_MESSAGE *message = job->message;
/* qmgr_job_retire - remove the job from the job list while waiting for recipients to deliver */
-static void qmgr_job_retire(QMGR_JOB * job)
+static void qmgr_job_retire(QMGR_JOB *job)
{
char *myname = "qmgr_job_retire";
QMGR_TRANSPORT *transport = job->transport;
/* qmgr_job_free - release the job structure */
-void qmgr_job_free(QMGR_JOB * job)
+void qmgr_job_free(QMGR_JOB *job)
{
char *myname = "qmgr_job_free";
QMGR_MESSAGE *message = job->message;
/* qmgr_job_count_slots - maintain the delivery slot counters */
-static void qmgr_job_count_slots(QMGR_JOB * current, QMGR_JOB * job)
+static void qmgr_job_count_slots(QMGR_JOB *current, QMGR_JOB *job)
{
/*
/* qmgr_job_candidate - find best job candidate for preempting given job */
-static QMGR_JOB *qmgr_job_candidate(QMGR_JOB * current)
+static QMGR_JOB *qmgr_job_candidate(QMGR_JOB *current)
{
QMGR_TRANSPORT *transport = current->transport;
QMGR_JOB *job,
/* qmgr_job_preempt - preempt large message with smaller one */
-static QMGR_JOB *qmgr_job_preempt(QMGR_JOB * current)
+static QMGR_JOB *qmgr_job_preempt(QMGR_JOB *current)
{
char *myname = "qmgr_job_preempt";
QMGR_TRANSPORT *transport = current->transport;
/* qmgr_job_pop - remove the job from the job preemption stack */
-static void qmgr_job_pop(QMGR_JOB * job)
+static void qmgr_job_pop(QMGR_JOB *job)
{
QMGR_TRANSPORT *transport = job->transport;
QMGR_JOB *parent;
/* qmgr_job_peer_select - select next peer suitable for delivery */
-static QMGR_PEER *qmgr_job_peer_select(QMGR_JOB * job)
+static QMGR_PEER *qmgr_job_peer_select(QMGR_JOB *job)
{
QMGR_PEER *peer;
QMGR_MESSAGE *message = job->message;
/* qmgr_peer_create - create and initialize message peer structure */
-QMGR_PEER *qmgr_peer_create(QMGR_JOB * job, QMGR_QUEUE *queue)
+QMGR_PEER *qmgr_peer_create(QMGR_JOB *job, QMGR_QUEUE *queue)
{
QMGR_PEER *peer;
/* qmgr_peer_free - release peer structure */
-void qmgr_peer_free(QMGR_PEER * peer)
+void qmgr_peer_free(QMGR_PEER *peer)
{
QMGR_JOB *job = peer->job;
/* qmgr_peer_find - lookup peer associated with given job and queue */
-QMGR_PEER *qmgr_peer_find(QMGR_JOB * job, QMGR_QUEUE *queue)
+QMGR_PEER *qmgr_peer_find(QMGR_JOB *job, QMGR_QUEUE *queue)
{
return ((QMGR_PEER *) htable_find(job->peer_byname, queue->name));
}
/* qmgr_peer_select - select next peer suitable for delivery within given job */
-QMGR_PEER *qmgr_peer_select(QMGR_JOB * job)
+QMGR_PEER *qmgr_peer_select(QMGR_JOB *job)
{
QMGR_PEER *peer;
QMGR_QUEUE *queue;
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
static int file_read_error(PICKUP_INFO *info, int type)
{
- msg_warn("uid=%d: unexpected or malformed record type %d",
- info->st.st_uid, type);
+ msg_warn("uid=%ld: unexpected or malformed record type %d",
+ (long) info->st.st_uid, type);
return (REMOVE_MESSAGE_FILE);
}
if ((status = copy_segment(qfile, cleanup, info, buf, REC_TYPE_ENVELOPE)) != 0)
return (status);
if (info->sender == 0) {
- msg_warn("%s: uid=%d: no envelope sender", info->id, info->st.st_uid);
+ msg_warn("%s: uid=%ld: no envelope sender",
+ info->id, (long) info->st.st_uid);
return (REMOVE_MESSAGE_FILE);
}
msg_info("%s: uid=%d from=<%s>", info->id,
* include the message file ownership, without revealing the login name.
*/
rec_fputs(cleanup, REC_TYPE_MESG, "");
- rec_fprintf(cleanup, REC_TYPE_NORM, "Received: by %s (%s, from userid %d)",
- var_myhostname, var_mail_name, info->st.st_uid);
+ rec_fprintf(cleanup, REC_TYPE_NORM, "Received: by %s (%s, from userid %ld)",
+ var_myhostname, var_mail_name, (long) info->st.st_uid);
rec_fprintf(cleanup, REC_TYPE_NORM, "\tid %s; %s", info->id,
mail_date(info->st.st_mtime));
if (st.st_dev != info->st.st_dev
|| st.st_ino != info->st.st_ino
|| st.st_mode != info->st.st_mode) {
- msg_warn("%s: uid %d: file has changed", info->path, st.st_uid);
+ msg_warn("%s: uid %ld: file has changed", info->path, (long) st.st_uid);
return (REMOVE_MESSAGE_FILE);
}
qfile = vstream_fdopen(fd, O_RDONLY);
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
if (attr->uid == var_owner_uid)
msg_fatal("request to deliver as mail system owner");
if (attr->gid == 0)
- msg_fatal("request to use privileged group id %d", attr->gid);
+ msg_fatal("request to use privileged group id %ld", (long) attr->gid);
if (attr->gid == var_owner_gid)
- msg_fatal("request to use mail system owner group id %d", attr->gid);
+ msg_fatal("request to use mail system owner group id %ld", (long) attr->gid);
/*
* Give the poor tester a clue of what is going on.
*/
if (msg_verbose)
- msg_info("%s: uid %d, gid %d, flags %d, size %ld",
- myname, attr->uid, attr->gid, attr->flags,
- (long) attr->size_limit);
+ msg_info("%s: uid %ld, gid %ld, flags %d, size %ld",
+ myname, (long) attr->uid, (long) attr->gid,
+ attr->flags, (long) attr->size_limit);
}
/* eval_command_status - do something with command completion status */
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
*/
if (postdrop_path) {
if (remove(postdrop_path))
- msg_warn("uid=%d: remove %s: %m", getuid(), postdrop_path);
+ msg_warn("uid=%ld: remove %s: %m", (long) getuid(), postdrop_path);
else if (msg_verbose)
msg_info("remove %s", postdrop_path);
postdrop_path = 0;
if (rec_type == REC_TYPE_EOF) { /* request cancelled */
mail_stream_cleanup(dst);
if (remove(postdrop_path))
- msg_warn("uid=%d: remove %s: %m", getuid(), postdrop_path);
+ msg_warn("uid=%ld: remove %s: %m", (long) getuid(), postdrop_path);
else if (msg_verbose)
msg_info("remove %s", postdrop_path);
myfree(postdrop_path);
exit(0);
}
if (rec_type == REC_TYPE_ERROR)
- msg_fatal("uid=%d: malformed input", uid);
+ msg_fatal("uid=%ld: malformed input", (long) uid);
if (rec_type == REC_TYPE_TIME)
rec_fprintf(dst->stream, REC_TYPE_TIME, "%ld",
(long) time((time_t *) 0));
if (strchr(*expected, rec_type) == 0)
- msg_fatal("uid=%d: unexpected record type: %d", uid, rec_type);
+ msg_fatal("uid=%ld: unexpected record type: %d", (long) uid, rec_type);
if (rec_type == **expected)
expected++;
if (REC_PUT_BUF(dst->stream, rec_type, buf) < 0)
- msg_fatal("uid=%d: queue file write error", uid);
+ msg_fatal("uid=%ld: queue file write error", (long) uid);
if (rec_type == REC_TYPE_END)
break;
}
* Finish the file.
*/
if ((status = mail_stream_finish(dst)) != 0)
- msg_fatal("uid=%d: %s", uid, cleanup_strerror(status));
+ msg_fatal("uid=%ld: %s", (long) uid, cleanup_strerror(status));
/*
* Disable deletion on fatal error before reporting success, so the file
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
#
# The interpretation of the \fInexthop\fR field is transport
# dependent. In the case of SMTP, specify \fIhost\fR:\fIservice\fR for a
-# non-default server port, and use [\fIhost\fR] or [\fIhost\fR:\fIport\fR]
+# non-default server port, and use [\fIhost\fR] or [\fIhost\fR]:\fIport\fR
# in order to disable MX (mail exchanger) DNS lookups. The [] form
# can also be used with IP addresses instead of hostnames.
# EXAMPLES
#
# This directs mail for \fIuser\fR@\fBfoo.org\fR to host \fBbar.org\fR
# port \fB2025\fR. Instead of a numerical port a symbolic name may be
-# used. Specify [] around the destination in order to disable MX lookups.
+# used. Specify [] around the hostname in order to disable MX lookups.
#
# The error mailer can be used to bounce mail:
#
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
#include <sys_defs.h>
#include <sys/stat.h>
#include <stdlib.h>
+#include <stdio.h> /* sscanf() */
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
long save_offset = message->rcpt_offset; /* save a flag */
char *start;
struct stat st;
- int nrcpt;
+ int nrcpt = 0;
/*
* Initialize. No early returns or we have a memory leak.
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
postdrop_command = concatenate(var_command_dir, "/postdrop",
msg_verbose ? " -v" : (char *) 0, (char *) 0);
if ((handle = mail_stream_command(postdrop_command)) == 0)
- msg_fatal("%s(%d): unable to execute %s",
- saved_sender, uid, postdrop_command);
+ msg_fatal("%s(%ld): unable to execute %s",
+ saved_sender, (long) uid, postdrop_command);
myfree(postdrop_command);
}
dst = handle->stream;
if (tp->type == TOK822_ADDR) {
tok822_internalize(buf, tp->head, TOK822_STR_DEFL);
if (REC_PUT_BUF(dst, REC_TYPE_RCPT, buf) < 0)
- msg_fatal("%s(%d): error writing queue file: %m",
- saved_sender, uid);
+ msg_fatal("%s(%ld): error writing queue file: %m",
+ saved_sender, (long) uid);
}
}
tok822_free_tree(tree);
if ((flags & SM_FLAG_AEOF) && VSTRING_LEN(buf) == 1 && *STR(buf) == '.')
break;
if (REC_PUT_BUF(dst, type, buf) < 0)
- msg_fatal("%s(%d): error writing queue file: %m", saved_sender, uid);
+ msg_fatal("%s(%ld): error writing queue file: %m",
+ saved_sender, (long) uid);
}
/*
* handler from removing the file.
*/
if (vstream_ferror(VSTREAM_IN))
- msg_fatal("%s(%d): error reading input: %m", saved_sender, uid);
+ msg_fatal("%s(%ld): error reading input: %m",
+ saved_sender, (long) uid);
if ((status = mail_stream_finish(handle)) != 0)
- msg_fatal("%s(%d): %s", saved_sender, uid, cleanup_strerror(status));
+ msg_fatal("%s(%ld): %s", saved_sender,
+ (long) uid, cleanup_strerror(status));
if (sendmail_path) {
myfree(sendmail_path);
sendmail_path = 0;
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
/* appended, separated by a colon (":").
/*
/* By default, the Internet domain name service is queried for mail
-/* exchanger hosts. Quote the destination with `[' and `]' to
+/* exchanger hosts. Quote the domain name with `[' and `]' to
/* suppress mail exchanger lookups.
/*
/* Numerical address information should always be quoted with `[]'.
struct servent *sp;
char *protocol = "tcp"; /* XXX configurable? */
unsigned port;
+ char *cruft;
if (msg_verbose)
msg_info("smtp_parse_destination: %s %s", destination, def_service);
*/
if (*host == '[') {
host++;
- host[strcspn(host, "]")] = 0;
- }
+ cruft = split_at(host, ']');
+ } else
+ cruft = 0;
/*
* Separate host and service information, or use the default service
* specified by the caller. XXX the ":" character is used in the IPV6
- * address notation, so using split_at_right() is not sufficient. We'd
- * have to count the number of ":" instances.
+ * address notation, so we will have to deprecate the use of [host:port]
+ * in favor of [host]:port.
*/
- if ((service = split_at_right(host, ':')) == 0)
- service = def_service;
+ if (cruft && *cruft) {
+ if ((service = split_at_right(cruft, ':')) == 0)
+ service = def_service;
+ } else {
+ if ((service = split_at_right(host, ':')) == 0)
+ service = def_service;
+#if 0
+ else if (cruft) {
+ msg_warn("old-style address form: %s", destination);
+ msg_warn("support for [host:port] forms will go away");
+ msg_warn("specify [host]:port instead");
+ }
+#endif
+ }
if (*service == 0)
msg_fatal("empty service name: %s", destination);
*hostp = host;
if (clientoutlen > 0) {
if (msg_verbose)
msg_info("%s: %s: uncoded initial reply: %.*s",
- myname, state->session->namaddr, clientoutlen, clientout);
+ myname, state->session->namaddr,
+ (int) clientoutlen, clientout);
enc_length = ENCODE64_LENGTH(clientoutlen) + 1;
VSTRING_SPACE(state->sasl_encoded, enc_length);
if (sasl_encode64(clientout, clientoutlen,
if (msg_verbose)
msg_info("%s: %s: decoded challenge: %.*s",
myname, state->session->namaddr,
- enc_length, STR(state->sasl_decoded));
+ (int) enc_length, STR(state->sasl_decoded));
result = sasl_client_step((sasl_conn_t *) state->sasl_conn,
STR(state->sasl_decoded), enc_length,
NO_SASL_INTERACTION, &clientout, &clientoutlen);
if (result != SASL_OK && result != SASL_CONTINUE)
msg_warn("SASL authentication failed to server %s: %s",
state->session->namaddr,
- sasl_errstring(result, NO_SASL_LANGLIST,
- NO_SASL_OUTLANG));
+ sasl_errstring(result, NO_SASL_LANGLIST,
+ NO_SASL_OUTLANG));
/*
* Send a client response.
if (clientoutlen > 0) {
if (msg_verbose)
msg_info("%s: %s: uncoded client response %.*s",
- myname, state->session->namaddr, clientoutlen, clientout);
+ myname, state->session->namaddr,
+ (int) clientoutlen, clientout);
enc_length = ENCODE64_LENGTH(clientoutlen) + 1;
VSTRING_SPACE(state->sasl_encoded, enc_length);
if (sasl_encode64(clientout, clientoutlen,
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
cpp[1], CHECK_RELAY_DOMAINS);
#ifdef USE_SASL_AUTH
} else if (strcasecmp(name, PERMIT_SASL_AUTH) == 0) {
- status = permit_sasl_auth(state, SMTPD_CHECK_OK, SMTPD_CHECK_DUNNO);
+ if (var_smtpd_sasl_enable)
+ status = permit_sasl_auth(state,
+ SMTPD_CHECK_OK, SMTPD_CHECK_DUNNO);
#endif
} else if (strcasecmp(name, REJECT_UNKNOWN_RCPTDOM) == 0) {
if (state->recipient)
*/
if (msg_verbose)
msg_info("%s: uncoded challenge: %.*s",
- myname, serveroutlen, serverout);
+ myname, (int) serveroutlen, serverout);
enc_length = ((serveroutlen + 2) / 3) * 4 + 1;
VSTRING_SPACE(state->sasl_encoded, enc_length);
if (sasl_encode64(serverout, serveroutlen, STR(state->sasl_encoded),
return ("501 Error: malformed authentication response");
if (msg_verbose)
msg_info("%s: decoded response: %.*s",
- myname, dec_length, STR(state->sasl_decoded));
+ myname, (int) dec_length, STR(state->sasl_decoded));
result = sasl_server_step(state->sasl_conn, STR(state->sasl_decoded),
dec_length, &serverout, &serveroutlen, &errstr);
}
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
if (attr->uid == var_owner_uid)
msg_fatal("request to deliver as mail system owner");
if (attr->gid == 0)
- msg_fatal("request to use privileged group id %d", attr->gid);
+ msg_fatal("request to use privileged group id %ld", (long) attr->gid);
if (attr->gid == var_owner_gid)
- msg_fatal("request to use mail system owner group id %d", attr->gid);
+ msg_fatal("request to use mail system owner group id %ld", (long) attr->gid);
/*
* Give the poor tester a clue of what is going on.
*/
if (msg_verbose)
- msg_info("%s: uid %d, gid %d; time %d",
- myname, attr->uid, attr->gid, attr->time_limit);
+ msg_info("%s: uid %ld, gid %ld; time %d",
+ myname, (long) attr->uid, (long) attr->gid, attr->time_limit);
}
/* spawn_service - perform service for client */
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
msg_info 0 0
msg_panic 0 0
msg_warn 0 0
-opened 3 0
+opened 4 0
post_mail_fprintf 1 0
qmgr_message_bounce 2 0
rec_fprintf 2 0
uid = pwd->pw_uid;
gid = pwd->pw_gid;
if (setgid(gid) < 0)
- msg_fatal("setgid(%d): %m", gid);
+ msg_fatal("setgid(%ld): %m", (long) gid);
if (initgroups(user_name, gid) < 0)
msg_fatal("initgroups: %m");
}
*/
if (user_name != 0)
if (setuid(uid) < 0)
- msg_fatal("setuid(%d): %m", uid);
+ msg_fatal("setuid(%ld): %m", (long) uid);
/*
* Give the desperate developer a clue of what is happening.
static DICT_OPEN_INFO dict_open_info[] = {
"environ", dict_env_open,
"unix", dict_unix_open,
+#if 0
"tcp", dict_tcp_open,
+#endif
#ifdef HAS_DBM
"dbm", dict_dbm_open,
#endif
} else {
if (buf == 0)
buf = vstring_alloc(10);
- vstring_sprintf(buf, "%s:%s:%d:%d:%s:%s:%s",
- pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid,
- pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell);
+ vstring_sprintf(buf, "%s:%s:%ld:%ld:%s:%s:%s",
+ pwd->pw_name, pwd->pw_passwd, (long) pwd->pw_uid,
+ (long) pwd->pw_gid, pwd->pw_gecos, pwd->pw_dir,
+ pwd->pw_shell);
return (vstring_str(buf));
}
}
} else {
if (buf == 0)
buf = vstring_alloc(10);
- vstring_sprintf(buf, "%s:%s:%d:",
- grp->gr_name, grp->gr_passwd, grp->gr_gid);
+ vstring_sprintf(buf, "%s:%s:%ld:",
+ grp->gr_name, grp->gr_passwd, (long) grp->gr_gid);
for (cpp = grp->gr_mem; *cpp; cpp++) {
vstring_strcat(buf, *cpp);
if (cpp[1])
printf("Testing if the close-on-exec flag of file-descriptor 3 is set.\n");
DO((res = fcntl(3, F_GETFD, 0)));
if (res & 1)
- printf("Yes, a newly dup2()ed file-descriptor has the close-on-exec "
- "flag cloned.\n"
- "THIS VIOLATES Posix1003.1 section 6.2.1.2 or 6.5.2.2!\n"
- "You should #define DUP2_DUPS_CLOSE_ON_EXEC in sys_defs.h "
- "for your OS.\n");
+ printf(
+"Yes, a newly dup2()ed file-descriptor has the close-on-exec \
+flag cloned.\n\
+THIS VIOLATES Posix1003.1 section 6.2.1.2 or 6.5.2.2!\n\
+You should #define DUP2_DUPS_CLOSE_ON_EXEC in sys_defs.h \
+for your OS.\n");
else
- printf("No, a newly dup2()ed file-descriptor has the close-on-exec "
- "flag cleared.\n"
- "This complies with Posix1003.1 section 6.2.1.2 and 6.5.2.2!\n");
+ printf(
+"No, a newly dup2()ed file-descriptor has the close-on-exec \
+flag cleared.\n\
+This complies with Posix1003.1 section 6.2.1.2 and 6.5.2.2!\n");
return 0;
}
if (seteuid(0))
msg_fatal("set_eugid: seteuid(0): %m");
if (setegid(egid) < 0)
- msg_fatal("set_eugid: setegid(%d): %m", egid);
+ msg_fatal("set_eugid: setegid(%ld): %m", (long) egid);
if (setgroups(1, &egid) < 0)
- msg_fatal("set_eugid: setgroups(%d): %m", egid);
+ msg_fatal("set_eugid: setgroups(%ld): %m", (long) egid);
if (euid != 0 && seteuid(euid) < 0)
- msg_fatal("set_eugid: seteuid(%d): %m", euid);
+ msg_fatal("set_eugid: seteuid(%ld): %m", (long) euid);
if (msg_verbose)
- msg_info("set_eugid: euid %d egid %d", euid, egid);
+ msg_info("set_eugid: euid %ld egid %ld", (long) euid, (long) egid);
}
if (seteuid(0) < 0)
msg_fatal("seteuid(0): %m");
if (setgid(gid) < 0)
- msg_fatal("setgid(%d): %m", gid);
+ msg_fatal("setgid(%ld): %m", (long) gid);
if (setgroups(1, &gid) < 0)
- msg_fatal("setgroups(1, &%d): %m", gid);
+ msg_fatal("setgroups(1, &%ld): %m", (long) gid);
if (setuid(uid) < 0)
- msg_fatal("setuid(%d): %m", uid);
+ msg_fatal("setuid(%ld): %m", (long) uid);
if (msg_verbose > 1)
- msg_info("setugid: uid %d gid %d", uid, gid);
+ msg_info("setugid: uid %ld gid %ld", (long) uid, (long) gid);
}
-