2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-29 21:27:57 +00:00

postfix-1.1.7-20020501

This commit is contained in:
Wietse Venema 2002-05-01 00:00:00 -05:00 committed by Viktor Dukhovni
parent b8b5b6c61f
commit 44b8cf6ec1
52 changed files with 903 additions and 305 deletions

View File

@ -6228,6 +6228,101 @@ Apologies for any names omitted.
stripping in postqueue/postqueue.c. Problem reported by stripping in postqueue/postqueue.c. Problem reported by
Victor Duchovni, Morgan Stanley. Victor Duchovni, Morgan Stanley.
20020402
Workaround: recognize more headers that are sent instead
of SMTP commands. File: smtpd/smtpd.c.
20020413
Feature: new pipe delivery agent "D" flag to prepend a
Delivered-To: message header. This requires single recipient
deliveries. Based on code by Matthias Andree. File:
pipe/pipe.c.
20020414
Portability: Postfix will no longer attempt to build with
gdbm support, because gdbm is broken. File: makedefs.
20020415
Cleanup: the attribute list IPC code did not distinguish
between "disconnect" and "timeout" while reading an attribute
list, making trouble shooting more difficult than necessary.
Files: util/attr_scan0.c, util/attr_scan64.c.
Cleanup: install parameter defaults can now be overruled
from makedefs: sendmail_path, mailq_path, newaliases_path,
command_directory, daemon_directory. Based on code by
Victor Duchovni, Morgan Stanley. File: util/sys_defs.h.
20020411
Cleanup: Use more robust quoting passing makedefs/Makefile
settings. This also simplifies the seven backslashes example
in the INSTALL file. Victor Duchovni, Morgan Stanley.
Files: makedefs, INSTALL.
20020417
Bugfix: the post-install script failed to upgrade master.cf
settings from private to public if the service was explicitly
configured as private.
20020418
Documentation: added CPU saving patterns for quickly skipping
base 64 encoded text in message bodies. Liviu Daia.
Files: {proto,conf}/pcre_table, {proto,conf}/regexp_table,
conf/sample_{regexp,pcre}_body.cf.
20020426
Bugfix: the SMTP client forgot to quote whitespace etc.
in a sender/recipient address when DNS lookup was turned
off (disable_dns_lookups = yes). Problem experienced by
Chip Paswater. Files: smtp/smtp_proto.c.
20020501
Feature: wildcard lookup in transport maps (lookup key
"*"). Code developed with Lamont Jones, HP.
Feature: a null transport:destination transport map entry
means proceed as if the transport map lookup failed. Code
developed with Lamont Jones, HP.
Feature: more efficient use of cache memory when a process
opens multiple Berkeley DB tables. Files: util/dict_db.c,
global/mkmap_db.c. Victor Duchovni, Morgan Stanley.
20020503
Cleanup: postqueue silently ignored command-line arguments
following -p or -f options, instead of complaining; postqueue
produced an incorrect error message (mail system down) when
the command was installed with incorrect privileges. File:
postqueue/postqueue.c.
Bugfix: while reporting a domain name or IP address syntax
error, postqueue could dereference a dangling pointer with
some getopt() implementations. LaMont Jones, HP. File:
postqueue/postqueue.c.
Safety: postalias and postmap now drop root privileges
while processing a non-root input file. Thus, the result
should be writable to the source file owner. Specify the
-o option if this is a problem. Files: postmap/postmap.c,
postalias/postalias.c.
Consistency: just like postmap, postalias now copies file
permissions from the source file when it creates a new
table for the first time. File: postalias/postalias.c.
Portability: run-time test to avoid GDBM trouble. File:
util/dict_dbm.c.
Open problems: Open problems:
Low: sendmail does not store null command-line recipients. Low: sendmail does not store null command-line recipients.
@ -6252,7 +6347,8 @@ Open problems:
Low: generic showq protocol, to allow for more intelligent Low: generic showq protocol, to allow for more intelligent
processing than just mailq. Maybe marry this with postsuper. processing than just mailq. Maybe marry this with postsuper.
Low: default domain for appending to unqualified recipients. Low: default domain for appending to unqualified recipients,
so that unqualified names can be delivered locally.
Low: The $process_id_directory setting is not used anywhere Low: The $process_id_directory setting is not used anywhere
in Postfix. Problem reported by Michael Smith, texas.net. in Postfix. Problem reported by Michael Smith, texas.net.

View File

@ -135,10 +135,20 @@ and so on. In some cases, optimization is turned off automatically.
In order to build with non-default settings, for example, with a In order to build with non-default settings, for example, with a
configuration directory other than /etc/postfix, use: configuration directory other than /etc/postfix, use:
% make makefiles CCARGS=-DDEF_CONFIG_DIR=\\\\\\\"/some/where\\\\\\\" % make makefiles CCARGS='-DDEF_CONFIG_DIR=\"/some/where\"'
% make % make
That's seven backslashes :-) But at least this works with sh and csh. Be sure to get the quotes right. These details matter a lot.
Other parameters whose defaults can be specified in this way are:
Macro name default value for
-------------------------------------
DEF_COMMAND_DIR command_directory
DEF_DAEMON_DIR daemon_directory
DEF_SENDMAIL_PATH sendmail_path
DEF_MAILQ_PATH mailq_path
DEF_NEWALIAS_PATH newaliases_path
In order to build Postfix for very large applications, where you In order to build Postfix for very large applications, where you
expect to run more than 1000 delivery processes, you may need to expect to run more than 1000 delivery processes, you may need to
@ -209,16 +219,22 @@ In order to install or upgrade Postfix:
postfix:*:12345:12345:postfix:/no/where:/no/shell postfix:*:12345:12345:postfix:/no/where:/no/shell
Note: there should be no whitespace before "postfix:".
- Make sure there is a corresponding alias in /etc/aliases: - Make sure there is a corresponding alias in /etc/aliases:
postfix: root postfix: root
Note: there should be no whitespace before "postfix:".
- Create a group "postdrop" with a group id that is not used by - Create a group "postdrop" with a group id that is not used by
any other user account. Not even by the postfix user account. any other user account. Not even by the postfix user account.
My group file entry looks like: My group file entry looks like:
postdrop:*:54321: postdrop:*:54321:
Note: there should be no whitespace before "postdrop:".
NB: this group was optional with older Postfix releases; it is NB: this group was optional with older Postfix releases; it is
now required. now required.
@ -285,7 +301,7 @@ In order to inspect the mail queue, use
% sendmail -bp % sendmail -bp
See also the "Care and feeding" section 13 below. See also the "Care and feeding" section 12 below.
8 - Configuring Postfix to send and receive mail (virtual interface) 8 - Configuring Postfix to send and receive mail (virtual interface)
==================================================================== ====================================================================
@ -327,7 +343,7 @@ In order to inspect the mail queue, use
% sendmail -bp % sendmail -bp
See also the "Care and feeding" section 13 below. See also the "Care and feeding" section 12 below.
9 - Turning off sendmail forever 9 - Turning off sendmail forever
================================ ================================
@ -357,7 +373,7 @@ and watch the syslog file for any complaints from the mail system.
Typical logfile names are: /var/log/maillog or /var/log/syslog. Typical logfile names are: /var/log/maillog or /var/log/syslog.
See /etc/syslog.conf for actual logfile names. See /etc/syslog.conf for actual logfile names.
See also the "Care and feeding" section 13 below. See also the "Care and feeding" section 12 below.
10 - Mandatory configuration file edits 10 - Mandatory configuration file edits
======================================= =======================================

View File

@ -1,6 +1,6 @@
SHELL = /bin/sh SHELL = /bin/sh
WARN = -Wmissing-prototypes -Wformat WARN = -Wmissing-prototypes -Wformat
OPTS = "CC=$(CC)" OPTS = 'CC=$(CC)'
DIRS = src/util src/global src/dns src/master src/postfix src/smtpstone \ DIRS = src/util src/global src/dns src/master src/postfix src/smtpstone \
src/sendmail src/error src/pickup src/cleanup src/smtpd src/local \ src/sendmail src/error src/pickup src/cleanup src/smtpd src/local \
src/lmtp src/trivial-rewrite src/qmgr src/smtp src/bounce src/pipe \ src/lmtp src/trivial-rewrite src/qmgr src/smtp src/bounce src/pipe \

View File

@ -1,4 +1,3 @@
#
# PCRE_TABLE(5) PCRE_TABLE(5) # PCRE_TABLE(5) PCRE_TABLE(5)
# #
# NAME # NAME
@ -80,6 +79,13 @@
# /^Subject: make money fast/ REJECT # /^Subject: make money fast/ REJECT
# /^To: friend@public\.com/ REJECT # /^To: friend@public\.com/ REJECT
# #
# EXAMPLE BODY FILTER MAP
# # First skip over base 64 encoded text to save CPU cycles.
# # Requires PCRE version 3.
# ~^[[:alnum:]+/]{60,}$~ OK
#
# # Put your own body patterns here.
#
# SEE ALSO # SEE ALSO
# regexp_table(5) format of POSIX regular expression tables # regexp_table(5) format of POSIX regular expression tables
# #
@ -97,5 +103,4 @@
# P.O. Box 704 # P.O. Box 704
# Yorktown Heights, NY 10598, USA # Yorktown Heights, NY 10598, USA
# #
# 1 # PCRE_TABLE(5)
#

View File

