From 89d0723baf20636bd84ebe204f3fa901f51dacd9 Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Sun, 19 Dec 1999 00:00:00 -0500 Subject: [PATCH] snapshot-19991219 --- postfix/HISTORY | 29 +- postfix/INSTALL | 1 + postfix/INSTALL.sh | 85 +- postfix/RELEASE_NOTES | 9 +- postfix/conf/main.cf | 4 + postfix/conf/postfix-script-nosgid | 9 + postfix/conf/postfix-script-sgid | 9 + postfix/conf/sample-local.cf | 4 + postfix/global/mail_version.h | 2 +- postfix/html/faq.html | 2110 ++++++++++++++++++---------- postfix/html/uce.html | 3 +- postfix/makedefs | 7 +- postfix/smtpd/smtpd.c | 7 +- 13 files changed, 1518 insertions(+), 761 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index 1f20a1617..ab839d5dc 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -3298,7 +3298,7 @@ Apologies for any names omitted. Bugfix: the local delivery agent's recipient duplicate filter did not work when configured to use unlimited memory - (which is not a recommended setting). Patrik Rak @ein.cz. + (which is not a recommended setting). Patrik Rak @raxoft.cz. 19991125 @@ -3322,7 +3322,7 @@ Apologies for any names omitted. now frees in-memory recipients as soon as a message is delivered to one destination, rather than waiting until all in-memory destinations of that message have been tried. - Patch by Patrik Rak @ ein.cz. Files: qmgr/qmgr_entry.c, + Patch by Patrik Rak @ raxoft.cz. Files: qmgr/qmgr_entry.c, qmgr/qmgr_message.c. Performance: when delivering mail to a huge list of @@ -3346,7 +3346,7 @@ Apologies for any names omitted. Bugfix: the local delivery agent would deliver to the user instead of the .forward file when the .forward file was already visited via some non-recursive path. Patch by Patrik - Rak @ ein.cz. Files: global/been_here.c, local/dotforward.c. + Rak @ raxoft.cz. Files: global/been_here.c, local/dotforward.c. Robustness: attempt to deliver all addresses in the expansion of an alias or .forward file, even when some addresses must @@ -3381,8 +3381,8 @@ Apologies for any names omitted. 19991216 Feature: allow an empty inet_interfaces parameter, just - like an empty mydestination parameter. It's needed for a - true null client that delivers no mail locally at all. + like an empty mydestination parameter. It's needed for true + null clients and for firewalls that deliver no local mail. Feature: "disable_vrfy_command = yes" disables some forms of address harvesting used by spammers. @@ -3409,4 +3409,21 @@ Apologies for any names omitted. Feature: the sendmail -f option now understands '' and even understands address forms with RFC 822-style comments. - + +19991217 + + Cleanup: no more UCE checks for VRFY commands. + +19991218 + + Cleanup: INSTALL.sh produces relative symlinks, which is + necessary when install_root is not /. + +19991219 + + Documentation: completely reorganized the FAQ and added + many new entries. + + Cleanup: INSTALL.sh uses a configurable directory for + scratch files, so that it can install from a file system + that is not writable by the super-user. diff --git a/postfix/INSTALL b/postfix/INSTALL index 55c951e3b..db176903b 100644 --- a/postfix/INSTALL +++ b/postfix/INSTALL @@ -76,6 +76,7 @@ If your system is supported, it is one of OPENSTEP 4.x OSF1.V3 (Digital UNIX) OSF1.V4 aka Digital UNIX V4 + OSF1.V5 aka Digital UNIX V5 OpenBSD 2.x Reliant UNIX 5.x Rhapsody 5.x diff --git a/postfix/INSTALL.sh b/postfix/INSTALL.sh index afc31fb56..481f7957c 100644 --- a/postfix/INSTALL.sh +++ b/postfix/INSTALL.sh @@ -20,6 +20,8 @@ Before installing files, this script prompts you for some definitions. Most definitions will be remembered, so you have to specify them only once. All definitions have a reasonable default value. + tempdir - where to write scratch files + install_root - prefix for installed file names (for package building) config_directory - directory with Postfix configuration files. @@ -39,24 +41,40 @@ only once. All definitions have a reasonable default value. EOF # By now, shells must have functions. Ultrix users must use sh5 or lose. - -# Apparently, some broken LINUX file utilities won't move symlinks across -# file systems. Upgrade to a better system. Don't waste my time. +# The following shell functions replace files/symlinks while minimizing +# the time that a file does not exist, and avoid copying over programs +# in order to not disturb running programs. compare_or_replace() { cmp $2 $3 >/dev/null 2>&1 || { - rm -f junk || exit 1 - cp $2 junk || exit 1 - mv -f junk $3 || exit 1 + rm -f $tempdir/junk || exit 1 + cp $2 $tempdir/junk || exit 1 + chmod $1 $tempdir/junk || exit 1 + mv -f $tempdir/junk $3 || exit 1 chmod $1 $3 || exit 1 } } compare_or_symlink() { cmp $1 $2 >/dev/null 2>&1 || { - rm -f junk || exit 1 - ln -s $1 junk || exit 1 - mv -f junk $2 || exit 1 + rm -f $tempdir/junk || exit 1 + target=`echo $1 | sed ' + s;^'$install_root';; + s;//;/;g + s;/\./;/;g + s;^/*;; + H + s;/[^/]*$;/; + s;[^/]*/;../;g + G + s/\n// + '` + ln -s $target $tempdir/junk || exit 1 + mv -f $tempdir/junk $2 || { + echo Error: your mv command is unable to rename symlinks. 1>&2 + echo If you run Linux, upgrade to GNU fileutils-4.0 or better. 1>&2 + exit 1 + } } } @@ -74,8 +92,9 @@ case `echo -n` in *) n=; c='\c';; esac -# Default settings. These are clobbered by remembered settings. +# Default settings. Most are clobbered by remembered settings. +tempdir=`pwd` install_root=/ config_directory=/etc/postfix daemon_directory=/usr/libexec/postfix @@ -90,7 +109,7 @@ manpages=/usr/local/man # Find out the location of configuration files. -for name in install_root config_directory +for name in tempdir install_root config_directory do while : do @@ -105,11 +124,11 @@ done # Sanity checks -for path in $install_root $config_directory +for path in $tempdir $install_root $config_directory do case $path in /*) ;; - *) echo "$path should be an absolute path name" 1>&2; exit 1;; + *) echo Error: $path should be an absolute path name. 1>&2; exit 1;; esac done @@ -157,29 +176,39 @@ do case $path in /*) ;; no) ;; - *) echo "$path should be an absolute path name" 1>&2; exit 1;; + *) echo Error: $path should be an absolute path name. 1>&2; exit 1;; esac done -rm -f junk || exit 1 -touch junk +test -d $tempdir || mkdir -p $tempdir || exit 1 -chown "$mail_owner" junk >/dev/null 2>&1 || { - echo "Error: $mail_owner needs an entry in the passwd file" 1>&2 - echo "Remember, $mail_owner must have a dedicated user id and group id." 1>&2 +( rm -f $tempdir/junk && touch $tempdir/junk ) || { + echo Error: you have no write permission to $tempdir. 1>&2 + echo Specify an alternative directory for scratch files. 1>&2 + exit 1 +} + +chown root $tempdir/junk >/dev/null 2>&1 || { + echo Error: you have no permission to change file ownership. 1>&2 + exit 1 +} + +chown "$mail_owner" $tempdir/junk >/dev/null 2>&1 || { + echo Error: $mail_owner needs an entry in the passwd file. 1>&2 + echo Remember, $mail_owner must have a dedicated user id and group id. 1>&2 exit 1 } case $setgid in no) ;; - *) chgrp "$setgid" junk >/dev/null 2>&1 || { - echo "Error: $setgid needs an entry in the group file" 1>&2 - echo "Remember, $setgid must have a dedicated group id." 1>&2 + *) chgrp "$setgid" $tempdir/junk >/dev/null 2>&1 || { + echo Error: $setgid needs an entry in the group file. 1>&2 + echo Remember, $setgid must have a dedicated group id. 1>&2 exit 1 } esac -rm -f junk +rm -f $tempdir/junk # Avoid clumsiness. @@ -217,8 +246,8 @@ done test -f bin/sendmail && { compare_or_replace a+x,go-w bin/sendmail $SENDMAIL_PATH || exit 1 - compare_or_symlink $sendmail_path $NEWALIASES_PATH - compare_or_symlink $sendmail_path $MAILQ_PATH + compare_or_symlink $SENDMAIL_PATH $NEWALIASES_PATH + compare_or_symlink $SENDMAIL_PATH $MAILQ_PATH } compare_or_replace a+r,go-w conf/LICENSE $CONFIG_DIRECTORY/LICENSE || exit 1 @@ -250,9 +279,9 @@ bin/postconf -c $CONFIG_DIRECTORY -e \ for name in sendmail_path newaliases_path mailq_path setgid manpages do eval echo $name=\$$name -done) >junk || exit 1 -compare_or_move a+x,go-w junk $CONFIG_DIRECTORY/install.cf || exit 1 -rm -f junk +done) >$tempdir/junk || exit 1 +compare_or_move a+x,go-w $tempdir/junk $CONFIG_DIRECTORY/install.cf || exit 1 +rm -f $tempdir/junk # Use set-gid privileges instead of writable maildrop (optional). diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 8efe894a3..49d31bf8a 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,4 +1,4 @@ -Incompatible changes with snapshot 19991216 +Incompatible changes with snapshot 19991219 =========================================== - The experimental permit_recipient_map feature is gone. It was @@ -27,9 +27,14 @@ parent domain of a transport map entry, you must now add a corresponding "domain.name local:" entry in your transport_maps. See the html/faq.html sections for firewalls and intranets. -Major changes with snapshot 19991216 +Major changes with snapshot 19991219 ==================================== +- Overhauled FAQ (html/faq.html) with many more examples. + +- Several little improvements to the installation procedure: +relative symlinks, configurable directory for scratch files. + - Updated LDAP client code (John Hensley). - Updated mysql client code (Scott Cotton). diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index a8e2ef965..915380aa6 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -256,6 +256,10 @@ mail_owner = postfix # the recipient with proper HOME, SHELL and LOGNAME environment settings. # Exception: delivery for root is done as $default_user. # +# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE WITH, E.G., PROCMAIL, +# YOU MUST SET UP AN ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL +# USER. +# # Other environment variables of interest: USER (recipient username), # EXTENSION (address extension), DOMAIN (domain part of address), # and LOCAL (the address localpart). diff --git a/postfix/conf/postfix-script-nosgid b/postfix/conf/postfix-script-nosgid index 21392f933..5dd1ef238 100755 --- a/postfix/conf/postfix-script-nosgid +++ b/postfix/conf/postfix-script-nosgid @@ -218,6 +218,15 @@ check) $WARN not owned by $mail_owner: $dir) done + for dir in bin etc lib sbin usr + do + test -d $dir && find $dir -type f -print | while read path + do + cmp -s $path /$path || + $WARN $queue_directory/$path and /$path differ + done + done + $command_directory/postsuper || exit 1 find corrupt -type f -exec $WARN damaged message: {} \; diff --git a/postfix/conf/postfix-script-sgid b/postfix/conf/postfix-script-sgid index 337b2ade1..780b475b0 100755 --- a/postfix/conf/postfix-script-sgid +++ b/postfix/conf/postfix-script-sgid @@ -219,6 +219,15 @@ check) $WARN not owned by $mail_owner: $dir) done + for dir in bin etc lib sbin usr + do + test -d $dir && find $dir -type f -print | while read path + do + cmp -s $path /$path || + $WARN $queue_directory/$path and /$path differ + done + done + $command_directory/postsuper || exit 1 find corrupt -type f -exec $WARN damaged message: {} \; diff --git a/postfix/conf/sample-local.cf b/postfix/conf/sample-local.cf index f2c3d4ebe..cb783e6ac 100644 --- a/postfix/conf/sample-local.cf +++ b/postfix/conf/sample-local.cf @@ -100,6 +100,10 @@ home_mailbox = # command to use instead of mailbox delivery. The command is run # as the recipient with proper HOME, SHELL and LOGNAME environment settings. # Exception: delivery for root is done as $default_user. +# +# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE WITH, E.G., PROCMAIL, +# YOU MUST SET UP AN ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL +# USER. # # Other environment variables of interest: USER (recipient username), # EXTENSION (address extension), DOMAIN (domain part of address), diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h index e20640c22..3fdd077ec 100644 --- a/postfix/global/mail_version.h +++ b/postfix/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-19991216" +#define DEF_MAIL_VERSION "Snapshot-19991219" extern char *var_mail_version; /* LICENSE diff --git a/postfix/html/faq.html b/postfix/html/faq.html index f938652fd..24ac8b12c 100644 --- a/postfix/html/faq.html +++ b/postfix/html/faq.html @@ -18,49 +18,177 @@

Table of contents

+

+

+ +

+ +

Example configurations

+ + -
  • Delivering some users locally while sending mail as user@domain +

    Sendmail incompatibility

    -
  • Address masquerading with exceptions - -
  • Support for virus scanning - -
  • Support for maildir-style mailboxes - -
  • Using Procmail for local delivery + + +

    Mail relaying

    + +
    + +

    Delivery to remote systems

    + +
    + +

    Delivery to local (non-virtual) addresses

    + +
    + +

    Mailing lists

    + +
    + +

    Virtual domains

    + +
    + +

    Address rewriting

    + +
    + +

    Content filtering

    + +
    + +

    Other transports: UUCP, FAX, etc.

    + +
    -
  • Mail fails with timeout or lost connection +

    Compiling and installing Postfix

    -

    +