diff --git a/postfix/DB_README b/postfix/DB_README index 103fdc1cd..6f6b3dc2d 100644 --- a/postfix/DB_README +++ b/postfix/DB_README @@ -1,21 +1,68 @@ Purpose of this document ======================== -This document describes how to build Postfix with Berkeley DB -support on systems that ship without DB library. The canonical -third-party source for Berkeley DB is www.sleepycat.com. +This document describes how to build Postfix with third-party +Berkeley DB from www.sleepycat.com, or how to choose a specific +Berkeley DB version when your system provides multiple implementations. -The information can also be used to build Postfix with a non-default -Berkeley DB version. However, the file formats of Berkeley DB -version 2 and later are not compatible with the older Berkeley DB -version that ships with, for example, 4.4BSD. +Building Postfix with Sleepycat Berkeley DB +=========================================== -Building Postfix with third-party Berkeley DB support -===================================================== +Many commercial UNIXes ship without Berkeley DB support. Examples +are Solaris, HP-UX, IRIX, UNIXWARE. In order to build Postfix with +Berkeley DB support you need to download and install the source +code from www.sleepycat.com. -If you installed the Berkeley DB from Sleepycat, use something like: +To build Postfix after you installed the Berkeley DB from Sleepycat, +use something like: % make tidy - % make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyDB/include" \ - AUXLIBS=/usr/local/BerkeleyDB/lib/libdb.a + % make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyDB.3.1/include" \ + AUXLIBS=/usr/local/BerkeleyDB.3.1/lib/libdb.a % make + +The exact pathnames depend on the DB version that you installed. +For example, Berkeley DB version 2 installs in /usr/local/BerkeleyDB. + +Beware, the file format produced by Berkeley DB version 1 is not +compatible with that of versions 2 and 3 (versions 2 and 3 have +the same format). If you switch between DB versions, then you may +have to rebuild all your Postfix DB files. + +Building Postfix on BSD systems with a specific Berkeley DB version +=================================================================== + +Some BSD systems ship with multiple Berkeley DB implementations. +Normally, Postfix builds with the default DB version that ships +with the system. + +To build Postfix on BSD systems with a specific DB version, use a +variant of the following commands: + + % make tidy + % make makefiles CCARGS=-I/usr/include/db2 AUXLIBS=-ldb2 + % make + +Beware, the file format produced by Berkeley DB version 1 is not +compatible with that of versions 2 and 3 (versions 2 and 3 have +the same format). If you switch between DB versions, then you may +have to rebuild all your Postfix DB files. + +Building Postfix on Linux with a specific Berkeley DB version +============================================================= + +Some Linux systems systems ship with multiple Berkeley DB +implementations. Normally, Postfix builds with the default DB +version that ships with the system. + +On Linux, you need to edit the makedefs script in order to specify +a non-default DB library. + +The reason is that the location of the default db.h include file +changes randomly between vendors and between versions, so that +Postfix has to choose the file for you. + +Beware, the file format produced by Berkeley DB version 1 is not +compatible with that of versions 2 and 3 (versions 2 and 3 have +the same format). If you switch between DB versions, then you may +have to rebuild all your Postfix DB files. diff --git a/postfix/HISTORY b/postfix/HISTORY index f29bd449b..96dceb72f 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -4358,12 +4358,12 @@ Apologies for any names omitted. the [] or host:port syntax, and there was no way to suppress MX record lookups. Files: smtp/smtp_addr.c, smtp/smtp_connect.c. - Convenience: you can now specify multiple destinations in - the relayhost or fallback_relay configuration parameters. + Convenience: you can now specify multiple SMTP destinations + in the relayhost or fallback_relay configuration parameters. The specified destinations will be tried in the specified order. File: smtp/smtp_connect.c. - Typographical corrections by Matthias Andree. + Many typographical corrections by Matthias Andree. 20001024 @@ -4380,13 +4380,13 @@ Apologies for any names omitted. Horror: postmap and postalias (newaliases) silently lose the file lock while building a lookup table with Berkeley - DB 2.x and later on Solaris, HP-UX or IRIX. The result is - that table lookups fail while the table is being built, so - that mail is lost. In order to avoid this misbehavior one - has to use an undocumented feature that is NOT available - with the DB1.85 compatibility interface. Therefore, Postfix - now supports three Berkeley DB programming interfaces of - increasing complexity. File: util/dict_db.c. + DB 2.x and later on Solaris, HP-UX, IRIX, and UNIXWARE. + The result is that table lookups fail while the table is + being built, so that mail is lost. In order to avoid this + misbehavior one has to use an undocumented feature that is + NOT available with the DB1.85 compatibility interface. + Therefore, Postfix now supports three Berkeley DB programming + interfaces of increasing complexity. File: util/dict_db.c. Bugfix: some character manipulations were not portable for signed/unsigned characters. Files: global/quote_821_local.c, @@ -4396,3 +4396,25 @@ Apologies for any names omitted. begins with "From sender time-stamp". Sendmail silently ignores such RFC violating garbage, and therefore Postfix needs to jump another hoop. File: smtpd/smtpd.c. + +20001028 + + Bugfix: the flush server tried to access config files after + going to the chroot jail. Found by Lutz Jaenicke, TU-Cottbus.DE. + File: flush/flush.c. + + Update: revised LDAP module from primary maintainer John + Hensley, with contributions from many other people. Files: + util/dict_ldap.c, LDAP_README. + + Update: LINUX2 chroot setup script by Matthias Andree, + uni-dortmund.de. + + Feature: specify unix:/path/name for LMTP connections over + UNIX-domain sockets, and specify inet:host or inet:host:port + for IPV4. If no unix: or inet: is specified, IPV4 is assumed. + File: lmtp/lmtp_connect.c. + + Feature: added UNIX-domain support to the smtpstone test + programs in order to test the LMTP client UNIX-domain + support. diff --git a/postfix/LDAP_README b/postfix/LDAP_README index 50b020ed1..9dca5663c 100644 --- a/postfix/LDAP_README +++ b/postfix/LDAP_README @@ -82,10 +82,22 @@ parameter below, "server_host", would be defined in main.cf as substitute for the address Postfix is trying to resolve, e.g. ldapsource_query_filter = (&(mail=%s)(paid_up=true)) + domain (No default; you must configure this.) + This is a list of domain names, paths to files, or dictionaries. + If specified, only lookups ending in a domain on this list will + be searched. This can significantly reduce the query load on the + LDAP server. + ldapsource_domain = postfix.org, hash:/etc/postfix/searchdomains + result_attribute (maildrop) - The attribute Postfix will read from any directory entries + The attribute(s) Postfix will read from any directory entries returned by the lookup, to be resolved to an email address. - ldapsource_result_attribute = mailbox + ldapsource_result_attribute = mailbox,maildrop + + special_result_attribute (No default) + The attribute(s) of directory entries that can contain DNs or URLs. + If found, a recursive subsequent search is done using their values. + ldapsource_special_result_attribute = member scope (sub) The LDAP search scope: sub, base, or one. These translate into @@ -147,8 +159,11 @@ configuration routines understand how to deal with quoted strings. EXAMPLES ======== -Here's a basic example for using LDAP to look up aliases. In main.cf, -you have these configuration parameters defined: +ALIASES +------- + +Here's a basic example for using LDAP to look up aliases. Assume that in +main.cf, you have these configuration parameters defined: alias_maps = hash:/etc/aliases, ldap:ldapsource ldapsource_server_host = ldap.my.com @@ -162,39 +177,52 @@ read the "maildrop" attributes of those found, and build a list of their maildrops, which will be treated as RFC822 addresses to which the message will be delivered. +VIRTUAL DOMAINS/ADDRESSES +------------------------- + If you want to keep information for virtual lookups in your directory, -it's only a little more complicated. You'll want to make sure all of -your virtual mailacceptinggeneralid attributes are fully qualified with -their virtual domains. If you want to designate a directory entry as the +it's only a little more complicated. First you need to make sure Postfix +knows about the virtual domain. An easy way to do that is to add the +domain to the mailacceptinggeneralid attribute of some entry in the +directory. Next you'll want to make sure all of your virtual recipients' +mailacceptinggeneralid attributes are fully qualified with their virtual +domains. Finally, if you want to designate a directory entry as the default user for a virtual domain, just give it an additional mailacceptinggeneralid (or the equivalent in your directory) of -"@virtual.dom". That's right, no user part. +"@virtual.dom". That's right, no user part. If you don't want a catchall +user, omit this step and mail to unknown users in the domain will simply +bounce. -If you want to get information for relay_domains out of your directory, -the simplest way to get it is to add the domain name (without even the -'@') as a mailacceptinggeneralid to some recipient in each domain, then -add "$virtual_maps" to your relay_domains line. Then you can use the -same map you use to find virtual recipients to determine if a domain is -a valid virtual domain and should be allowed to relay. +If you're using a version of Postfix newer than 19991226, that should do +it. If not, you also need to add your virtual domains to relay_domains. +Simply add "$virtual_maps" to your relay_domains line. Then you can use +the same map you use to find virtual recipients to determine if a domain +is a valid virtual domain and should be allowed to relay. -For example, the catchall user for a virtual domain might look like -this: +In summary, you might have a catchall user for a virtual domain that +looks like this: - dn: cn=defaultrecipient, dc=fake, dc=dom - objectclass: top - objectclass: rfc822mailgroup - cn: defaultrecipient - owner: uid=root, dc=someserver, dc=isp, dc=dom - mailacceptinggeneralid: fake.dom - mailacceptinggeneralid: @fake.dom - maildrop: realuser@real.dom + dn: cn=defaultrecipient, dc=fake, dc=dom + objectclass: top + objectclass: virtualaccount + cn: defaultrecipient + owner: uid=root, dc=someserver, dc=isp, dc=dom + 1 -> mailacceptinggeneralid: fake.dom + 2 -> mailacceptinggeneralid: @fake.dom + 3 -> maildrop: realuser@real.dom -If you don't necessarily have a catchall user for the domain (i.e. you -want mail to unknown users in the domain to bounce), and don't want to -tag an arbitrary user in the virtual domain, you might define another -LDAP map that finds your virtual domain's domain object entry, and add -that map to relay_domains instead of "$virtual_maps". All that's -necessary is that a search for the domain name return something. +1: Postfix knows fake.dom is a valid virtual domain when it looks for + this and gets something (the maildrop) back. + +2: This causes any mail for unknown users in fake.dom to go to this entry ... + +3: ... and then to its maildrop. + +Normal users might simply have one mailacceptinggeneralid and maildrop, +e.g. "normaluser@fake.dom" and "normaluser@real.dom". + +OTHER USES +---------- Other common uses for LDAP lookups include rewriting senders and recipients with Postfix' canonical lookups, for example in order to make @@ -204,6 +232,11 @@ instead of "userid@site.dom". NOTES AND THINGS TO THINK ABOUT =============================== +- The bits of schema and attribute names used in this document are just + examples. There's nothing special about them, other than that some are + the defaults in the LDAP configuration parameters. You can use + whatever schema you like, and configure Postfix accordingly. + - You probably want to make sure that mailacceptinggeneralids are unique, and that not just anyone can specify theirs as postmaster or root, say. @@ -266,17 +299,17 @@ contents, please include the applicable bits of some directory entries. CREDITS ======= -Support for LDAP was initially written by Prabhat K Singh of VSNL, -Bombay, India, and then hideously bloated by John Hensley to support -multiple sources and more configurable attributes. The caching bits were -initially worked out by Prabhat, then munged to support the multiple -sources. - -Other contributors, of code or direction or dope slaps, include: - -Manuel Guesdon -Carsten Hoeger -Keith Stevenson -Samuel Tardieu +Manuel Guesdon: Spotted a bug with the ldapsource_timeout attribute. +John Hensley: Multiple LDAP sources with more configurable attributes. +Carsten Hoeger: Search scope handling. +LaMont Jones: Domain restriction, URL and DN searches, multiple result + attributes. +Mike Mattice: Alias dereferencing control. +Hery Rakotoarisoa: Patches for LDAPv3 updating. +Prabhat K Singh: Wrote the initial Postfix LDAP lookups and connection caching. +Keith Stevenson: RFC 2254 escaping in queries. +Samuel Tardieu: Noticed that searches could include wildcards, prompting + the work on RFC 2254 escaping in queries. Spotted a bug + in binding. And of course Wietse. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 2f4e9b7f8..7842ce4d2 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,17 +1,45 @@ -Incompatible changes with snapshot-20001027 +Incompatible changes with snapshot-20001029 =========================================== +If this release does not work for you, you can go back to a previous +Postfix version without losing your mail, subject to the "incompatible +changes" listed for previous Postfix releases below. + Berkeley DB support has changed for Solaris, HP-UX, UNIXWARE, IRIX. -You can no longer use the DB 1.85 compatibility interface, because -that interface loses the file lock while building a table, so that -table lookups fail and mail is lost. See the DB_README file for -instructions on how to build with third-party Berkeley DB support. +On these systems, Postfix must no longer use DB 1.85 compatibility +mode, because that mode loses the file lock while building a table, +so that table lookups fail and mail is lost. See the DB_README file +for instructions on how to build Postfix with third-party Berkeley +DB support. The "fast ETRN" policy configuration has changed. You now specify the list of eligible "fast ETRN" domains with the fast_flush_domains parameter (default: $relay_domains). In order to disable the feature, specify an empty value (fast_flush_domains =). +Major changes with snapshot-20001029 +==================================== + +This release ships with an updated LDAP client module that has better +group support by Lamont Jones, and that has several other enhancements. +Review the LDAP_README file for more information. + +The LMTP client can now make connections over UNIX-domain sockets +in addition to IPV4. For connections over UNIX-domain sockets, +specify a transport table entry like: + + domain.name lmtp:unix:/path/name + +IPV4-based servers are still the default. The LMTP_README file +still needs to be revised to account for this change. This is +best done by someone who actually uses the Postfix LMTP client. + +You can now specify multiple SMTP destinations in the relayhost +and fallback_relay configuration parameters. The destinations are +tried in the specified order. Specify host or host:port (perform +MX record lookups), [host] or [host]:port (no MX record lookups), +[address] or [address]:port (numerical IP address). + Incompatible changes with snapshot-20001005 =========================================== diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index e96e68d54..24274dd5c 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -122,9 +122,12 @@ mail_owner = postfix # internal DNS uses no MX records, specify the name of the intranet # gateway host instead. # -# 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. +# In the case of SMTP, specify a domain, host, host:port, [host]:port, +# [address] or [address]:port; the form [host] turns off MX lookups. +# If you specify multiple SMTP destinations, Postfix will try them +# in the specified order. +# +# If you're connected via UUCP, see also the default_transport parameter. # # relayhost = $mydomain # relayhost = gateway.my.domain diff --git a/postfix/conf/sample-misc.cf b/postfix/conf/sample-misc.cf index e5b134b36..9efed230e 100644 --- a/postfix/conf/sample-misc.cf +++ b/postfix/conf/sample-misc.cf @@ -245,9 +245,12 @@ recipient_delimiter = # internal DNS uses no MX records, specify the name of the intranet # gateway host instead. # -# 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. +# In the case of SMTP, specify a domain, host, host:port, [host]:port, +# [address] or [address]:port; the form [host] turns off MX lookups. +# If you specify multiple SMTP destinations, Postfix will try them +# in the specified order. +# +# If you're connected via UUCP, see also the default_transport parameter. # # relayhost = $mydomain # relayhost = gateway.my.domain diff --git a/postfix/conf/sample-smtp.cf b/postfix/conf/sample-smtp.cf index c0fea6563..2359377f8 100644 --- a/postfix/conf/sample-smtp.cf +++ b/postfix/conf/sample-smtp.cf @@ -24,6 +24,11 @@ # By default, mail is bounced when a destination is not found, and # delivery is deferred if a destination is unreachable. # +# In the case of SMTP, specify a domain, host, host:port, [host]:port, +# [address] or [address]:port; the form [host] turns off MX lookups. +# If you specify multiple SMTP destinations, Postfix will try them +# in the specified order. +# fallback_relay = # The ignore_mx_lookup_error parameter controls what happens when a diff --git a/postfix/examples/chroot-setup/LINUX2 b/postfix/examples/chroot-setup/LINUX2 index 1d35e1c8e..78aaab251 100644 --- a/postfix/examples/chroot-setup/LINUX2 +++ b/postfix/examples/chroot-setup/LINUX2 @@ -1,16 +1,56 @@ -# Setup chroot jail for Linux +#! /bin/sh + +# LINUX2 - shell script to set up a Postfix chroot jail for Linux +# Tested on SuSE Linux 5.3 (libc5) and 6.4 (glibc2.1) + +# Copyright (c) 2000 by Matthias Andree +# Redistributable unter the MIT-style license that follows: +# Abstract: "do whatever you want except hold somebody liable or change +# the copyright information". + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +cond_copy() { + # find files as per pattern in $1 + # if any, copy to directory $2 + dir=`dirname "$1"` + pat=`basename "$1"` + lr=`find "$dir" -name "$pat"` + if test ! -d "$2" ; then exit 1 ; fi + if test "x$lr" != "x" ; then cp -p $1 "$2" ; fi +} set -e umask 022 POSTFIX_DIR=${POSTFIX_DIR-/var/spool/postfix} - cd ${POSTFIX_DIR} -mkdir etc -cp /etc/localtime /etc/services /etc/resolv.conf /etc/nsswitch.conf etc -mkdir -p usr/lib/zoneinfo -ln -s /etc/localtime usr/lib/zoneinfo +mkdir -p etc lib usr/lib/zoneinfo -mkdir lib -cp /lib/libnss_* lib +# find localtime (SuSE 5.3 does not have /etc/localtime) +lt=/etc/localtime +if test ! -f $lt ; then lt=/usr/lib/zoneinfo/localtime ; fi +if test ! -f $lt ; then echo "cannot find localtime" ; exit 1 ; fi +cp -p -f $lt /etc/services /etc/resolv.conf /etc/nsswitch.conf etc +cp -p -f /etc/host.conf /etc/hosts /etc/passwd etc +ln -s -f /etc/localtime usr/lib/zoneinfo + +cond_copy '/lib/libnss_*' lib +cond_copy '/lib/libresolv*' lib \ No newline at end of file diff --git a/postfix/html/faq.html b/postfix/html/faq.html index afaeaefe0..0d54625ab 100644 --- a/postfix/html/faq.html +++ b/postfix/html/faq.html @@ -2592,79 +2592,11 @@ systems.
In order to build Postfix with db support on UNIX systems -that do not have db support out of the box, you need the -db-1.85 release, or the current -version which has a db-1.85 compatible interface. - -
- -To build with a third-party DB library, use the following commands -in the Postfix top-level directory. -On Solaris, the LD_LIBRARY_PATH unset commands may be required to -avoid linking in the wrong libraries. - -
- -
- % LD_LIBRARY_PATH= (Bourne-shell syntax) - % unsetenv LD_LIBRARY_PATH (C-shell syntax) - % make tidy - % make makefiles CCARGS="-DHAS_DB -DPATH_DB_H='<db_185.h>' -I/some/where/include" AUXLIBS=/some/where/libdb.a - % make -- -
- -Of course you will have to specify the actual location of the -include directory and of the object library. - -
- -When building with a third-party DB library you may into one of the -following problems: - -
- -
- -
-
-*** db_185.h.orig Tue Mar 7 16:27:32 2000 ---- db_185.h Tue Mar 7 16:27:44 2000 -*************** -*** 166,173 **** - #if defined(__cplusplus) - extern "C" { - #endif -- #ifdef DB_LIBRARY_COMPATIBILITY_API - #define dbopen __db185_open - DB *__db185_open __P((const char *, int, int, DBTYPE, const void *)); - #else - DB *dbopen __P((const char *, int, int, DBTYPE, const void *)); ---- 166,173 ---- - #if defined(__cplusplus) - extern "C" { - #endif - #define dbopen __db185_open -+ #ifdef DB_LIBRARY_COMPATIBILITY_API - DB *__db185_open __P((const char *, int, int, DBTYPE, const void *)); - #else - DB *dbopen __P((const char *, int, int, DBTYPE, const void *)); -- -