@ -487,12 +487,12 @@ EOF
for name in cleanup flush for name in cleanup flush
do do
grep "^$name[ ]*unix[ ]*-" \ grep "^$name[ ]*unix[ ]*[-y]" \
$config_directory/master.cf >/dev/null && { $config_directory/master.cf >/dev/null && {
echo Editing $config_directory/master.cf, making the $name service public echo Editing $config_directory/master.cf, making the $name service public
ed $config_directory/master.cf <<EOF || exit 1 ed $config_directory/master.cf <<EOF || exit 1
/^$name[ ]*unix[ ]*-/ /^$name[ ]*unix[ ]*[-y]/
s/-/n/ s/[-y]/n/
p p
w w
q q

View File

@ -1,4 +1,3 @@
#
# REGEXP_TABLE(5) REGEXP_TABLE(5) # REGEXP_TABLE(5) REGEXP_TABLE(5)
# #
# NAME # NAME
@ -81,6 +80,12 @@
# /^Subject: make money fast/ REJECT # /^Subject: make money fast/ REJECT
# /^To: friend@public\.com/ REJECT # /^To: friend@public\.com/ REJECT
# #
# EXAMPLE BODY FILTER MAP
# # First skip over base 64 encoded text to save CPU cycles.
# ~^[[:alnum:]+/]{60,}$~ OK
#
# # Put your own body patterns here.
#
# SEE ALSO # SEE ALSO
# pcre_table(5) format of PCRE tables # pcre_table(5) format of PCRE tables
# #
@ -102,5 +107,4 @@
# P.O. Box 704 # P.O. Box 704
# Yorktown Heights, NY 10598, USA # Yorktown Heights, NY 10598, USA
# #
# 1 # REGEXP_TABLE(5)
#

View File

@ -259,6 +259,20 @@ myorigin = $myhostname
# policy (anti-UCE violations) and protocol error (broken mailers) # policy (anti-UCE violations) and protocol error (broken mailers)
# reports. # reports.
# #
# The error classes are:
#
# bounce: Send the postmaster copies of the headers of bounced mail.
# 2bounce: Send undeliverable bounced mail to the postmaster.
# delay: Send the postmaster copies of the headers of delayed mail.
# policy: Send the postmaster a transcript of the entire SMTP session
# when a client request was rejected because of (UCE) policy.
# protocol: Send the postmaster a transcript of the entire SMTP
# session in case of client or server protocol errors.
# resource: Inform the postmaster of mail not delivered due to
# resource problems.
# software: Inform the postmaster of mail not delivered due to
# software problems.
#
#notify_classes = bounce,delay,policy,protocol,resource,software #notify_classes = bounce,delay,policy,protocol,resource,software
#notify_classes = 2bounce,resource,software #notify_classes = 2bounce,resource,software
notify_classes = resource,software notify_classes = resource,software

View File

@ -37,3 +37,10 @@
# appended to the previous line (there should be no whitespace # appended to the previous line (there should be no whitespace
# before your regular expression!) # before your regular expression!)
# #
# Skip over base 64 encoded blocks. This saves lots of CPU cycles.
# Expressions by Liviu Daia, amended by Victor Duchovni.
# Requires PCRE version 3.
~^[[:alnum:]+/]{60,}\s*$~ OK
# Your own body patterns go here.

View File

@ -22,3 +22,9 @@
# IGNORE The header line is silently discarded. # IGNORE The header line is silently discarded.
# WARN The header is logged (not rejected) with a warning. # WARN The header is logged (not rejected) with a warning.
# WARN text.... As above, and the text is logged, too. # WARN text.... As above, and the text is logged, too.
# Skip over base 64 encoded blocks. This saves lots of CPU cycles.
# Expressions by Liviu Daia. Amended by Victor Duchovni.
~^[[:alnum:]+/]{60,}[:space:]*$~ OK
# Your own body patterns go here.

View File

@ -34,7 +34,8 @@
# #
# pattern result # pattern result
# When pattern matches the domain, use the corre- # When pattern matches the domain, use the corre-
# sponding result. # sponding result. A pattern of `*' matches all
# entries.
# #
# blank lines and comments # blank lines and comments
# Empty lines and whitespace-only lines are ignored, # Empty lines and whitespace-only lines are ignored,
@ -62,6 +63,16 @@
# ting. Otherwise, a domain name matches itself and # ting. Otherwise, a domain name matches itself and
# its subdomains. # its subdomains.
# #
# An empty result (`:' - default transport, default nexthop)
# behaves as though the transport map did not exist. When
# combined with a wildcard (`*') entry, this can be used to
# route internal mail directly, while using a relay for all
# outbound traffic. (Note that you should _NOT_ set
# relayhost in this case.)
#
# * smtp:outbound-relay.my.domain
# .my.domain :
#
# Note: transport map entries take precedence over domains # Note: transport map entries take precedence over domains
# specified in the mydestination parameter. If you use the # specified in the mydestination parameter. If you use the
# optional transport map, it may be safer to specify # optional transport map, it may be safer to specify

View File

@ -122,7 +122,7 @@ ACCESS(5) ACCESS(5)
tion schemes. tion schemes.
<i>restriction...</i> <i>restriction...</i>
Apply the named UCE restriction(s) (<b>permit</b>, reject, Apply the named UCE restriction(s) (<b>permit</b>, <b>reject</b>,
<b>reject</b><i>_</i><b>unauth</b><i>_</i><b>destination</b>, and so on). <b>reject</b><i>_</i><b>unauth</b><i>_</i><b>destination</b>, and so on).
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b> <b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
FLUSH(8) FLUSH(8) FLUSH(8) FLUSH(8)
<b>NAME</b> <b>NAME</b>
@ -156,6 +155,5 @@ FLUSH(8) FLUSH(8)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 FLUSH(8)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
PCRE_TABLE(5) PCRE_TABLE(5) PCRE_TABLE(5) PCRE_TABLE(5)
<b>NAME</b> <b>NAME</b>
@ -81,6 +80,13 @@ PCRE_TABLE(5) PCRE_TABLE(5)
/^Subject: make money fast/ REJECT /^Subject: make money fast/ REJECT
/^To: friend@public\.com/ REJECT /^To: friend@public\.com/ REJECT
<b>EXAMPLE</b> <b>BODY</b> <b>FILTER</b> <b>MAP</b>
# First skip over base 64 encoded text to save CPU cycles.
# Requires PCRE version 3.
~^[[:alnum:]+/]{60,}$~ OK
# Put your own body patterns here.
<b>SEE</b> <b>ALSO</b> <b>SEE</b> <b>ALSO</b>
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables <a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
@ -98,6 +104,5 @@ PCRE_TABLE(5) PCRE_TABLE(5)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 PCRE_TABLE(5)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
PICKUP(8) PICKUP(8) PICKUP(8) PICKUP(8)
<b>NAME</b> <b>NAME</b>
@ -80,6 +79,5 @@ PICKUP(8) PICKUP(8)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 PICKUP(8)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
PIPE(8) PIPE(8) PIPE(8) PIPE(8)
<b>NAME</b> <b>NAME</b>
@ -44,7 +43,7 @@ PIPE(8) PIPE(8)
file at the end of a service definition. The syntax is as file at the end of a service definition. The syntax is as
follows: follows:
<b>flags=BFRhqu.</b>&gt; (optional) <b>flags=BDFRhqu.</b>&gt; (optional)
Optional message processing flags. By default, a Optional message processing flags. By default, a
message is copied unchanged. message is copied unchanged.
@ -53,6 +52,11 @@ PIPE(8) PIPE(8)
agents that recognize "<b>From</b> " lines only agents that recognize "<b>From</b> " lines only
when preceded by a blank line. when preceded by a blank line.
<b>D</b> Prepend a "<b>Delivered-To:</b> <i>recipient</i>" message
header with the envelope recipient address.
Note: for this to work, the <i>transport_</i><b>desti-</b>
<b>nation</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> must be 1.
<b>F</b> Prepend a "<b>From</b> <i>sender</i> <i>time_stamp</i>" envelope <b>F</b> Prepend a "<b>From</b> <i>sender</i> <i>time_stamp</i>" envelope
header to the message content. This is header to the message content. This is
expected by, for example, <b>UUCP</b> software. expected by, for example, <b>UUCP</b> software.
@ -267,6 +271,5 @@ PIPE(8) PIPE(8)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 PIPE(8)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,12 +1,11 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
POSTALIAS(1) POSTALIAS(1) POSTALIAS(1) POSTALIAS(1)
<b>NAME</b> <b>NAME</b>
postalias - Postfix alias database maintenance postalias - Postfix alias database maintenance
<b>SYNOPSIS</b> <b>SYNOPSIS</b>
<b>postalias</b> [<b>-Nfinrvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>] <b>postalias</b> [<b>-Nfinorvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
[<i>file_type</i>:]<i>file_name</i> ... [<i>file_type</i>:]<i>file_name</i> ...
<b>DESCRIPTION</b> <b>DESCRIPTION</b>
@ -16,6 +15,10 @@ POSTALIAS(1) POSTALIAS(1)
Sendmail version 8, and are expected to be suitable for Sendmail version 8, and are expected to be suitable for
the use as NIS alias maps. the use as NIS alias maps.
If the result files do not exist they will be created with
the same group and other read permissions as the source
file.
While a database update is in progress, signal delivery is While a database update is in progress, signal delivery is
postponed, and an exclusive, advisory, lock is placed on postponed, and an exclusive, advisory, lock is placed on
the entire database, in order to avoid surprises in spec- the entire database, in order to avoid surprises in spec-
@ -55,6 +58,11 @@ POSTALIAS(1) POSTALIAS(1)
Postfix does whatever is the default for the host Postfix does whatever is the default for the host
operating system. operating system.
<b>-o</b> Do not release root privileges when processing a
non-root input file. By default, <b>postalias</b> drops
root privileges and runs as the source file owner
instead.
<b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the
first value found on the standard output stream. first value found on the standard output stream.
The exit status is zero when the requested informa- The exit status is zero when the requested informa-
@ -109,7 +117,7 @@ POSTALIAS(1) POSTALIAS(1)
skipped and are flagged with a warning. skipped and are flagged with a warning.
<b>postalias</b> terminates with zero exit status in case of suc- <b>postalias</b> terminates with zero exit status in case of suc-
cess (including successful <b>postmap</b> <b>-q</b> lookup) and termi- cess (including successful <b>postalias</b> <b>-q</b> lookup) and termi-
nates with non-zero exit status in case of failure. nates with non-zero exit status in case of failure.
<b>ENVIRONMENT</b> <b>ENVIRONMENT</b>
@ -145,6 +153,5 @@ POSTALIAS(1) POSTALIAS(1)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 POSTALIAS(1)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
POSTCONF(1) POSTCONF(1) POSTCONF(1) POSTCONF(1)
<b>NAME</b> <b>NAME</b>
@ -36,7 +35,23 @@ POSTCONF(1) POSTCONF(1)
label that normally precedes the value. label that normally precedes the value.
<b>-l</b> List the names of all supported mailbox locking <b>-l</b> List the names of all supported mailbox locking
methods. methods. Postfix supports the following methods:
<b>flock</b> A kernel-based advisory locking method for
local files only. This locking method is
available only on systems with a BSD compat-
ible library.
<b>fcntl</b> A kernel-based advisory locking method for
local and remote files.
<b>dotlock</b>
An application-level locking method. An
application locks a file named <i>filename</i> by
creating a file named <i>filename</i><b>.lock</b>. The
application is expected to remove its own
lock file, as well as stale lock files that
were left behind after abnormal termination.
<b>-m</b> List the names of all supported lookup table types. <b>-m</b> List the names of all supported lookup table types.
@ -59,6 +74,5 @@ POSTCONF(1) POSTCONF(1)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 POSTCONF(1)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
POSTDROP(1) POSTDROP(1) POSTDROP(1) POSTDROP(1)
<b>NAME</b> <b>NAME</b>
@ -87,6 +86,5 @@ POSTDROP(1) POSTDROP(1)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 POSTDROP(1)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,12 +1,11 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
POSTMAP(1) POSTMAP(1) POSTMAP(1) POSTMAP(1)
<b>NAME</b> <b>NAME</b>
postmap - Postfix lookup table management postmap - Postfix lookup table management
<b>SYNOPSIS</b> <b>SYNOPSIS</b>
<b>postmap</b> [<b>-Nfinrvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>] <b>postmap</b> [<b>-Nfinorvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
[<i>file_type</i>:]<i>file_name</i> ... [<i>file_type</i>:]<i>file_name</i> ...
<b>DESCRIPTION</b> <b>DESCRIPTION</b>
@ -80,6 +79,11 @@ POSTMAP(1) POSTMAP(1)
Postfix does whatever is the default for the host Postfix does whatever is the default for the host
operating system. operating system.
<b>-o</b> Do not release root privileges when processing a
non-root input file. By default, <b>postmap</b> drops root
privileges and runs as the source file owner
instead.
<b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the
first value found on the standard output stream. first value found on the standard output stream.
The exit status is zero when the requested informa- The exit status is zero when the requested informa-
@ -159,6 +163,5 @@ POSTMAP(1) POSTMAP(1)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 POSTMAP(1)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
REGEXP_TABLE(5) REGEXP_TABLE(5) REGEXP_TABLE(5) REGEXP_TABLE(5)
<b>NAME</b> <b>NAME</b>
@ -82,6 +81,12 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
/^Subject: make money fast/ REJECT /^Subject: make money fast/ REJECT
/^To: friend@public\.com/ REJECT /^To: friend@public\.com/ REJECT
<b>EXAMPLE</b> <b>BODY</b> <b>FILTER</b> <b>MAP</b>
# First skip over base 64 encoded text to save CPU cycles.
~^[[:alnum:]+/]{60,}$~ OK
# Put your own body patterns here.
<b>SEE</b> <b>ALSO</b> <b>SEE</b> <b>ALSO</b>
<a href="pcre_table.5.html">pcre_table(5)</a> format of PCRE tables <a href="pcre_table.5.html">pcre_table(5)</a> format of PCRE tables
@ -103,6 +108,5 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 REGEXP_TABLE(5)
</pre> </body> </html> </pre> </body> </html>

View File

@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8)
<b>NAME</b> <b>NAME</b>
@ -141,6 +140,5 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 TRIVIAL-REWRITE(8)
</pre> </body> </html> </pre> </body> </html>

View File

@ -379,7 +379,7 @@ UCE software can be stopped by being strict here.
By default, this restriction is applied when the client sends the By default, this restriction is applied when the client sends the
RCPT TO command. In order to have the restriction take effect RCPT TO command. In order to have the restriction take effect
as soon as possible, specify <b>smtpd_delay_reject = yes</b> in as soon as possible, specify <b>smtpd_delay_reject = no</b> in
the Postfix <b>main.cf</b> configuration file. Doing so may cause the Postfix <b>main.cf</b> configuration file. Doing so may cause
unexpected results with poorly implemented client software. unexpected results with poorly implemented client software.
@ -550,7 +550,7 @@ addresses this system accepts in MAIL FROM commands.
By default, this restriction is applied when the client sends the By default, this restriction is applied when the client sends the
RCPT TO command. In order to have the restriction take effect RCPT TO command. In order to have the restriction take effect
as soon as possible, specify <b>smtpd_delay_reject = yes</b> in as soon as possible, specify <b>smtpd_delay_reject = no</b> in
the Postfix <b>main.cf</b> configuration file. Doing so may cause the Postfix <b>main.cf</b> configuration file. Doing so may cause
unexpected results with poorly implemented client software. unexpected results with poorly implemented client software.

View File

@ -187,16 +187,16 @@ case "$SYSTEM.$RELEASE" in
echo "See the RELEASE_NOTES file for more information." 1>&2 echo "See the RELEASE_NOTES file for more information." 1>&2
exit 1 exit 1
fi fi
# See where GDBM's ndbm.h include file sits. # GDBM locks the DBM .pag file after open. This breaks postmap.
if [ -f /usr/include/gdbm-ndbm.h ] # if [ -f /usr/include/gdbm-ndbm.h ]
then # then
CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H='<gdbm-ndbm.h>'" # CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H='<gdbm-ndbm.h>'"
GDBM_LIBS=gdbm # GDBM_LIBS=gdbm
elif [ -f /usr/include/gdbm/ndbm.h ] # elif [ -f /usr/include/gdbm/ndbm.h ]
then # then
CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H='<gdbm/ndbm.h>'" # CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H='<gdbm/ndbm.h>'"
GDBM_LIBS=gdbm # GDBM_LIBS=gdbm
fi # fi
SYSLIBS="-ldb" SYSLIBS="-ldb"
for name in nsl resolv $GDBM_LIBS for name in nsl resolv $GDBM_LIBS
do do
@ -309,5 +309,5 @@ OPT = $OPT
DEBUG = $DEBUG DEBUG = $DEBUG
AWK = $AWK AWK = $AWK
STRCASE = $STRCASE STRCASE = $STRCASE
EXPORT = AUXLIBS="$AUXLIBS" CCARGS="$CCARGS" OPT="$OPT" DEBUG="$DEBUG" EXPORT = AUXLIBS='$AUXLIBS' CCARGS='$CCARGS' OPT='$OPT' DEBUG='$DEBUG'
EOF EOF

View File

@ -9,7 +9,7 @@ Postfix alias database maintenance
.na .na
.nf .nf
.fi .fi
\fBpostalias\fR [\fB-Nfinrvw\fR] [\fB-c \fIconfig_dir\fR] \fBpostalias\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
[\fB-d \fIkey\fR] [\fB-q \fIkey\fR] [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
[\fIfile_type\fR:]\fIfile_name\fR ... [\fIfile_type\fR:]\fIfile_name\fR ...
.SH DESCRIPTION .SH DESCRIPTION
@ -20,6 +20,9 @@ alias databases, or updates an existing one. The input and output
file formats are expected to be compatible with Sendmail version 8, file formats are expected to be compatible with Sendmail version 8,
and are expected to be suitable for the use as NIS alias maps. and are expected to be suitable for the use as NIS alias maps.
If the result files do not exist they will be created with the
same group and other read permissions as the source file.
While a database update is in progress, signal delivery is While a database update is in progress, signal delivery is
postponed, and an exclusive, advisory, lock is placed on the postponed, and an exclusive, advisory, lock is placed on the
entire database, in order to avoid surprises in spectator entire database, in order to avoid surprises in spectator
@ -51,6 +54,10 @@ a new database from the entries in \fBfile_name\fR.
Don't include the terminating null character that terminates lookup Don't include the terminating null character that terminates lookup
keys and values. By default, Postfix does whatever is the default for keys and values. By default, Postfix does whatever is the default for
the host operating system. the host operating system.
.IP \fB-o\fR
Do not release root privileges when processing a non-root
input file. By default, \fBpostalias\fR drops root privileges
and runs as the source file owner instead.
.IP "\fB-q \fIkey\fR" .IP "\fB-q \fIkey\fR"
Search the specified maps for \fIkey\fR and print the first value Search the specified maps for \fIkey\fR and print the first value
found on the standard output stream. The exit status is zero found on the standard output stream. The exit status is zero
@ -99,7 +106,7 @@ no problems were detected. Duplicate entries are skipped and are
flagged with a warning. flagged with a warning.
\fBpostalias\fR terminates with zero exit status in case of success \fBpostalias\fR terminates with zero exit status in case of success
(including successful \fBpostmap -q\fR lookup) and terminates (including successful \fBpostalias -q\fR lookup) and terminates
with non-zero exit status in case of failure. with non-zero exit status in case of failure.
.SH ENVIRONMENT .SH ENVIRONMENT
.na .na

View File

@ -38,6 +38,20 @@ Show parameter values only, not the ``name = '' label
that normally precedes the value. that normally precedes the value.
.IP \fB-l\fR .IP \fB-l\fR
List the names of all supported mailbox locking methods. List the names of all supported mailbox locking methods.
Postfix supports the following methods:
.RS
.IP \fBflock\fR
A kernel-based advisory locking method for local files only.
This locking method is available only on systems with a BSD
compatible library.
.IP \fBfcntl\fR
A kernel-based advisory locking method for local and remote files.
.IP \fBdotlock\fR
An application-level locking method. An application locks a file
named \fIfilename\fR by creating a file named \fIfilename\fB.lock\fR.
The application is expected to remove its own lock file, as well as
stale lock files that were left behind after abnormal termination.
.RE
.IP \fB-m\fR .IP \fB-m\fR
List the names of all supported lookup table types. List the names of all supported lookup table types.
.IP \fB-n\fR .IP \fB-n\fR

View File

@ -9,7 +9,7 @@ Postfix lookup table management
.na .na
.nf .nf
.fi .fi
\fBpostmap\fR [\fB-Nfinrvw\fR] [\fB-c \fIconfig_dir\fR] \fBpostmap\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
[\fB-d \fIkey\fR] [\fB-q \fIkey\fR] [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
[\fIfile_type\fR:]\fIfile_name\fR ... [\fIfile_type\fR:]\fIfile_name\fR ...
.SH DESCRIPTION .SH DESCRIPTION
@ -75,6 +75,10 @@ a new database from the entries in \fBfile_name\fR.
Don't include the terminating null character that terminates lookup Don't include the terminating null character that terminates lookup
keys and values. By default, Postfix does whatever is the default for keys and values. By default, Postfix does whatever is the default for
the host operating system. the host operating system.
.IP \fB-o\fR
Do not release root privileges when processing a non-root
input file. By default, \fBpostmap\fR drops root privileges
and runs as the source file owner instead.
.IP "\fB-q \fIkey\fR" .IP "\fB-q \fIkey\fR"
Search the specified maps for \fIkey\fR and print the first value Search the specified maps for \fIkey\fR and print the first value
found on the standard output stream. The exit status is zero found on the standard output stream. The exit status is zero

View File

@ -119,7 +119,7 @@ Accept the address etc. that matches the pattern.
An all-numerical result is treated as OK. This format is An all-numerical result is treated as OK. This format is
generated by address-based relay authorization schemes. generated by address-based relay authorization schemes.
.IP \fIrestriction...\fR .IP \fIrestriction...\fR
Apply the named UCE restriction(s) (\fBpermit\fR, \fRreject\fR, Apply the named UCE restriction(s) (\fBpermit\fR, \fBreject\fR,
\fBreject_unauth_destination\fR, and so on). \fBreject_unauth_destination\fR, and so on).
.SH REGULAR EXPRESSION TABLES .SH REGULAR EXPRESSION TABLES
.na .na

View File

@ -77,6 +77,14 @@ or $(n) if they aren't followed by whitespace.
.nf .nf
/^Subject: make money fast/ REJECT /^Subject: make money fast/ REJECT
/^To: friend@public\\.com/ REJECT /^To: friend@public\\.com/ REJECT
.SH EXAMPLE BODY FILTER MAP
.na
.nf
# First skip over base 64 encoded text to save CPU cycles.
# Requires PCRE version 3.
~^[[:alnum:]+/]{60,}$~ OK
# Put your own body patterns here.
.SH SEE ALSO .SH SEE ALSO
.na .na
.nf .nf

View File

@ -78,6 +78,13 @@ by whitespace.
# These were once common in junk mail. # These were once common in junk mail.
/^Subject: make money fast/ REJECT /^Subject: make money fast/ REJECT
/^To: friend@public\\.com/ REJECT /^To: friend@public\\.com/ REJECT
.SH EXAMPLE BODY FILTER MAP
.na
.nf
# First skip over base 64 encoded text to save CPU cycles.
~^[[:alnum:]+/]{60,}$~ OK
# Put your own body patterns here.
.SH SEE ALSO .SH SEE ALSO
.na .na
.nf .nf

View File

@ -50,7 +50,7 @@ entry for the pipe-based delivery transport.
.fi .fi
The external command attributes are given in the \fBmaster.cf\fR The external command attributes are given in the \fBmaster.cf\fR
file at the end of a service definition. The syntax is as follows: file at the end of a service definition. The syntax is as follows:
.IP "\fBflags=BFRhqu.>\fR (optional)" .IP "\fBflags=BDFRhqu.>\fR (optional)"
Optional message processing flags. By default, a message is Optional message processing flags. By default, a message is
copied unchanged. copied unchanged.
.RS .RS
@ -58,6 +58,10 @@ copied unchanged.
Append a blank line at the end of each message. This is required Append a blank line at the end of each message. This is required
by some mail user agents that recognize "\fBFrom \fR" lines only by some mail user agents that recognize "\fBFrom \fR" lines only
when preceded by a blank line. when preceded by a blank line.
.IP \fBD\fR
Prepend a "\fBDelivered-To: \fIrecipient\fR" message header with the
envelope recipient address. Note: for this to work, the
\fItransport\fB_destination_recipient_limit\fR must be 1.
.IP \fBF\fR .IP \fBF\fR
Prepend a "\fBFrom \fIsender time_stamp\fR" envelope header to Prepend a "\fBFrom \fIsender time_stamp\fR" envelope header to
the message content. the message content.

View File

@ -103,7 +103,7 @@
# An all-numerical result is treated as OK. This format is # An all-numerical result is treated as OK. This format is
# generated by address-based relay authorization schemes. # generated by address-based relay authorization schemes.
# .IP \fIrestriction...\fR # .IP \fIrestriction...\fR
# Apply the named UCE restriction(s) (\fBpermit\fR, \fRreject\fR, # Apply the named UCE restriction(s) (\fBpermit\fR, \fBreject\fR,
# \fBreject_unauth_destination\fR, and so on). # \fBreject_unauth_destination\fR, and so on).
# REGULAR EXPRESSION TABLES # REGULAR EXPRESSION TABLES
# .ad # .ad

View File

@ -67,6 +67,12 @@
# EXAMPLE HEADER FILTER MAP # EXAMPLE HEADER FILTER MAP
# /^Subject: make money fast/ REJECT # /^Subject: make money fast/ REJECT
# /^To: friend@public\\.com/ REJECT # /^To: friend@public\\.com/ REJECT
# EXAMPLE BODY FILTER MAP
# # First skip over base 64 encoded text to save CPU cycles.
# # Requires PCRE version 3.
# ~^[[:alnum:]+/]{60,}$~ OK
#
# # Put your own body patterns here.
# SEE ALSO # SEE ALSO
# regexp_table(5) format of POSIX regular expression tables # regexp_table(5) format of POSIX regular expression tables
# AUTHOR(S) # AUTHOR(S)

View File

@ -68,6 +68,11 @@
# # These were once common in junk mail. # # These were once common in junk mail.
# /^Subject: make money fast/ REJECT # /^Subject: make money fast/ REJECT
# /^To: friend@public\\.com/ REJECT # /^To: friend@public\\.com/ REJECT
# EXAMPLE BODY FILTER MAP
# # First skip over base 64 encoded text to save CPU cycles.
# ~^[[:alnum:]+/]{60,}$~ OK
#
# # Put your own body patterns here.
# SEE ALSO # SEE ALSO
# pcre_table(5) format of PCRE tables # pcre_table(5) format of PCRE tables
# AUTHOR(S) # AUTHOR(S)

View File

@ -20,15 +20,17 @@
* Patches change the patchlevel and the release date. Snapshots change the * Patches change the patchlevel and the release date. Snapshots change the
* release date only, unless they include the same bugfix as a patch release. * release date only, unless they include the same bugfix as a patch release.
*/ */
#define MAIL_RELEASE_DATE "20020501"
#define VAR_MAIL_VERSION "mail_version" #define VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "1.1.7-$mail_release_date" #define DEF_MAIL_VERSION "1.1.7-" MAIL_RELEASE_DATE
extern char *var_mail_version; extern char *var_mail_version;
/* /*
* Release date. * Release date.
*/ */
#define VAR_MAIL_RELEASE "mail_release_date" #define VAR_MAIL_RELEASE "mail_release_date"
#define DEF_MAIL_RELEASE "20020331" #define DEF_MAIL_RELEASE MAIL_RELEASE_DATE
extern char *var_mail_release; extern char *var_mail_release;
/* LICENSE /* LICENSE

View File

@ -37,6 +37,10 @@
#include <sys_defs.h> #include <sys_defs.h>
/* Global library. */
#include "mail_conf.h"
/* Utility library. */ /* Utility library. */
#include <msg.h> #include <msg.h>
@ -58,11 +62,31 @@
/* mkmap_db_open - create or open database */ /* mkmap_db_open - create or open database */
/*
* db_mpool_size" is defined in util/dict_db.c and defaults to 256K,
* which works well for the lookup code.
*
* We use a larger memory pool when building ".db" files.
* For "hash" files performance degrades rapidly unless the memory pool
* is O(file size).
*
* For "btree" files peformance is good with sorted input even for small
* memory pools, but with random input degrades rapidly unless the memory
* pool is O(file size).
*/
extern int db_mpool_size;
#define VAR_MPOOL_SIZE "db_mkmap_mpool_size"
#define DEF_MPOOL_SIZE 16777216 /* 16MB */
static MKMAP *mkmap_db_open(const char *path, static MKMAP *mkmap_db_open(const char *path,
DICT *(*db_open) (const char *, int, int)) DICT *(*db_open) (const char *, int, int))
{ {
MKMAP *mkmap = (MKMAP *) mymalloc(sizeof(*mkmap)); MKMAP *mkmap = (MKMAP *) mymalloc(sizeof(*mkmap));
/* Override default mpool size for map rebuilds */
db_mpool_size = get_mail_conf_int(VAR_MPOOL_SIZE, DEF_MPOOL_SIZE, 0, 0);
/* /*
* Fill in the generic members. * Fill in the generic members.
*/ */

View File

@ -1,6 +1,6 @@
/*++ /*++
/* NAME /* NAME
/* mkmap 3 /* mkmap_dbm 3
/* SUMMARY /* SUMMARY
/* create or open database, DBM style /* create or open database, DBM style
/* SYNOPSIS /* SYNOPSIS

View File

@ -40,7 +40,7 @@
/* .fi /* .fi
/* The external command attributes are given in the \fBmaster.cf\fR /* The external command attributes are given in the \fBmaster.cf\fR
/* file at the end of a service definition. The syntax is as follows: /* file at the end of a service definition. The syntax is as follows:
/* .IP "\fBflags=BFRhqu.>\fR (optional)" /* .IP "\fBflags=BDFRhqu.>\fR (optional)"
/* Optional message processing flags. By default, a message is /* Optional message processing flags. By default, a message is
/* copied unchanged. /* copied unchanged.
/* .RS /* .RS
@ -48,6 +48,10 @@
/* Append a blank line at the end of each message. This is required /* Append a blank line at the end of each message. This is required
/* by some mail user agents that recognize "\fBFrom \fR" lines only /* by some mail user agents that recognize "\fBFrom \fR" lines only
/* when preceded by a blank line. /* when preceded by a blank line.
/* .IP \fBD\fR
/* Prepend a "\fBDelivered-To: \fIrecipient\fR" message header with the
/* envelope recipient address. Note: for this to work, the
/* \fItransport\fB_destination_recipient_limit\fR must be 1.
/* .IP \fBF\fR /* .IP \fBF\fR
/* Prepend a "\fBFrom \fIsender time_stamp\fR" envelope header to /* Prepend a "\fBFrom \fIsender time_stamp\fR" envelope header to
/* the message content. /* the message content.
@ -580,6 +584,9 @@ static void get_service_attr(PIPE_ATTR *attr, char **argv)
case 'R': case 'R':
attr->flags |= MAIL_COPY_RETURN_PATH; attr->flags |= MAIL_COPY_RETURN_PATH;
break; break;
case 'D':
attr->flags |= MAIL_COPY_DELIVERED;
break;
case 'h': case 'h':
attr->flags |= PIPE_OPT_FOLD_HOST; attr->flags |= PIPE_OPT_FOLD_HOST;
break; break;
@ -781,6 +788,19 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
get_service_attr(&attr, argv); get_service_attr(&attr, argv);
} }
/*
* The D flag cannot be specified for multi-recipient deliveries.
*/
if ((attr.flags & MAIL_COPY_DELIVERED) && (rcpt_list->len > 1)) {
deliver_status = eval_command_status(PIPE_STAT_DEFER, service,
request, request->fp,
"mailer configuration error");
msg_warn("pipe flag `D' requires %s_destination_recipient_limit = 1",
service);
DELIVER_MSG_CLEANUP();
return (deliver_status);
}
/* /*
* Check that this agent accepts messages this large. * Check that this agent accepts messages this large.
*/ */
@ -831,6 +851,7 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
PIPE_CMD_TIME_LIMIT, conf.time_limit, PIPE_CMD_TIME_LIMIT, conf.time_limit,
PIPE_CMD_EOL, STR(attr.eol), PIPE_CMD_EOL, STR(attr.eol),
PIPE_CMD_EXPORT, export_env->argv, PIPE_CMD_EXPORT, export_env->argv,
PIPE_CMD_DELIVERED, rcpt_list->info[0].address,
PIPE_CMD_END); PIPE_CMD_END);
argv_free(export_env); argv_free(export_env);

View File

@ -5,7 +5,7 @@
/* Postfix alias database maintenance /* Postfix alias database maintenance
/* SYNOPSIS /* SYNOPSIS
/* .fi /* .fi
/* \fBpostalias\fR [\fB-Nfinrvw\fR] [\fB-c \fIconfig_dir\fR] /* \fBpostalias\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
/* [\fB-d \fIkey\fR] [\fB-q \fIkey\fR] /* [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
/* [\fIfile_type\fR:]\fIfile_name\fR ... /* [\fIfile_type\fR:]\fIfile_name\fR ...
/* DESCRIPTION /* DESCRIPTION
@ -14,6 +14,9 @@
/* file formats are expected to be compatible with Sendmail version 8, /* file formats are expected to be compatible with Sendmail version 8,
/* and are expected to be suitable for the use as NIS alias maps. /* and are expected to be suitable for the use as NIS alias maps.
/* /*
/* If the result files do not exist they will be created with the
/* same group and other read permissions as the source file.
/*
/* While a database update is in progress, signal delivery is /* While a database update is in progress, signal delivery is
/* postponed, and an exclusive, advisory, lock is placed on the /* postponed, and an exclusive, advisory, lock is placed on the
/* entire database, in order to avoid surprises in spectator /* entire database, in order to avoid surprises in spectator
@ -45,6 +48,10 @@
/* Don't include the terminating null character that terminates lookup /* Don't include the terminating null character that terminates lookup
/* keys and values. By default, Postfix does whatever is the default for /* keys and values. By default, Postfix does whatever is the default for
/* the host operating system. /* the host operating system.
/* .IP \fB-o\fR
/* Do not release root privileges when processing a non-root
/* input file. By default, \fBpostalias\fR drops root privileges
/* and runs as the source file owner instead.
/* .IP "\fB-q \fIkey\fR" /* .IP "\fB-q \fIkey\fR"
/* Search the specified maps for \fIkey\fR and print the first value /* Search the specified maps for \fIkey\fR and print the first value
/* found on the standard output stream. The exit status is zero /* found on the standard output stream. The exit status is zero
@ -91,7 +98,7 @@
/* flagged with a warning. /* flagged with a warning.
/* /*
/* \fBpostalias\fR terminates with zero exit status in case of success /* \fBpostalias\fR terminates with zero exit status in case of success
/* (including successful \fBpostmap -q\fR lookup) and terminates /* (including successful \fBpostalias -q\fR lookup) and terminates
/* with non-zero exit status in case of failure. /* with non-zero exit status in case of failure.
/* ENVIRONMENT /* ENVIRONMENT
/* .ad /* .ad
@ -147,6 +154,7 @@
#include <split_at.h> #include <split_at.h>
#include <get_hostname.h> #include <get_hostname.h>
#include <vstring_vstream.h> #include <vstring_vstream.h>
#include <set_eugid.h>
/* Global library. */ /* Global library. */
@ -159,9 +167,11 @@
#define STR vstring_str #define STR vstring_str
#define POSTALIAS_FLAG_AS_OWNER (1<<0) /* open dest as owner of source */
/* postalias - create or update alias database */ /* postalias - create or update alias database */
static void postalias(char *map_type, char *path_name, static void postalias(char *map_type, char *path_name, int postalias_flags,
int open_flags, int dict_flags) int open_flags, int dict_flags)
{ {
VSTREAM *source_fp; VSTREAM *source_fp;
@ -174,6 +184,8 @@ static void postalias(char *map_type, char *path_name,
TOK822 *key_list; TOK822 *key_list;
TOK822 *colon; TOK822 *colon;
TOK822 *value_list; TOK822 *value_list;
struct stat st;
mode_t saved_mask;
/* /*
* Initialize. * Initialize.
@ -187,6 +199,24 @@ static void postalias(char *map_type, char *path_name,
} else if ((source_fp = vstream_fopen(path_name, O_RDONLY, 0)) == 0) { } else if ((source_fp = vstream_fopen(path_name, O_RDONLY, 0)) == 0) {
msg_fatal("open %s: %m", path_name); msg_fatal("open %s: %m", path_name);
} }
if (fstat(vstream_fileno(source_fp), &st) < 0)
msg_fatal("fstat %s: %m", path_name);
/*
* Turn off group/other read permissions as indicated in the source file.
*/
if (S_ISREG(st.st_mode))
saved_mask = umask(022 | (~st.st_mode & 077));
/*
* If running as root, run as the owner of the source file, so that the
* result shows proper ownership, and so that a bug in postalias does not
* allow privilege escalation.
*/
if ((postalias_flags & POSTALIAS_FLAG_AS_OWNER) && getuid() == 0
&& (st.st_uid != geteuid() || st.st_gid != getegid()))
set_eugid(st.st_uid, st.st_gid);
/* /*
* Open the database, create it when it does not exist, truncate it when * Open the database, create it when it does not exist, truncate it when
@ -194,6 +224,12 @@ static void postalias(char *map_type, char *path_name,
*/ */
mkmap = mkmap_open(map_type, path_name, open_flags, dict_flags); mkmap = mkmap_open(map_type, path_name, open_flags, dict_flags);
/*
* And restore the umask, in case it matters.
*/
if (S_ISREG(st.st_mode))
umask(saved_mask);
/* /*
* Add records to the database. * Add records to the database.
*/ */
@ -439,7 +475,7 @@ static int postalias_delete(const char *map_type, const char *map_name,
static NORETURN usage(char *myname) static NORETURN usage(char *myname)
{ {
msg_fatal("usage: %s [-Nfinrvw] [-c config_dir] [-d key] [-q key] [map_type:]file...", msg_fatal("usage: %s [-Nfinorvw] [-c config_dir] [-d key] [-q key] [map_type:]file...",
myname); myname);
} }
@ -450,6 +486,7 @@ int main(int argc, char **argv)
int fd; int fd;
char *slash; char *slash;
struct stat st; struct stat st;
int postalias_flags = POSTALIAS_FLAG_AS_OWNER;
int open_flags = O_RDWR | O_CREAT | O_TRUNC; int open_flags = O_RDWR | O_CREAT | O_TRUNC;
int dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_KEY; int dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_KEY;
char *query = 0; char *query = 0;
@ -489,7 +526,7 @@ int main(int argc, char **argv)
/* /*
* Parse JCL. * Parse JCL.
*/ */
while ((ch = GETOPT(argc, argv, "Nc:d:finq:rvw")) > 0) { while ((ch = GETOPT(argc, argv, "Nc:d:finoq:rvw")) > 0) {
switch (ch) { switch (ch) {
default: default:
usage(argv[0]); usage(argv[0]);
@ -517,6 +554,9 @@ int main(int argc, char **argv)
dict_flags |= DICT_FLAG_TRY0NULL; dict_flags |= DICT_FLAG_TRY0NULL;
dict_flags &= ~DICT_FLAG_TRY1NULL; dict_flags &= ~DICT_FLAG_TRY1NULL;
break; break;
case 'o':
postalias_flags &= ~POSTALIAS_FLAG_AS_OWNER;
break;
case 'q': case 'q':
if (query || delkey) if (query || delkey)
msg_fatal("specify only one of -q or -d"); msg_fatal("specify only one of -q or -d");
@ -580,9 +620,11 @@ int main(int argc, char **argv)
usage(argv[0]); usage(argv[0]);
while (optind < argc) { while (optind < argc) {
if ((path_name = split_at(argv[optind], ':')) != 0) { if ((path_name = split_at(argv[optind], ':')) != 0) {
postalias(argv[optind], path_name, open_flags, dict_flags); postalias(argv[optind], path_name, postalias_flags,
open_flags, dict_flags);
} else { } else {
postalias(var_db_type, argv[optind], open_flags, dict_flags); postalias(var_db_type, argv[optind], postalias_flags,
open_flags, dict_flags);
} }
optind++; optind++;
} }

View File

@ -32,6 +32,20 @@
/* that normally precedes the value. /* that normally precedes the value.
/* .IP \fB-l\fR /* .IP \fB-l\fR
/* List the names of all supported mailbox locking methods. /* List the names of all supported mailbox locking methods.
/* Postfix supports the following methods:
/* .RS
/* .IP \fBflock\fR
/* A kernel-based advisory locking method for local files only.
/* This locking method is available only on systems with a BSD
/* compatible library.
/* .IP \fBfcntl\fR
/* A kernel-based advisory locking method for local and remote files.
/* .IP \fBdotlock\fR
/* An application-level locking method. An application locks a file
/* named \fIfilename\fR by creating a file named \fIfilename\fB.lock\fR.
/* The application is expected to remove its own lock file, as well as
/* stale lock files that were left behind after abnormal termination.
/* .RE
/* .IP \fB-m\fR /* .IP \fB-m\fR
/* List the names of all supported lookup table types. /* List the names of all supported lookup table types.
/* .IP \fB-n\fR /* .IP \fB-n\fR
@ -800,7 +814,7 @@ int main(int argc, char **argv)
/* /*
* Parse JCL. * Parse JCL.
*/ */
while ((ch = GETOPT(argc, argv, "c:dehmlnv")) > 0) { while ((ch = GETOPT(argc, argv, "c:deEhmlnv")) > 0) {
switch (ch) { switch (ch) {
case 'c': case 'c':
if (setenv(CONF_ENV_PATH, optarg, 1) < 0) if (setenv(CONF_ENV_PATH, optarg, 1) < 0)
@ -812,6 +826,18 @@ int main(int argc, char **argv)
case 'e': case 'e':
mode |= EDIT_MAIN; mode |= EDIT_MAIN;
break; break;
/*
* People, this does not work unless you properly handle default
* settings. For example, fast_flush_domains = $relay_domains
* must not evaluate to the empty string when relay_domains is
* left at its default setting of $mydestination.
*/
#if 0
case 'E':
mode |= SHOW_EVAL;
break;
#endif
case 'h': case 'h':
mode &= ~SHOW_NAME; mode &= ~SHOW_NAME;
break; break;

View File

@ -5,7 +5,7 @@
/* Postfix lookup table management /* Postfix lookup table management
/* SYNOPSIS /* SYNOPSIS
/* .fi /* .fi
/* \fBpostmap\fR [\fB-Nfinrvw\fR] [\fB-c \fIconfig_dir\fR] /* \fBpostmap\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
/* [\fB-d \fIkey\fR] [\fB-q \fIkey\fR] /* [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
/* [\fIfile_type\fR:]\fIfile_name\fR ... /* [\fIfile_type\fR:]\fIfile_name\fR ...
/* DESCRIPTION /* DESCRIPTION
@ -69,6 +69,10 @@
/* Don't include the terminating null character that terminates lookup /* Don't include the terminating null character that terminates lookup
/* keys and values. By default, Postfix does whatever is the default for /* keys and values. By default, Postfix does whatever is the default for
/* the host operating system. /* the host operating system.
/* .IP \fB-o\fR
/* Do not release root privileges when processing a non-root
/* input file. By default, \fBpostmap\fR drops root privileges
/* and runs as the source file owner instead.
/* .IP "\fB-q \fIkey\fR" /* .IP "\fB-q \fIkey\fR"
/* Search the specified maps for \fIkey\fR and print the first value /* Search the specified maps for \fIkey\fR and print the first value
/* found on the standard output stream. The exit status is zero /* found on the standard output stream. The exit status is zero
@ -162,6 +166,7 @@
#include <stringops.h> #include <stringops.h>
#include <split_at.h> #include <split_at.h>
#include <vstring_vstream.h> #include <vstring_vstream.h>
#include <set_eugid.h>
/* Global library. */ /* Global library. */
@ -173,9 +178,11 @@
#define STR vstring_str #define STR vstring_str
#define POSTMAP_FLAG_AS_OWNER (1<<0) /* open dest as owner of source */
/* postmap - create or update mapping database */ /* postmap - create or update mapping database */
static void postmap(char *map_type, char *path_name, static void postmap(char *map_type, char *path_name, int postmap_flags,
int open_flags, int dict_flags) int open_flags, int dict_flags)
{ {
VSTREAM *source_fp; VSTREAM *source_fp;
@ -206,6 +213,15 @@ static void postmap(char *map_type, char *path_name,
if (S_ISREG(st.st_mode)) if (S_ISREG(st.st_mode))
saved_mask = umask(022 | (~st.st_mode & 077)); saved_mask = umask(022 | (~st.st_mode & 077));
/*
* If running as root, run as the owner of the source file, so that the
* result shows proper ownership, and so that a bug in postmap does not
* allow privilege escalation.
*/
if ((postmap_flags & POSTMAP_FLAG_AS_OWNER) && getuid() == 0
&& (st.st_uid != geteuid() || st.st_gid != getegid()))
set_eugid(st.st_uid, st.st_gid);
/* /*
* Open the database, optionally create it when it does not exist, * Open the database, optionally create it when it does not exist,
* optionally truncate it when it does exist, and lock out any * optionally truncate it when it does exist, and lock out any
@ -410,7 +426,7 @@ static int postmap_delete(const char *map_type, const char *map_name,
static NORETURN usage(char *myname) static NORETURN usage(char *myname)
{ {
msg_fatal("usage: %s [-Nfinrvw] [-c config_dir] [-d key] [-q key] [map_type:]file...", msg_fatal("usage: %s [-Nfinorvw] [-c config_dir] [-d key] [-q key] [map_type:]file...",
myname); myname);
} }
@ -421,6 +437,7 @@ int main(int argc, char **argv)
int fd; int fd;
char *slash; char *slash;
struct stat st; struct stat st;
int postmap_flags = POSTMAP_FLAG_AS_OWNER;
int open_flags = O_RDWR | O_CREAT | O_TRUNC; int open_flags = O_RDWR | O_CREAT | O_TRUNC;
int dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_KEY; int dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_KEY;
char *query = 0; char *query = 0;
@ -460,7 +477,7 @@ int main(int argc, char **argv)
/* /*
* Parse JCL. * Parse JCL.
*/ */
while ((ch = GETOPT(argc, argv, "Nc:d:finq:rvw")) > 0) { while ((ch = GETOPT(argc, argv, "Nc:d:finoq:rvw")) > 0) {
switch (ch) { switch (ch) {
default: default:
usage(argv[0]); usage(argv[0]);
@ -488,6 +505,9 @@ int main(int argc, char **argv)
dict_flags |= DICT_FLAG_TRY0NULL; dict_flags |= DICT_FLAG_TRY0NULL;
dict_flags &= ~DICT_FLAG_TRY1NULL; dict_flags &= ~DICT_FLAG_TRY1NULL;
break; break;
case 'o':
postmap_flags &= ~POSTMAP_FLAG_AS_OWNER;
break;
case 'q': case 'q':
if (query || delkey) if (query || delkey)
msg_fatal("specify only one of -q or -d"); msg_fatal("specify only one of -q or -d");
@ -551,9 +571,11 @@ int main(int argc, char **argv)
usage(argv[0]); usage(argv[0]);
while (optind < argc) { while (optind < argc) {
if ((path_name = split_at(argv[optind], ':')) != 0) { if ((path_name = split_at(argv[optind], ':')) != 0) {
postmap(argv[optind], path_name, open_flags, dict_flags); postmap(argv[optind], path_name, postmap_flags,
open_flags, dict_flags);
} else { } else {
postmap(var_db_type, argv[optind], open_flags, dict_flags); postmap(var_db_type, argv[optind], postmap_flags,
open_flags, dict_flags);
} }
optind++; optind++;
} }

View File

@ -184,6 +184,16 @@ static void show_queue(void)
msg_warn("close: %m"); msg_warn("close: %m");
} }
/*
* Don't assume that the mail system is down when the user has
* insufficient permission to access the showq socket.
*/
else if (errno != ECONNREFUSED && errno != ENOENT) {
msg_fatal_status(EX_SOFTWARE,
"Connect to the %s %s service: %m",
var_mail_name, var_showq_service);
}
/* /*
* When the mail system is down, the superuser can still access the queue * When the mail system is down, the superuser can still access the queue
* directly. Just run the showq program in stand-alone mode. * directly. Just run the showq program in stand-alone mode.
@ -255,7 +265,7 @@ static void flush_site(const char *site)
static NORETURN usage(void) static NORETURN usage(void)
{ {
msg_fatal_status(EX_USAGE, "usage: specify one of -f, -p, or -s"); msg_fatal_status(EX_USAGE, "usage: postqueue -f | postqueue -p | postqueue -s site");
} }
/* main - the main program */ /* main - the main program */
@ -270,6 +280,7 @@ int main(int argc, char **argv)
char *site_to_flush = 0; char *site_to_flush = 0;
ARGV *import_env; ARGV *import_env;
char *last; char *last;
int bad_site;
/* /*
* Be consistent with file permissions. * Be consistent with file permissions.
@ -319,7 +330,6 @@ int main(int argc, char **argv)
usage(); usage();
mode = PQ_MODE_MAILQ_LIST; mode = PQ_MODE_MAILQ_LIST;
break; break;
break;
case 's': /* flush site */ case 's': /* flush site */
if (mode != PQ_MODE_DEFAULT) if (mode != PQ_MODE_DEFAULT)
usage(); usage();
@ -333,6 +343,8 @@ int main(int argc, char **argv)
usage(); usage();
} }
} }
if (argc > optind)
usage();
/* /*
* Further initialization... * Further initialization...
@ -362,21 +374,20 @@ int main(int argc, char **argv)
* Further input validation. * Further input validation.
*/ */
if (site_to_flush != 0) { if (site_to_flush != 0) {
bad_site = 0;
if (*site_to_flush == '[' if (*site_to_flush == '['
&& *(last = site_to_flush + strlen(site_to_flush) - 1) == ']') { && *(last = site_to_flush + strlen(site_to_flush) - 1) == ']') {
*last = 0; *last = 0;
if (!valid_hostaddr(site_to_flush + 1, DONT_GRIPE)) bad_site = !valid_hostaddr(site_to_flush + 1, DONT_GRIPE);
site_to_flush = 0;
*last = ']'; *last = ']';
} else { } else {
if (!valid_hostname(site_to_flush, DONT_GRIPE) bad_site = (!valid_hostname(site_to_flush, DONT_GRIPE)
&& !valid_hostaddr(site_to_flush, DONT_GRIPE)) && !valid_hostaddr(site_to_flush, DONT_GRIPE));
site_to_flush = 0;
} }
if (site_to_flush == 0) if (bad_site)
msg_fatal_status(EX_USAGE, msg_fatal_status(EX_USAGE,
"Cannot flush mail queue - invalid destination: \"%.100s%s\"", "Cannot flush mail queue - invalid destination: \"%.100s%s\"",
optarg, strlen(optarg) > 100 ? "..." : ""); site_to_flush, strlen(site_to_flush) > 100 ? "..." : "");
} }
/* /*

View File

@ -312,6 +312,14 @@ int smtp_xfer(SMTP_STATE *state)
} \ } \
} while (0) } while (0)
#define QUOTE_ADDRESS(addr) do { \
if (*(addr)) { \
quote_821_local(state->scratch, addr); \
myfree(addr); \
addr = mystrdup(vstring_str(state->scratch)); \
} \
} while (0)
#define RETURN(x) do { vstring_free(next_command); return (x); } while (0) #define RETURN(x) do { vstring_free(next_command); return (x); } while (0)
#define SENDER_IS_AHEAD \ #define SENDER_IS_AHEAD \
@ -399,9 +407,11 @@ int smtp_xfer(SMTP_STATE *state)
* Build the MAIL FROM command. * Build the MAIL FROM command.
*/ */
case SMTP_STATE_MAIL: case SMTP_STATE_MAIL:
if (*request->sender) if (var_disable_dns == 0) {
if (var_disable_dns == 0)
REWRITE_ADDRESS(request->sender); REWRITE_ADDRESS(request->sender);
} else {
QUOTE_ADDRESS(request->sender);
}
vstring_sprintf(next_command, "MAIL FROM:<%s>", request->sender); vstring_sprintf(next_command, "MAIL FROM:<%s>", request->sender);
if (state->features & SMTP_FEATURE_SIZE) if (state->features & SMTP_FEATURE_SIZE)
vstring_sprintf_append(next_command, " SIZE=%lu", vstring_sprintf_append(next_command, " SIZE=%lu",
@ -415,8 +425,11 @@ int smtp_xfer(SMTP_STATE *state)
*/ */
case SMTP_STATE_RCPT: case SMTP_STATE_RCPT:
rcpt = request->rcpt_list.info + send_rcpt; rcpt = request->rcpt_list.info + send_rcpt;
if (var_disable_dns == 0) if (var_disable_dns == 0) {
REWRITE_ADDRESS(rcpt->address); REWRITE_ADDRESS(rcpt->address);
} else {
QUOTE_ADDRESS(rcpt->address);
}
vstring_sprintf(next_command, "RCPT TO:<%s>", rcpt->address); vstring_sprintf(next_command, "RCPT TO:<%s>", rcpt->address);
if ((next_rcpt = send_rcpt + 1) == request->rcpt_list.len) if ((next_rcpt = send_rcpt + 1) == request->rcpt_list.len)
next_state = SMTP_STATE_DATA; next_state = SMTP_STATE_DATA;

View File

@ -1314,6 +1314,8 @@ static SMTPD_CMD smtpd_cmd_table[] = {
"ETRN", etrn_cmd, SMTPD_CMD_FLAG_LIMIT, "ETRN", etrn_cmd, SMTPD_CMD_FLAG_LIMIT,
"QUIT", quit_cmd, 0, "QUIT", quit_cmd, 0,
"Received:", 0, SMTPD_CMD_FLAG_HEADER, "Received:", 0, SMTPD_CMD_FLAG_HEADER,
"Reply-To:", 0, SMTPD_CMD_FLAG_HEADER,
"Message-ID:", 0, SMTPD_CMD_FLAG_HEADER,
"Subject:", 0, SMTPD_CMD_FLAG_HEADER, "Subject:", 0, SMTPD_CMD_FLAG_HEADER,
"From:", 0, SMTPD_CMD_FLAG_HEADER, "From:", 0, SMTPD_CMD_FLAG_HEADER,
0, 0,

View File

@ -70,6 +70,8 @@
static MAPS *transport_path; static MAPS *transport_path;
static int transport_match_parent_style; static int transport_match_parent_style;
static VSTRING *wildcard_channel;
static VSTRING *wildcard_nexthop;
/* transport_init - pre-jail initialization */ /* transport_init - pre-jail initialization */
@ -80,6 +82,21 @@ void transport_init(void)
transport_path = maps_create("transport", var_transport_maps, transport_path = maps_create("transport", var_transport_maps,
DICT_FLAG_LOCK); DICT_FLAG_LOCK);
transport_match_parent_style = match_parent_style(VAR_TRANSPORT_MAPS); transport_match_parent_style = match_parent_style(VAR_TRANSPORT_MAPS);
}
void transport_wildcard_init(void)
{
wildcard_channel = vstring_alloc(10);
wildcard_nexthop = vstring_alloc(10);
if (!transport_lookup("*", wildcard_channel, wildcard_nexthop)) {
vstring_free(wildcard_channel);
vstring_free(wildcard_nexthop);
}
if (msg_verbose) {
msg_info("wildcard_{chan,hop}={%s %s}",
vstring_str(wildcard_channel), vstring_str(wildcard_nexthop));
}
} }
/* transport_lookup - map a transport domain */ /* transport_lookup - map a transport domain */
@ -94,6 +111,7 @@ int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
char *saved_value; char *saved_value;
char *transport; char *transport;
int found = 0; int found = 0;
int null_found = 0;
#define FULL 0 #define FULL 0
#define PARTIAL DICT_FLAG_FIXED #define PARTIAL DICT_FLAG_FIXED
@ -105,7 +123,9 @@ int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
/* /*
* Keep stripping domain components until nothing is left or until a * Keep stripping domain components until nothing is left or until a
* matching entry is found. * matching entry is found. If a NULL entry (either no RHS, or ':'),
* then pretend we got no match, and return. If we really got no match,
* then return the wildcard transport, if any.
* *
* After checking the full name, check for .upper.domain, to distinguish * After checking the full name, check for .upper.domain, to distinguish
* between the upper domain and it's decendants, ala sendmail and tcp * between the upper domain and it's decendants, ala sendmail and tcp
@ -117,11 +137,17 @@ int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
* Specify if a key is partial or full, to avoid matching partial keys with * Specify if a key is partial or full, to avoid matching partial keys with
* regular expressions. * regular expressions.
*/ */
for (name = low_domain; /* void */; name = next) { for (name = low_domain; /* void */ ; name = next) {
if ((value = maps_find(transport_path, name, maps_flag)) != 0) { if ((value = maps_find(transport_path, name, maps_flag)) != 0) {
saved_value = mystrdup(value); saved_value = mystrdup(value);
if ((host = split_at(saved_value, ':')) == 0 || *host == 0) if ((host = split_at(saved_value, ':')) == 0 || *host == 0) {
if (*saved_value == 0) {
myfree(saved_value);
null_found = 1;
break;
}
host = domain; host = domain;
}
if (*(transport = saved_value) == 0) if (*(transport = saved_value) == 0)
transport = var_def_transport; transport = var_def_transport;
vstring_strcpy(channel, transport); vstring_strcpy(channel, transport);
@ -143,5 +169,14 @@ int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
maps_flag = PARTIAL; maps_flag = PARTIAL;
} }
myfree(low_domain); myfree(low_domain);
if (wildcard_channel && !null_found) {
vstring_strcpy(channel, vstring_str(wildcard_channel));
if (vstring_str(wildcard_nexthop))
vstring_strcpy(nexthop, vstring_str(wildcard_nexthop));
else
vstring_strcpy(nexthop, domain);
found = 1;
}
return (found); return (found);
} }

View File

@ -17,6 +17,7 @@
* External interface. * External interface.
*/ */
extern void transport_init(void); extern void transport_init(void);
extern void transport_wildcard_init(void);
extern int transport_lookup(const char *, VSTRING *, VSTRING *); extern int transport_lookup(const char *, VSTRING *, VSTRING *);
/* LICENSE /* LICENSE

View File

@ -220,6 +220,11 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
transport_init(); transport_init();
} }
static void post_jail_init(char *unused_name, char **unused_argv)
{
transport_wildcard_init();
}
/* main - pass control to the multi-threaded skeleton code */ /* main - pass control to the multi-threaded skeleton code */
int main(int argc, char **argv) int main(int argc, char **argv)
@ -241,6 +246,7 @@ int main(int argc, char **argv)
MAIL_SERVER_STR_TABLE, str_table, MAIL_SERVER_STR_TABLE, str_table,
MAIL_SERVER_BOOL_TABLE, bool_table, MAIL_SERVER_BOOL_TABLE, bool_table,
MAIL_SERVER_PRE_INIT, pre_jail_init, MAIL_SERVER_PRE_INIT, pre_jail_init,
MAIL_SERVER_POST_INIT, post_jail_init,
MAIL_SERVER_PRE_ACCEPT, pre_accept, MAIL_SERVER_PRE_ACCEPT, pre_accept,
0); 0);
} }

View File

@ -161,7 +161,8 @@ static int attr_scan0_string(VSTREAM *fp, VSTRING *plain_buf, const char *contex
int ch; int ch;
if ((ch = vstring_get_null(plain_buf, fp)) == VSTREAM_EOF) { if ((ch = vstring_get_null(plain_buf, fp)) == VSTREAM_EOF) {
msg_warn("premature end-of-input from %s while reading %s", msg_warn("%s on %s while reading %s",
vstream_ftimeout(fp) ? "timeout" : "premature end-of-input",
VSTREAM_PATH(fp), context); VSTREAM_PATH(fp), context);
return (-1); return (-1);
} }

View File

@ -170,7 +170,8 @@ static int attr_scan64_string(VSTREAM *fp, VSTRING *plain_buf, const char *conte
VSTRING_RESET(base64_buf); VSTRING_RESET(base64_buf);
while ((ch = VSTREAM_GETC(fp)) != ':' && ch != '\n') { while ((ch = VSTREAM_GETC(fp)) != ':' && ch != '\n') {
if (ch == VSTREAM_EOF) { if (ch == VSTREAM_EOF) {
msg_warn("premature end-of-input from %s while reading %s", msg_warn("%s on %s while reading %s",
vstream_ftimeout(fp) ? "timeout" : "premature end-of-input",
VSTREAM_PATH(fp), context); VSTREAM_PATH(fp), context);
return (-1); return (-1);
} }

View File

@ -104,8 +104,17 @@ typedef struct {
DB *db; /* open db file */ DB *db; /* open db file */
} DICT_DB; } DICT_DB;
#define DICT_DB_CACHE_SIZE (1024 * 1024) /*
* db_mpool_size is initialized when the first database is opened. The
* parameter can be preempted by setting db_mpool_size != 0 before calling
* dict_hash_open() or dict_btree_open(). This is done in mkmap_db_open()
* via "db_mkmap_mpool_size" to set a larger memory pool for database
* rebuilds.
*/
#define VAR_MPOOL_SIZE "db_mpool_size"
#define DEF_MPOOL_SIZE 262144 /* 256K default memory pool */
#define DICT_DB_NELM 4096 #define DICT_DB_NELM 4096
int db_mpool_size;
#if DB_VERSION_MAJOR > 1 #if DB_VERSION_MAJOR > 1
@ -138,6 +147,86 @@ static int sanitize(int status)
#endif #endif
#if DB_VERSION_MAJOR > 1
static DB_ENV *dict_db_env;
static int dict_db_refcount;
static int dict_db_env_alloc(DB_ENV ** env)
{
int err;
/*
* Allocate a new environment if this is the first database. Bump the
* reference count so we can deallocate the environment when the last
* database is closed.
*/
if (dict_db_env != 0) {
++dict_db_refcount;
*env = dict_db_env;
return 0;
}
#if DB_VERSION_MAJOR == 2
#define DICT_DB_ENV_FLAGS (DB_CREATE|DB_INIT_MPOOL|DB_MPOOL_PRIVATE)
dict_db_env = (DB_ENV *) mymalloc(sizeof(DB_ENV));
memset((char *) dict_db_env, 0, sizeof(DB_ENV));
dict_db_env->mp_size = db_mpool_size;
if ((err = db_appinit(0, 0, dict_db_env, DICT_DB_ENV_FLAGS)) != 0) {
myfree((char *) dict_db_env);
dict_db_env = 0;
return err;
}
#endif /* DB_VERSION_MAJOR == 2 */
#if DB_VERSION_MAJOR > 2
#define DICT_DB_ENV_FLAGS (DB_CREATE|DB_INIT_MPOOL|DB_PRIVATE)
err = db_env_create(&dict_db_env, 0);
if (err == 0)
err = dict_db_env->set_cachesize(dict_db_env, 0, db_mpool_size, 1);
if (err == 0)
err = dict_db_env->open(dict_db_env, 0, DICT_DB_ENV_FLAGS, 0644);
if (err != 0) {
if (dict_db_env)
dict_db_env->close(dict_db_env, 0);
dict_db_env = 0;
return err;
}
#endif /* DB_VERSION_MAJOR > 2 */
++dict_db_refcount;
*env = dict_db_env;
return 0;
}
static void dict_db_env_free(void)
{
/*
* Deallocate a database within the environment Free the environment when
* the last database is closed
*/
#if DB_VERSION_MAJOR == 2
if (dict_db_env && dict_db_refcount > 0 && --dict_db_refcount == 0) {
db_appexit(dict_db_env);
dict_db_env = 0;
}
#endif
#if DB_VERSION_MAJOR > 2
if (dict_db_env && dict_db_refcount > 0 && --dict_db_refcount == 0) {
dict_db_env->close(dict_db_env, 0);
dict_db_env = 0;
}
#endif
}
#endif /* DB_VERSION_MAJOR > 1 */
/* dict_db_lookup - find database entry */ /* dict_db_lookup - find database entry */
static const char *dict_db_lookup(DICT *dict, const char *name) static const char *dict_db_lookup(DICT *dict, const char *name)
@ -417,6 +506,11 @@ static void dict_db_close(DICT *dict)
msg_fatal("flush database %s: %m", dict_db->dict.name); msg_fatal("flush database %s: %m", dict_db->dict.name);
if (DICT_DB_CLOSE(dict_db->db) < 0) if (DICT_DB_CLOSE(dict_db->db) < 0)
msg_fatal("close database %s: %m", dict_db->dict.name); msg_fatal("close database %s: %m", dict_db->dict.name);
#if DB_VERSION_MAJOR > 1
dict_db_env_free();
#endif
dict_free(dict); dict_free(dict);
} }
@ -434,6 +528,7 @@ static DICT *dict_db_open(const char *class, const char *path, int open_flags,
#if DB_VERSION_MAJOR > 1 #if DB_VERSION_MAJOR > 1
int db_flags; int db_flags;
DB_ENV *env;
#endif #endif
@ -493,7 +588,9 @@ static DICT *dict_db_open(const char *class, const char *path, int open_flags,
db_flags |= DB_CREATE; db_flags |= DB_CREATE;
if (open_flags & O_TRUNC) if (open_flags & O_TRUNC)
db_flags |= DB_TRUNCATE; db_flags |= DB_TRUNCATE;
if ((errno = db_open(db_path, type, db_flags, 0644, 0, tweak, &db)) != 0) if ((errno = dict_db_env_alloc(&env)) != 0)
msg_fatal("create DB environment: %m");
if ((errno = db_open(db_path, type, db_flags, 0644, env, tweak, &db)) != 0)
msg_fatal("open database %s: %m", db_path); msg_fatal("open database %s: %m", db_path);
if (db == 0) if (db == 0)
msg_panic("db_open null result"); msg_panic("db_open null result");
@ -512,12 +609,12 @@ static DICT *dict_db_open(const char *class, const char *path, int open_flags,
db_flags |= DB_CREATE; db_flags |= DB_CREATE;
if (open_flags & O_TRUNC) if (open_flags & O_TRUNC)
db_flags |= DB_TRUNCATE; db_flags |= DB_TRUNCATE;
if ((errno = db_create(&db, 0, 0)) != 0) if ((errno = dict_db_env_alloc(&env)) != 0)
msg_fatal("create DB environment: %m");
if ((errno = db_create(&db, env, 0)) != 0)
msg_fatal("create DB database: %m"); msg_fatal("create DB database: %m");
if (db == 0) if (db == 0)
msg_panic("db_create null result"); msg_panic("db_create null result");
if ((errno = db->set_cachesize(db, 0, DICT_DB_CACHE_SIZE, 0)) != 0)
msg_fatal("set DB cache size %d: %m", DICT_DB_CACHE_SIZE);
if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0) if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM); msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
if ((errno = db->open(db, db_path, 0, type, db_flags, 0644)) != 0) if ((errno = db->open(db, db_path, 0, type, db_flags, 0644)) != 0)
@ -570,22 +667,31 @@ DICT *dict_hash_open(const char *path, int open_flags, int dict_flags)
#if DB_VERSION_MAJOR < 2 #if DB_VERSION_MAJOR < 2
HASHINFO tweak; HASHINFO tweak;
memset((char *) &tweak, 0, sizeof(tweak));
tweak.nelem = DICT_DB_NELM;
tweak.cachesize = DICT_DB_CACHE_SIZE;
#endif #endif
#if DB_VERSION_MAJOR == 2 #if DB_VERSION_MAJOR == 2
DB_INFO tweak; DB_INFO tweak;
memset((char *) &tweak, 0, sizeof(tweak));
tweak.h_nelem = DICT_DB_NELM;
tweak.db_cachesize = DICT_DB_CACHE_SIZE;
#endif #endif
#if DB_VERSION_MAJOR > 2 #if DB_VERSION_MAJOR > 2
void *tweak; void *tweak;
tweak = 0;
#endif #endif
/* Set the mpool size if not already set in mkmap_db_open() */
if (db_mpool_size == 0)
db_mpool_size = get_mail_conf_int(VAR_MPOOL_SIZE, DEF_MPOOL_SIZE, 0, 0);
memset((char *) &tweak, 0, sizeof(tweak));
#if DB_VERSION_MAJOR < 2
tweak.nelem = DICT_DB_NELM;
tweak.cachesize = db_mpool_size;
#endif
#if DB_VERSION_MAJOR == 2
tweak.h_nelem = DICT_DB_NELM;
tweak.db_cachesize = 0;
#endif
return (dict_db_open(DICT_TYPE_HASH, path, open_flags, DB_HASH, return (dict_db_open(DICT_TYPE_HASH, path, open_flags, DB_HASH,
(void *) &tweak, dict_flags)); (void *) &tweak, dict_flags));
} }
@ -597,19 +703,24 @@ DICT *dict_btree_open(const char *path, int open_flags, int dict_flags)
#if DB_VERSION_MAJOR < 2 #if DB_VERSION_MAJOR < 2
BTREEINFO tweak; BTREEINFO tweak;
memset((char *) &tweak, 0, sizeof(tweak));
tweak.cachesize = DICT_DB_CACHE_SIZE;
#endif #endif
#if DB_VERSION_MAJOR == 2 #if DB_VERSION_MAJOR == 2
DB_INFO tweak; DB_INFO tweak;
memset((char *) &tweak, 0, sizeof(tweak));
tweak.db_cachesize = DICT_DB_CACHE_SIZE;
#endif #endif
#if DB_VERSION_MAJOR > 2 #if DB_VERSION_MAJOR > 2
void *tweak; void *tweak;
tweak = 0; #endif
/* Set the mpool size if not already set in mkmap_db_open() */
if (db_mpool_size == 0)
db_mpool_size = get_mail_conf_int(VAR_MPOOL_SIZE, DEF_MPOOL_SIZE, 0, 0);
memset((char *) &tweak, 0, sizeof(tweak));
#if DB_VERSION_MAJOR < 2
tweak.cachesize = db_mpool_size;
#endif #endif
return (dict_db_open(DICT_TYPE_BTREE, path, open_flags, DB_BTREE, return (dict_db_open(DICT_TYPE_BTREE, path, open_flags, DB_BTREE,

View File

@ -406,6 +406,8 @@ DICT *dict_dbm_open(const char *path, int open_flags, int dict_flags)
dict_dbm->dict.close = dict_dbm_close; dict_dbm->dict.close = dict_dbm_close;
dict_dbm->dict.lock_fd = dbm_dirfno(dbm); dict_dbm->dict.lock_fd = dbm_dirfno(dbm);
dict_dbm->dict.stat_fd = dbm_pagfno(dbm); dict_dbm->dict.stat_fd = dbm_pagfno(dbm);
if (dict_dbm->dict.lock_fd == dict_dbm->dict.stat_fd)
msg_fatal("open database %s: cannot support GDBM", path);
if (fstat(dict_dbm->dict.stat_fd, &st) < 0) if (fstat(dict_dbm->dict.stat_fd, &st) < 0)
msg_fatal("dict_dbm_open: fstat: %m"); msg_fatal("dict_dbm_open: fstat: %m");
dict_dbm->dict.mtime = st.st_mtime; dict_dbm->dict.mtime = st.st_mtime;

View File

@ -52,11 +52,11 @@
#define STATFS_IN_SYS_MOUNT_H #define STATFS_IN_SYS_MOUNT_H
#define HAS_POSIX_REGEXP #define HAS_POSIX_REGEXP
#define HAS_ST_GEN /* struct stat contains inode generation number */ #define HAS_ST_GEN /* struct stat contains inode generation number */
#define DEF_SENDMAIL_PATH "/usr/sbin/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
#define DEF_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
#define DEF_NEWALIAS_PATH "/usr/bin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_COMMAND_DIR "/usr/sbin"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
#if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4)
@ -99,11 +99,11 @@
#define PRINTFLIKE(x,y) #define PRINTFLIKE(x,y)
#define SCANFLIKE(x,y) #define SCANFLIKE(x,y)
#define HAS_NETINFO #define HAS_NETINFO
#define DEF_SENDMAIL_PATH "/usr/sbin/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
#define DEF_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
#define DEF_NEWALIAS_PATH "/usr/bin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_COMMAND_DIR "/usr/sbin"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
/* /*
@ -152,9 +152,9 @@ extern int h_errno;
#define DUP2_DUPS_CLOSE_ON_EXEC #define DUP2_DUPS_CLOSE_ON_EXEC
#define MISSING_USLEEP #define MISSING_USLEEP
#define NO_HERRNO #define NO_HERRNO
#define DEF_SENDMAIL_PATH "/usr/lib/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
#define DEF_COMMAND_DIR "/usr/etc" #define NATIVE_COMMAND_DIR "/usr/etc"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
/* /*
@ -221,11 +221,11 @@ extern int opterr;
#define STATFS_IN_SYS_VFS_H #define STATFS_IN_SYS_VFS_H
#define memmove(d,s,l) bcopy(s,d,l) #define memmove(d,s,l) bcopy(s,d,l)
#define NO_HERRNO #define NO_HERRNO
#define DEF_SENDMAIL_PATH "/usr/lib/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
#define DEF_MAILQ_PATH "/usr/ucb/mailq" #define NATIVE_MAILQ_PATH "/usr/ucb/mailq"
#define DEF_NEWALIAS_PATH "/usr/ucb/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/ucb/newaliases"
#define DEF_COMMAND_DIR "/usr/etc" #define NATIVE_COMMAND_DIR "/usr/etc"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
/* /*
@ -260,11 +260,14 @@ extern int opterr;
#define LOCAL_CONNECT stream_connect #define LOCAL_CONNECT stream_connect
#define LOCAL_TRIGGER stream_trigger #define LOCAL_TRIGGER stream_trigger
#define HAS_VOLATILE_LOCKS #define HAS_VOLATILE_LOCKS
#define DEF_SENDMAIL_PATH "/usr/lib/sendmail" /*
#define DEF_MAILQ_PATH "/usr/bin/mailq" * Allow build environment to override paths.
#define DEF_NEWALIAS_PATH "/usr/bin/newaliases" */
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
#define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
#define NATIVE_COMMAND_DIR "/usr/sbin"
#define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
/* /*
@ -353,11 +356,11 @@ extern int opterr;
#define USE_STATVFS #define USE_STATVFS
#define STATVFS_IN_SYS_STATVFS_H #define STATVFS_IN_SYS_STATVFS_H
#define STRCASECMP_IN_STRINGS_H #define STRCASECMP_IN_STRINGS_H
#define DEF_SENDMAIL_PATH "/usr/lib/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
#define DEF_MAILQ_PATH "/usr/sbin/mailq" #define NATIVE_MAILQ_PATH "/usr/sbin/mailq"
#define DEF_NEWALIAS_PATH "/usr/sbin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/sbin/newaliases"
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_COMMAND_DIR "/usr/sbin"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
#ifdef AIX4 #ifdef AIX4
@ -392,11 +395,11 @@ extern int seteuid(uid_t);
extern int setegid(gid_t); extern int setegid(gid_t);
extern int initgroups(const char *, int); extern int initgroups(const char *, int);
#endif #endif
#define DEF_SENDMAIL_PATH "/usr/lib/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
#define DEF_MAILQ_PATH "/usr/sbin/mailq" #define NATIVE_MAILQ_PATH "/usr/sbin/mailq"
#define DEF_NEWALIAS_PATH "/usr/sbin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/sbin/newaliases"
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_COMMAND_DIR "/usr/sbin"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
@ -430,7 +433,7 @@ extern time_t time(time_t *);
extern int seteuid(uid_t); extern int seteuid(uid_t);
extern int setegid(gid_t); extern int setegid(gid_t);
extern int initgroups(const char *, int); extern int initgroups(const char *, int);
#define DEF_SENDMAIL_PATH "/usr/lib/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
#endif #endif
@ -494,11 +497,11 @@ extern int initgroups(const char *, int);
#define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT #define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT
#define PREPEND_PLUS_TO_OPTSTRING #define PREPEND_PLUS_TO_OPTSTRING
#define HAS_POSIX_REGEXP #define HAS_POSIX_REGEXP
#define DEF_SENDMAIL_PATH "/usr/sbin/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
#define DEF_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
#define DEF_NEWALIAS_PATH "/usr/bin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_COMMAND_DIR "/usr/sbin"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
/* /*
@ -532,11 +535,11 @@ extern int h_errno; /* <netdb.h> imports too much stuff */
#define USE_STATFS #define USE_STATFS
#define STATFS_IN_SYS_VFS_H #define STATFS_IN_SYS_VFS_H
#define HAS_POSIX_REGEXP #define HAS_POSIX_REGEXP
#define DEF_SENDMAIL_PATH "/usr/sbin/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
#define DEF_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
#define DEF_NEWALIAS_PATH "/usr/bin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_COMMAND_DIR "/usr/sbin"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
#ifdef HPUX10 #ifdef HPUX10
@ -567,11 +570,11 @@ extern int h_errno; /* <netdb.h> imports too much stuff */
#define USE_STATFS #define USE_STATFS
#define STATFS_IN_SYS_VFS_H #define STATFS_IN_SYS_VFS_H
#define HAS_POSIX_REGEXP #define HAS_POSIX_REGEXP
#define DEF_SENDMAIL_PATH "/usr/sbin/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
#define DEF_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
#define DEF_NEWALIAS_PATH "/usr/bin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
#define DEF_COMMAND_DIR "/usr/sbin" #define NATIVE_COMMAND_DIR "/usr/sbin"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
#ifdef HPUX9 #ifdef HPUX9
@ -604,10 +607,10 @@ extern int h_errno;
#define USE_STATFS #define USE_STATFS
#define STATFS_IN_SYS_VFS_H #define STATFS_IN_SYS_VFS_H
#define HAS_POSIX_REGEXP #define HAS_POSIX_REGEXP
#define DEF_SENDMAIL_PATH "/usr/bin/sendmail" #define NATIVE_SENDMAIL_PATH "/usr/bin/sendmail"
#define DEF_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
#define DEF_NEWALIAS_PATH "/usr/bin/newaliases" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
#define DEF_DAEMON_DIR "/usr/libexec/postfix" #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
#endif #endif
/* /*
@ -809,6 +812,39 @@ extern int h_errno;
*/ */
#ifndef SUPPORTED #ifndef SUPPORTED
#error "unsupported platform" #error "unsupported platform"
#endif
/*
* Allow command line flags to override native settings
*/
#ifndef DEF_COMMAND_DIR
#ifdef NATIVE_COMMAND_DIR
#define DEF_COMMAND_DIR NATIVE_COMMAND_DIR
#endif
#endif
#ifndef DEF_DAEMON_DIR
#ifdef NATIVE_DAEMON_DIR
#define DEF_DAEMON_DIR NATIVE_DAEMON_DIR
#endif
#endif
#ifndef DEF_SENDMAIL_PATH
#ifdef NATIVE_SENDMAIL_PATH
#define DEF_SENDMAIL_PATH NATIVE_SENDMAIL_PATH
#endif
#endif
#ifndef DEF_MAILQ_PATH
#ifdef NATIVE_MAILQ_PATH
#define DEF_MAILQ_PATH NATIVE_MAILQ_PATH
#endif
#endif
#ifndef DEF_NEWALIAS_PATH
#ifdef NATIVE_NEWALIAS_PATH
#define DEF_NEWALIAS_PATH NATIVE_NEWALIAS_PATH
#endif
#endif #endif
#define CAST_CHAR_PTR_TO_INT(cptr) ((int) (long) (cptr)) #define CAST_CHAR_PTR_TO_INT(cptr) ((int) (long) (cptr))

View File

@ -51,7 +51,7 @@ depend: $(MAKES)
$(CC) -E $(DEFS) $(INCL) $$i | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \ $(CC) -E $(DEFS) $(INCL) $$i | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
-e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' -e 'p' -e '}'; \ -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' -e 'p' -e '}'; \
done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
@make -f Makefile.in Makefile @$(EXPORT) @make -f Makefile.in Makefile
# do not edit below this line - it is generated by 'make depend' # do not edit below this line - it is generated by 'make depend'
deliver_attr.o: deliver_attr.c deliver_attr.o: deliver_attr.c