]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-19991117
authorWietse Venema <wietse@porcupine.org>
Wed, 17 Nov 1999 05:00:00 +0000 (00:00 -0500)
committerWietse Venema <wietse@porcupine.org>
Thu, 17 Jan 2013 23:09:46 +0000 (18:09 -0500)
31 files changed:
postfix/HISTORY
postfix/INSTALL.sh
postfix/cleanup/Makefile.in
postfix/dns/dns.h
postfix/global/Makefile.in
postfix/global/local_transport.c
postfix/global/mail_version.h
postfix/local/Makefile.in
postfix/postalias/Makefile.in
postfix/postconf/Makefile.in
postfix/postconf/postconf.c
postfix/postmap/Makefile.in
postfix/qmgr/Makefile.in
postfix/qmgr/qmgr.c
postfix/smtp/Makefile.in
postfix/smtpd/Makefile.in
postfix/smtpd/smtpd.c
postfix/smtpd/smtpd.h
postfix/smtpd/smtpd_check.c
postfix/smtpd/smtpd_check.in2
postfix/smtpd/smtpd_check.ref2
postfix/smtpd/smtpd_peer.c [new file with mode: 0644]
postfix/smtpd/smtpd_state.c
postfix/smtpd/smtpd_token.c
postfix/smtpd/smtpd_token.ref
postfix/trivial-rewrite/Makefile.in
postfix/trivial-rewrite/resolve.c
postfix/util/Makefile.in
postfix/util/dict.h
postfix/util/sys_defs.h
postfix/util/watchdog.c

index 5618544890b420c8c1bc70f40fdb587bb4ee2240..9acf0f127930a40a435951fb1f5b10ad208970d1 100644 (file)
@@ -3240,3 +3240,19 @@ Apologies for any names omitted.
        The edit is done on a copy, and the copy is renamed into
        the place of the original. File: postconf/postconf.c,
        util/readlline.[hc].
+
+19991117
+
+       Feature: on systems with h_errno, the "reject_unknown_client"
+       restriction now distinguishes between soft errors (always
+       reply with 450) and hard errors (use the user-specified
+       reply code).  This should lessen the load by broken mailers
+       that re-connect once a minute.
+
+       Feature: forward/reverse name/address check for SMTP client
+       hostnames. This fends off some hypothetical attacks by
+       spammers who are in control of their own reverse mapping.
+
+       Robustness: postconf no longer aborts when it can't figure
+       out the local domain name; it prints a warning instead.
+       This allows you to use "postconf -e" to fix the problem.
index 6684494e69c296b8e188cbeb989e2f6cad38205e..9cebaaec8df075ccbdb1a049906edce31ca58005 100644 (file)
@@ -6,21 +6,40 @@
 PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc
 umask 022
 
-# Workaround, should edit main.cf in place.
-trap 'rm -f ./main.cf; exit' 0 1 2 3 15
+# Default settings, edit to taste or change interactively. Once this
+# script has run it saves settings to $config_directory/install.cf.
+
+config_directory=/etc/postfix
+daemon_directory=/usr/libexec/postfix
+command_directory=/usr/sbin
+queue_directory=/var/spool/postfix
+sendmail_path=/usr/sbin/sendmail
+newaliases_path=/usr/bin/newaliases
+mailq_path=/usr/bin/mailq
+mail_owner=postfix
+setgid=no
+manpages=no
+
+# Load defaults from existing installation.
+
+test -f $config_directory/main.cf && {
+    for name in daemon_directory command_directory queue_directory mail_owner 
+    do
+       eval "$name=\"\`bin/postconf -h $name || kill \$\$\`\""
+    done
+}
+
+test -f $config_directory/install.cf && . $config_directory/install.cf
 
 cat <<EOF
 
 Warning: this script replaces existing sendmail or Postfix programs.
 Make backups if you want to be able to recover.
 
-Otherwise, the script should be safe for installing or upgrading
-Postfix.  Existing configuration and queue files are left alone;
-existing program files and scripts are replaced, not overwritten.
-This is safe unless you are sharing files over NFS.
-
-In particular, this script can be used to change Postfix from using
-a world-writable maildrop to a group-writable one.
+In addition to doing a fresh install, this script can change an
+existing installation from using a world-writable maildrop to a
+group-writable one. It cannot be used to change Postfix queue
+ownership.
 
 Before installing files, this script prompts you for some definitions.
 You can either edit this script ahead of time, or you can specify
@@ -35,54 +54,13 @@ your changes interactively.
     newaliases_path - full pathname of the Postfix newaliases command.
     mailq_path - full pathname of the Postfix mailq command.
 
-    owner - owner of Postfix queue files.
+    mail_owner - owner of Postfix queue files.
 
     setgid - groupname, e.g., postdrop (default: no). See INSTALL section 12.
     manpages - path to man tree (default: no). Example: /usr/local/man.
 
 EOF
 
-# Default settings, edit to taste or change interactively. Once this
-# script has run it saves settings to $config_directory/install.cf.
-
-# *BSD, LINUX
-config_directory=/etc/postfix
-daemon_directory=/usr/libexec/postfix
-command_directory=/usr/sbin
-queue_directory=/var/spool/postfix
-sendmail_path=/usr/sbin/sendmail
-newaliases_path=/usr/bin/newaliases
-mailq_path=/usr/bin/mailq
-owner=postfix
-setgid=no
-manpages=no
-
-# Solaris, System V.4
-#config_directory=/etc/postfix
-#daemon_directory=/usr/lib/postfix
-#command_directory=/usr/sbin
-#queue_directory=/var/spool/postfix
-#sendmail_path=/usr/lib/sendmail
-#newaliases_path=/usr/bin/newaliases
-#mailq_path=/usr/bin/mailq
-#owner=postfix
-#setgid=no
-#manpages=no
-
-# SunOS 4
-#config_directory=/etc/postfix
-#daemon_directory=/usr/lib/postfix
-#command_directory=/usr/etc
-#queue_directory=/var/spool/postfix
-#sendmail_path=/usr/lib/sendmail
-#newaliases_path=/usr/ucb/newaliases
-#mailq_path=/usr/ucb/mailq
-#owner=postfix
-#setgid=no
-#manpages=no
-
-test -f $config_directory/install.cf && . $config_directory/install.cf
-
 # By now, shells must have functions. Ultrix users must use sh5 or lose.
 
 compare_or_replace() {
@@ -115,7 +93,7 @@ case `echo -n` in
 esac
 
 for name in config_directory daemon_directory command_directory \
-    queue_directory sendmail_path newaliases_path mailq_path owner \
+    queue_directory sendmail_path newaliases_path mailq_path mail_owner \
     setgid manpages
 do
     while :
@@ -141,28 +119,6 @@ do
    esac
 done
 
-# Workaround, should edit main.cf in place.
-test -f $config_directory/main.cf || {
-    echo "mail_owner = $owner" >./main.cf
-    echo "myhostname = xx.yy" >>./main.cf
-    alt_main="-c ."
-}
-
-bin/postmap $alt_main -q "$owner" unix:passwd.byname >/dev/null || {
-    echo "$owner needs an entry in the passwd file" 1>&2
-    echo "Remember, $owner must have a dedicated user id and group id." 1>&2
-    exit 1
-}
-
-case $setgid in
-no) ;;
- *) bin/postmap $alt_main -q "$setgid" unix:group.byname >/dev/null || {
-       echo "$setgid needs an entry in the group file" 1>&2
-       echo "Remember, $setgid must have a dedicated group id." 1>&2
-       exit 1
-    }
-esac
-
 # Create any missing directories.
 
 test -d $config_directory || mkdir -p $config_directory || exit 1
@@ -170,18 +126,6 @@ test -d $daemon_directory || mkdir -p $daemon_directory || exit 1
 test -d $command_directory || mkdir -p $command_directory || exit 1
 test -d $queue_directory || mkdir -p $queue_directory || exit 1
 
-# Save settings.
-
-(echo "# This file was generated by $0"
-for name in config_directory daemon_directory command_directory \
-    queue_directory sendmail_path newaliases_path mailq_path owner \
-    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
-
 # Install files. Be careful to not copy over running programs.
 
 for file in `ls libexec`
@@ -205,12 +149,6 @@ compare_or_replace a+r,go-w conf/LICENSE $config_directory/LICENSE || exit 1
 test -f $config_directory/main.cf || {
     cp conf/* $config_directory || exit 1
     chmod a+r,go-w $config_directory/* || exit 1
-    sed "
-       s;^daemon_directory .*;daemon_directory = $daemon_directory;
-       s;^command_directory .*;command_directory = $command_directory;
-       s;^queue_directory .*;queue_directory = $queue_directory;
-       s;^mail_owner .*;mail_owner = $owner;
-    " conf/main.cf >$config_directory/main.cf || exit 1
 
     echo "Warning: you still need to edit myorigin/mydestination in" 1>&2
     echo "$config_directory/main.cf. See also html/faq.html for dialup" 1>&2
@@ -220,6 +158,24 @@ test -f $config_directory/main.cf || {
     echo "for root and postmaster, then run the newaliases command." 1>&2
 }
 
+# Save settings.
+
+postconf -e \
+    "daemon_directory = $daemon_directory" \
+    "command_directory = $command_directory" \
+    "queue_directory = $queue_directory" \
+    "mail_owner = $mail_owner" \
+|| exit 1
+
+(echo "# This file was generated by $0"
+for name in config_directory 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
+
 # Use set-gid privileges instead of writable maildrop (optional).
 
 test -d $queue_directory/maildrop || {
index 23eaa291394d84984b451071df90d9e611a1a18c..47bcbe6fe86df327b1b6f34df2f18465b4a58054 100644 (file)
@@ -69,6 +69,7 @@ cleanup.o: ../include/vstream.h
 cleanup.o: ../include/mymalloc.h
 cleanup.o: ../include/iostuff.h
 cleanup.o: ../include/dict.h
+cleanup.o: ../include/argv.h
 cleanup.o: ../include/mail_conf.h
 cleanup.o: ../include/cleanup_user.h
 cleanup.o: ../include/mail_queue.h
@@ -81,7 +82,6 @@ cleanup.o: ../include/mail_addr.h
 cleanup.o: ../include/ext_prop.h
 cleanup.o: ../include/mail_server.h
 cleanup.o: cleanup.h
-cleanup.o: ../include/argv.h
 cleanup.o: ../include/maps.h
 cleanup.o: ../include/tok822.h
 cleanup.o: ../include/resolve_clnt.h
@@ -133,10 +133,10 @@ cleanup_map11.o: ../include/vstring.h
 cleanup_map11.o: ../include/vbuf.h
 cleanup_map11.o: ../include/dict.h
 cleanup_map11.o: ../include/vstream.h
+cleanup_map11.o: ../include/argv.h
 cleanup_map11.o: ../include/mymalloc.h
 cleanup_map11.o: ../include/cleanup_user.h
 cleanup_map11.o: ../include/mail_addr_map.h
-cleanup_map11.o: ../include/argv.h
 cleanup_map11.o: ../include/maps.h
 cleanup_map11.o: ../include/quote_822_local.h
 cleanup_map11.o: cleanup.h
index 0d3496c84e737035397a079d832082a5d5a010f4..490a5ff39236990b6e2b53bc8a247ff97c20a910 100644 (file)
        (cp) += 4; \
 }
 
+#endif
+
+ /*
+  * SunOS 4 needs this.
+  */
+#ifndef T_TXT
+#define T_TXT  16
 #endif
 
  /*
index e4c6889ce0db9365e102d31dcb5f336db2d3aa76..eb810ae6d877f936c23771d5c5c6e3b0dbafe025 100644 (file)
@@ -396,6 +396,7 @@ mail_addr_find.o: ../include/msg.h
 mail_addr_find.o: ../include/dict.h
 mail_addr_find.o: ../include/vstream.h
 mail_addr_find.o: ../include/vbuf.h
+mail_addr_find.o: ../include/argv.h
 mail_addr_find.o: ../include/stringops.h
 mail_addr_find.o: ../include/mymalloc.h
 mail_addr_find.o: ../include/vstring.h
@@ -438,6 +439,7 @@ mail_conf.o: ../include/vstream.h
 mail_conf.o: ../include/vbuf.h
 mail_conf.o: ../include/vstring.h
 mail_conf.o: ../include/dict.h
+mail_conf.o: ../include/argv.h
 mail_conf.o: ../include/safe.h
 mail_conf.o: ../include/stringops.h
 mail_conf.o: mail_params.h
@@ -448,6 +450,7 @@ mail_conf_bool.o: ../include/msg.h
 mail_conf_bool.o: ../include/dict.h
 mail_conf_bool.o: ../include/vstream.h
 mail_conf_bool.o: ../include/vbuf.h
+mail_conf_bool.o: ../include/argv.h
 mail_conf_bool.o: mail_conf.h
 mail_conf_int.o: mail_conf_int.c
 mail_conf_int.o: ../include/sys_defs.h
@@ -456,6 +459,7 @@ mail_conf_int.o: ../include/mymalloc.h
 mail_conf_int.o: ../include/dict.h
 mail_conf_int.o: ../include/vstream.h
 mail_conf_int.o: ../include/vbuf.h
+mail_conf_int.o: ../include/argv.h
 mail_conf_int.o: ../include/stringops.h
 mail_conf_int.o: mail_conf.h
 mail_conf_raw.o: mail_conf_raw.c
@@ -638,6 +642,7 @@ mkmap_db.o: ../include/stringops.h
 mkmap_db.o: ../include/dict.h
 mkmap_db.o: ../include/vstream.h
 mkmap_db.o: ../include/vbuf.h
+mkmap_db.o: ../include/argv.h
 mkmap_db.o: ../include/dict_db.h
 mkmap_db.o: mkmap.h
 mkmap_dbm.o: mkmap_dbm.c
@@ -648,6 +653,7 @@ mkmap_dbm.o: ../include/stringops.h
 mkmap_dbm.o: ../include/dict.h
 mkmap_dbm.o: ../include/vstream.h
 mkmap_dbm.o: ../include/vbuf.h
+mkmap_dbm.o: ../include/argv.h
 mkmap_dbm.o: ../include/dict_dbm.h
 mkmap_dbm.o: mkmap.h
 mkmap_open.o: mkmap_open.c
@@ -656,6 +662,7 @@ mkmap_open.o: ../include/msg.h
 mkmap_open.o: ../include/dict.h
 mkmap_open.o: ../include/vstream.h
 mkmap_open.o: ../include/vbuf.h
+mkmap_open.o: ../include/argv.h
 mkmap_open.o: ../include/sigdelay.h
 mkmap_open.o: ../include/mymalloc.h
 mkmap_open.o: ../include/myflock.h
index 97f3f623fd79d15be0deaaa8cfb8d4a8238df1d8..c555f3f5701da2b1671016649f38eb90d8c9a1cb 100644 (file)
@@ -12,8 +12,8 @@
 /*     const char *transport;
 /* DESCRIPTION
 /*     This module uses the information kept in the "local_transports"
-/*     configuration parameter, which lists the names of the default
-/*     local transport followed by zero or more other transports that
+/*     configuration parameter, which lists the name of the default
+/*     local transport, followed by zero or more other transports that
 /*     deliver locally.
 /*
 /*     def_local_transport() returns the name of the default local
@@ -90,7 +90,7 @@ const char *def_local_transport(void)
     /*
      * Initialize on the fly.
      */
-    if (local_transport_list == 0)
+    if (local_transport_name == 0)
        local_transport_init();
 
     /*
index d2a5741a2159cc05ea8bd18e5b0fe0ed7bfd9570..042b353f9d38928f24dcc304c37000b049bba2fa 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-19991116"
+#define DEF_MAIL_VERSION       "Snapshot-19991117"
 extern char *var_mail_version;
 
 /* LICENSE
index 47c074ee52b2a0a0e1770a5e62847e74b8a51cfa..e14912d661180719fa30e2bd46ab48fd99f5e2b3 100644 (file)
@@ -264,6 +264,7 @@ local.o: ../include/iostuff.h
 local.o: ../include/name_mask.h
 local.o: ../include/set_eugid.h
 local.o: ../include/dict.h
+local.o: ../include/argv.h
 local.o: ../include/recipient_list.h
 local.o: ../include/deliver_request.h
 local.o: ../include/deliver_completed.h
@@ -351,6 +352,7 @@ recipient.o: ../include/stringops.h
 recipient.o: ../include/dict.h
 recipient.o: ../include/vstream.h
 recipient.o: ../include/vbuf.h
+recipient.o: ../include/argv.h
 recipient.o: ../include/bounce.h
 recipient.o: ../include/mail_params.h
 recipient.o: ../include/split_addr.h
index 3c4690eaf539d852c4bb6f4db0ba69c8af12ff3c..1304d7844f5ed7878919ee0b770384b162733fe6 100644 (file)
@@ -71,3 +71,4 @@ postalias.o: ../include/mail_conf.h
 postalias.o: ../include/mail_params.h
 postalias.o: ../include/mkmap.h
 postalias.o: ../include/dict.h
+postalias.o: ../include/argv.h
index 7d5fba67bf32be6f9080abb39ec027d5e7cc98a9..a0b8cd1a32bce1d7e8689b70901d05e8e385a364 100644 (file)
@@ -74,9 +74,13 @@ postconf.o: ../include/get_hostname.h
 postconf.o: ../include/stringops.h
 postconf.o: ../include/htable.h
 postconf.o: ../include/dict.h
+postconf.o: ../include/argv.h
 postconf.o: ../include/safe.h
 postconf.o: ../include/mymalloc.h
-postconf.o: ../include/line_wrap.h
+postconf.o: ../include/split_at.h
+postconf.o: ../include/readlline.h
+postconf.o: ../include/vstring.h
+postconf.o: ../include/myflock.h
 postconf.o: ../include/mynetworks.h
 postconf.o: ../include/mail_conf.h
 postconf.o: ../include/mail_proto.h
index dbc99f3075332576eea90af13a4849c7a487b727..dce3e75d74018c1a789c73deea30eda49bef527b 100644 (file)
@@ -187,10 +187,12 @@ static const char *check_myhostname(void)
      */
     name = get_hostname();
     if ((mode & SHOW_DEFS) == 0 && (dot = strchr(name, '.')) == 0) {
-       if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0)
-           msg_fatal("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf",
-                     name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir);
-       name = concatenate(name, ".", domain, (char *) 0);
+       if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0) {
+           msg_warn("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf",
+                    name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir);
+       } else {
+           name = concatenate(name, ".", domain, (char *) 0);
+       }
     }
     return (name);
 }
@@ -263,6 +265,8 @@ static void edit_parameters(int argc, char **argv)
        if ((value = split_at(cp, '=')) == 0
            || *(cp += strspn(cp, " \t\r\n")) == 0)
            msg_fatal("edit requires \"key = value\" arguments");
+       while (*value && ISSPACE(*value))
+           value++;
        cvalue = (struct cvalue *) mymalloc(sizeof(*cvalue));
        cvalue->value = value;
        cvalue->found = 0;
index 436b7d748ef1305cb33bd0184c4b4e7721211068..5cd483acd38e272fd899b0f44855c01d275ae18b 100644 (file)
@@ -68,3 +68,4 @@ postmap.o: ../include/mail_conf.h
 postmap.o: ../include/mail_params.h
 postmap.o: ../include/mkmap.h
 postmap.o: ../include/dict.h
+postmap.o: ../include/argv.h
index 4175c94686eab38337e7b594c4ffe49a5d548180..f2df8573db69c9616ec325cacf72099b7a4df04d 100644 (file)
@@ -65,6 +65,7 @@ qmgr.o: ../include/events.h
 qmgr.o: ../include/vstream.h
 qmgr.o: ../include/vbuf.h
 qmgr.o: ../include/dict.h
+qmgr.o: ../include/argv.h
 qmgr.o: ../include/mail_queue.h
 qmgr.o: ../include/vstring.h
 qmgr.o: ../include/recipient_list.h
@@ -96,6 +97,7 @@ qmgr_active.o: qmgr.h
 qmgr_active.o: ../include/scan_dir.h
 qmgr_active.o: ../include/maps.h
 qmgr_active.o: ../include/dict.h
+qmgr_active.o: ../include/argv.h
 qmgr_bounce.o: qmgr_bounce.c
 qmgr_bounce.o: ../include/sys_defs.h
 qmgr_bounce.o: ../include/bounce.h
@@ -106,6 +108,7 @@ qmgr_bounce.o: qmgr.h
 qmgr_bounce.o: ../include/scan_dir.h
 qmgr_bounce.o: ../include/maps.h
 qmgr_bounce.o: ../include/dict.h
+qmgr_bounce.o: ../include/argv.h
 qmgr_defer.o: qmgr_defer.c
 qmgr_defer.o: ../include/sys_defs.h
 qmgr_defer.o: ../include/msg.h
@@ -117,6 +120,7 @@ qmgr_defer.o: qmgr.h
 qmgr_defer.o: ../include/scan_dir.h
 qmgr_defer.o: ../include/maps.h
 qmgr_defer.o: ../include/dict.h
+qmgr_defer.o: ../include/argv.h
 qmgr_deliver.o: qmgr_deliver.c
 qmgr_deliver.o: ../include/sys_defs.h
 qmgr_deliver.o: ../include/msg.h
@@ -134,6 +138,7 @@ qmgr_deliver.o: qmgr.h
 qmgr_deliver.o: ../include/scan_dir.h
 qmgr_deliver.o: ../include/maps.h
 qmgr_deliver.o: ../include/dict.h
+qmgr_deliver.o: ../include/argv.h
 qmgr_enable.o: qmgr_enable.c
 qmgr_enable.o: ../include/sys_defs.h
 qmgr_enable.o: ../include/msg.h
@@ -143,6 +148,7 @@ qmgr_enable.o: qmgr.h
 qmgr_enable.o: ../include/scan_dir.h
 qmgr_enable.o: ../include/maps.h
 qmgr_enable.o: ../include/dict.h
+qmgr_enable.o: ../include/argv.h
 qmgr_entry.o: qmgr_entry.c
 qmgr_entry.o: ../include/sys_defs.h
 qmgr_entry.o: ../include/msg.h
@@ -155,6 +161,7 @@ qmgr_entry.o: qmgr.h
 qmgr_entry.o: ../include/scan_dir.h
 qmgr_entry.o: ../include/maps.h
 qmgr_entry.o: ../include/dict.h
+qmgr_entry.o: ../include/argv.h
 qmgr_message.o: qmgr_message.c
 qmgr_message.o: ../include/sys_defs.h
 qmgr_message.o: ../include/msg.h
@@ -178,6 +185,7 @@ qmgr_message.o: ../include/deliver_completed.h
 qmgr_message.o: ../include/mail_addr_find.h
 qmgr_message.o: ../include/maps.h
 qmgr_message.o: ../include/opened.h
+qmgr_message.o: ../include/local_transport.h
 qmgr_message.o: ../include/resolve_clnt.h
 qmgr_message.o: qmgr.h
 qmgr_message.o: ../include/scan_dir.h
@@ -194,6 +202,7 @@ qmgr_move.o: ../include/mail_scan_dir.h
 qmgr_move.o: qmgr.h
 qmgr_move.o: ../include/maps.h
 qmgr_move.o: ../include/dict.h
+qmgr_move.o: ../include/argv.h
 qmgr_queue.o: qmgr_queue.c
 qmgr_queue.o: ../include/sys_defs.h
 qmgr_queue.o: ../include/msg.h
@@ -208,6 +217,7 @@ qmgr_queue.o: ../include/vbuf.h
 qmgr_queue.o: ../include/scan_dir.h
 qmgr_queue.o: ../include/maps.h
 qmgr_queue.o: ../include/dict.h
+qmgr_queue.o: ../include/argv.h
 qmgr_rcpt_list.o: qmgr_rcpt_list.c
 qmgr_rcpt_list.o: ../include/sys_defs.h
 qmgr_rcpt_list.o: ../include/mymalloc.h
@@ -217,6 +227,7 @@ qmgr_rcpt_list.o: ../include/vbuf.h
 qmgr_rcpt_list.o: ../include/scan_dir.h
 qmgr_rcpt_list.o: ../include/maps.h
 qmgr_rcpt_list.o: ../include/dict.h
+qmgr_rcpt_list.o: ../include/argv.h
 qmgr_scan.o: qmgr_scan.c
 qmgr_scan.o: ../include/sys_defs.h
 qmgr_scan.o: ../include/msg.h
@@ -228,6 +239,7 @@ qmgr_scan.o: ../include/vstream.h
 qmgr_scan.o: ../include/vbuf.h
 qmgr_scan.o: ../include/maps.h
 qmgr_scan.o: ../include/dict.h
+qmgr_scan.o: ../include/argv.h
 qmgr_transport.o: qmgr_transport.c
 qmgr_transport.o: ../include/sys_defs.h
 qmgr_transport.o: ../include/msg.h
@@ -245,3 +257,4 @@ qmgr_transport.o: qmgr.h
 qmgr_transport.o: ../include/scan_dir.h
 qmgr_transport.o: ../include/maps.h
 qmgr_transport.o: ../include/dict.h
+qmgr_transport.o: ../include/argv.h
index 2259cd1f7fb939b70676438ffe2d784a03e53787..d027c976521983a3f437f9b1474f51f42048df84 100644 (file)
@@ -474,6 +474,7 @@ int     main(int argc, char **argv)
     trigger_server_main(argc, argv, qmgr_trigger_event,
                        MAIL_SERVER_INT_TABLE, int_table,
                        MAIL_SERVER_STR_TABLE, str_table,
+                       MAIL_SERVER_BOOL_TABLE, bool_table,
                        MAIL_SERVER_PRE_INIT, qmgr_pre_init,
                        MAIL_SERVER_POST_INIT, qmgr_post_init,
                        MAIL_SERVER_LOOP, qmgr_loop,
index 53adda307b1ab34f777dcb81643a2521bd7d9d5b..c7163fdf41ede9e72da8068b9573701afe45d6ac 100644 (file)
@@ -72,6 +72,7 @@ smtp.o: ../include/sys_defs.h
 smtp.o: ../include/dict.h
 smtp.o: ../include/vstream.h
 smtp.o: ../include/vbuf.h
+smtp.o: ../include/argv.h
 smtp.o: ../include/msg.h
 smtp.o: ../include/mymalloc.h
 smtp.o: ../include/name_mask.h
@@ -87,7 +88,6 @@ smtp.o: ../include/mail_proto.h
 smtp.o: ../include/iostuff.h
 smtp.o: ../include/mail_server.h
 smtp.o: smtp.h
-smtp.o: ../include/argv.h
 smtp_addr.o: smtp_addr.c
 smtp_addr.o: ../include/sys_defs.h
 smtp_addr.o: ../include/msg.h
index 1b8c0cac8afeb171c46139d1136d83a35abdb8c9..f253df57160f6f51e932121877fa5eeb9f4c98ba 100644 (file)
@@ -1,6 +1,8 @@
 SHELL  = /bin/sh
-SRCS   = smtpd.c smtpd_token.c smtpd_check.c smtpd_chat.c smtpd_state.c
-OBJS   = smtpd.o smtpd_token.o smtpd_check.o smtpd_chat.o smtpd_state.o
+SRCS   = smtpd.c smtpd_token.c smtpd_check.c smtpd_chat.c smtpd_state.c \
+       smtpd_peer.c
+OBJS   = smtpd.o smtpd_token.o smtpd_check.o smtpd_chat.o smtpd_state.o \
+       smtpd_peer.o
 HDRS   = smtpd_token.h smtpd_check.h smtpd_chat.h
 TESTSRC        = smtpd_token_test.c
 WARN   = -W -Wformat -Wimplicit -Wmissing-prototypes \
@@ -28,7 +30,7 @@ update: ../libexec/$(PROG)
 ../libexec/$(PROG): $(PROG)
        cp $(PROG) ../libexec
 
-SMTPD_CHECK_OBJ = smtpd_state.o
+SMTPD_CHECK_OBJ = smtpd_state.o smtpd_peer.o
 
 smtpd_token: smtpd_token.c $(LIBS)
        $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIBS) $(SYSLIBS)
@@ -97,7 +99,7 @@ smtpd.o: ../include/events.h
 smtpd.o: ../include/smtp_stream.h
 smtpd.o: ../include/valid_hostname.h
 smtpd.o: ../include/dict.h
-smtpd.o: ../include/peer_name.h
+smtpd.o: ../include/argv.h
 smtpd.o: ../include/mail_params.h
 smtpd.o: ../include/record.h
 smtpd.o: ../include/rec_type.h
@@ -118,7 +120,6 @@ smtpd.o: ../include/resolve_clnt.h
 smtpd.o: ../include/mail_server.h
 smtpd.o: smtpd_token.h
 smtpd.o: smtpd.h
-smtpd.o: ../include/argv.h
 smtpd.o: smtpd_check.h
 smtpd.o: smtpd_chat.h
 smtpd_chat.o: smtpd_chat.c
@@ -176,6 +177,18 @@ smtpd_check.o: ../include/local_transport.h
 smtpd_check.o: smtpd.h
 smtpd_check.o: ../include/mail_stream.h
 smtpd_check.o: smtpd_check.h
+smtpd_peer.o: smtpd_peer.c
+smtpd_peer.o: ../include/sys_defs.h
+smtpd_peer.o: ../include/msg.h
+smtpd_peer.o: ../include/mymalloc.h
+smtpd_peer.o: ../include/valid_hostname.h
+smtpd_peer.o: ../include/stringops.h
+smtpd_peer.o: smtpd.h
+smtpd_peer.o: ../include/vstream.h
+smtpd_peer.o: ../include/vbuf.h
+smtpd_peer.o: ../include/vstring.h
+smtpd_peer.o: ../include/argv.h
+smtpd_peer.o: ../include/mail_stream.h
 smtpd_state.o: smtpd_state.c
 smtpd_state.o: ../include/sys_defs.h
 smtpd_state.o: ../include/events.h
@@ -183,7 +196,6 @@ smtpd_state.o: ../include/mymalloc.h
 smtpd_state.o: ../include/vstream.h
 smtpd_state.o: ../include/vbuf.h
 smtpd_state.o: ../include/name_mask.h
-smtpd_state.o: ../include/stringops.h
 smtpd_state.o: ../include/cleanup_user.h
 smtpd_state.o: ../include/mail_params.h
 smtpd_state.o: ../include/mail_error.h
index a5f65544ef608353f05deb4e11e0d02afd597d90..be0aa0c13551c172263c93b2925176a2dcfca633 100644 (file)
 
 /* Global library. */
 
-#include <peer_name.h>
 #include <mail_params.h>
 #include <record.h>
 #include <rec_type.h>
@@ -1167,7 +1166,6 @@ static void smtpd_proto(SMTPD_STATE *state)
 static void smtpd_service(VSTREAM *stream, char *unused_service, char **argv)
 {
     SMTPD_STATE state;
-    PEER_NAME *peer;
 
     /*
      * Sanity check. This service takes no command-line arguments.
@@ -1184,8 +1182,7 @@ static void smtpd_service(VSTREAM *stream, char *unused_service, char **argv)
      * take a while. This is why I always run a local name server on critical
      * machines.
      */
-    peer = peer_name(vstream_fileno(stream));
-    smtpd_state_init(&state, stream, peer->name, peer->addr);
+    smtpd_state_init(&state, stream);
 
     /*
      * See if we need to turn on verbose logging for this client.
index 4e72a08803c1e6529fbbb0b1aa36ca54a4e1acc7..cf934f141ba49c053f9459e875cb3a75123a143f 100644 (file)
@@ -34,6 +34,7 @@ typedef struct SMTPD_STATE {
     char   *name;
     char   *addr;
     char   *namaddr;
+    int     peer_code;                 /* 2=ok, 4=soft, 5=hard */
     int     error_count;
     int     error_mask;
     int     notify_mask;
@@ -52,8 +53,7 @@ typedef struct SMTPD_STATE {
     char   *where;
 } SMTPD_STATE;
 
-extern void smtpd_state_init(SMTPD_STATE *, VSTREAM *,
-                                    const char *, const char *);
+extern void smtpd_state_init(SMTPD_STATE *, VSTREAM *);
 extern void smtpd_state_reset(SMTPD_STATE *);
 
  /*
@@ -70,6 +70,12 @@ extern void smtpd_state_reset(SMTPD_STATE *);
 #define SMTPD_STAND_ALONE(state) \
        (state->client == VSTREAM_IN && getuid() != var_owner_uid)
 
+ /*
+  * SMPTD peer information lookup.
+  */
+void    smtpd_peer_init(SMTPD_STATE *state);
+void    smtpd_peer_reset(SMTPD_STATE *state);
+
 /* LICENSE
 /* .ad
 /* .fi
index a31fcc3cef0dffb7c620065e06a620804f7005cc..48eaac71ae4be76b62c36992d2e027f2faf02db4 100644 (file)
@@ -496,7 +496,9 @@ static int reject_unknown_client(SMTPD_STATE *state)
     if (strcasecmp(state->name, "unknown") == 0)
        return (smtpd_check_reject(state, MAIL_ERROR_POLICY,
                 "%d Client host rejected: cannot find your hostname, [%s]",
-                                  var_unk_client_code, state->addr));
+                                  state->peer_code == 5 ?
+                                  var_unk_client_code : 450,
+                                  state->addr));
     return (SMTPD_CHECK_DUNNO);
 }
 
@@ -734,7 +736,7 @@ static int check_relay_domains(SMTPD_STATE *state, char *recipient,
 
 /* permit_auth_destination - OK for message relaying */
 
-static int permit_auth_destination(SMTPD_STATE *state, char *recipient)
+static int permit_auth_destination(char *recipient)
 {
     char   *myname = "permit_auth_destination";
     char   *domain;
@@ -1606,7 +1608,7 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions,
                status = permit_mx_backup(state, state->recipient);
        } else if (strcasecmp(name, PERMIT_AUTH_DEST) == 0) {
            if (state->recipient)
-               status = permit_auth_destination(state, state->recipient);
+               status = permit_auth_destination(state->recipient);
        } else if (strcasecmp(name, REJECT_UNAUTH_DEST) == 0) {
            if (state->recipient)
                status = reject_unauth_destination(state, state->recipient);
@@ -1931,6 +1933,7 @@ char   *var_maps_rbl_domains;
 char   *var_mydest;
 char   *var_inet_interfaces;
 char   *var_rest_classes;
+char   *var_local_transports;
 
 typedef struct {
     char   *name;
@@ -1943,6 +1946,7 @@ static STRING_TABLE string_table[] = {
     VAR_MYDEST, DEF_MYDEST, &var_mydest,
     VAR_INET_INTERFACES, DEF_INET_INTERFACES, &var_inet_interfaces,
     VAR_REST_CLASSES, DEF_REST_CLASSES, &var_rest_classes,
+    VAR_LOCAL_TRANSP, DEF_LOCAL_TRANSP, &var_local_transports,
     0,
 };
 
@@ -2131,7 +2135,7 @@ main(int argc, char **argv)
     string_init();
     int_init();
     smtpd_check_init();
-    smtpd_state_init(&state, VSTREAM_IN, "", "");
+    smtpd_state_init(&state, VSTREAM_IN);
     state.queue_id = "<queue id>";
 
     /*
@@ -2166,6 +2170,7 @@ main(int argc, char **argv)
            /*
             * Special case: client identity.
             */
+       case 4:
        case 3:
 #define UPDATE_STRING(ptr,val) { if (ptr) myfree(ptr); ptr = mystrdup(val); }
 
@@ -2173,6 +2178,10 @@ main(int argc, char **argv)
                state.where = "CONNECT";
                UPDATE_STRING(state.name, args->argv[1]);
                UPDATE_STRING(state.addr, args->argv[2]);
+               if (args->argc == 4)
+                   state.peer_code = atoi(args->argv[3]);
+               else
+                   state.peer_code = 2;
                if (state.namaddr)
                    myfree(state.namaddr);
                state.namaddr = concatenate(state.name, "[", state.addr,
@@ -2226,7 +2235,7 @@ main(int argc, char **argv)
             */
        default:
            resp = "Commands...\n\
-               client <name> <address>\n\
+               client <name> <address> [<code>]\n\
                helo <hostname>\n\
                sender <address>\n\
                recipient <address>\n\
index 68d1d31a42453ad345f3a9042e1de2b4d163b3da..0eaf8c02b9e217d00952db882d41ef46226cd494 100644 (file)
@@ -105,3 +105,11 @@ rcpt user@foo.com
 recipient_restrictions reject_unauth_destination,permit
 rcpt user@foo.org
 rcpt user@foo.com
+#
+# unknown client tests
+#
+unknown_client_reject_code 550
+client_restrictions reject_unknown_client
+client spike.porcupine.org 160.100.189.2 2
+client unknown 1.1.1.1 4
+client unknown 1.1.1.1 5
index cbb4a3280302ada0824efc42352733a574042ea7..55143b69cd2bc5de5d34fed6ff08373956f465ab 100644 (file)
@@ -214,3 +214,18 @@ OK
 554 <user@foo.org>: Relay access denied
 >>> rcpt user@foo.com
 OK
+>>> #
+>>> # unknown client tests
+>>> #
+>>> unknown_client_reject_code 550
+OK
+>>> client_restrictions reject_unknown_client
+OK
+>>> client spike.porcupine.org 160.100.189.2 2
+OK
+>>> client unknown 1.1.1.1 4
+./smtpd_check: reject: CONNECT from unknown[1.1.1.1]: 450 Client host rejected: cannot find your hostname, [1.1.1.1]; from=<user@some.where>
+450 Client host rejected: cannot find your hostname, [1.1.1.1]
+>>> client unknown 1.1.1.1 5
+./smtpd_check: reject: CONNECT from unknown[1.1.1.1]: 550 Client host rejected: cannot find your hostname, [1.1.1.1]; from=<user@some.where>
+550 Client host rejected: cannot find your hostname, [1.1.1.1]
diff --git a/postfix/smtpd/smtpd_peer.c b/postfix/smtpd/smtpd_peer.c
new file mode 100644 (file)
index 0000000..059e250
--- /dev/null
@@ -0,0 +1,182 @@
+/*++
+/* NAME
+/*     smtpd_peer 3
+/* SUMMARY
+/*     look up peer name/address information
+/* SYNOPSIS
+/*     #include "smtpd.h"
+/*
+/*     void    smtpd_peer_init(state)
+/*     SMTPD_STATE *state;
+/*
+/*     void    smtpd_peer_reset(state)
+/*     SMTPD_STATE *state;
+/* DESCRIPTION
+/*     The smtpd_peer_init() routine attempts to produce a printable
+/*     version of the peer name and address of the specified socket.
+/*     Where information is unavailable, the name and/or address
+/*     are set to "unknown".
+/*
+/*     smtpd_peer_init() updates the following fields:
+/* .IP name
+/*     The client hostname. An unknown name is represented by the
+/*     string "unknown".
+/* .IP addr
+/*     Printable representation of the client address.
+/* .IP namaddr
+/*     String of the form: "name[addr]".
+/* .IP peer_code
+/*     The peer_code result field specifies how the client name
+/*     information should be interpreted:
+/* .RS
+/* .IP 2
+/*     Both name lookup and name verification succeeded.
+/* .IP 4
+/*     The name lookup or name verification failed with a recoverable
+/*     error (no address->name mapping or no name->address mapping).
+/* .IP 5
+/*     The name lookup or verification failed with an unrecoverable
+/*     error (no address->name mapping, bad hostname syntax, no 
+/*     name->address mapping, client address not listed for hostname).
+/* .RE
+/* .PP
+/*     smtpd_peer_reset() releases memory allocate by smtpd_peer_init().
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
+/*--*/
+
+/* System library. */
+
+#include <sys_defs.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <string.h>
+
+#ifdef NO_HERRNO
+static int h_errno = TRY_AGAIN;
+define  hstrerror(x) "Host not found"
+#endif
+
+/* Utility library. */
+
+#include <msg.h>
+#include <mymalloc.h>
+#include <valid_hostname.h>
+#include <stringops.h>
+
+/* Global library. */
+
+
+/* Application-specific. */
+
+#include "smtpd.h"
+
+/* smtpd_peer_init - initialize peer information */
+
+void    smtpd_peer_init(SMTPD_STATE *state)
+{
+    struct sockaddr_in sin;
+    SOCKADDR_SIZE len = sizeof(sin);
+    struct hostent *hp;
+    int     i;
+
+    /*
+     * If it's not networked assume local.
+     */
+    if (getpeername(vstream_fileno(state->client),
+                   (struct sockaddr *) & sin, &len) < 0)
+       sin.sin_family = AF_UNSPEC;
+
+    switch (sin.sin_family) {
+
+       /*
+        * If it's not Internet, assume the client is local, and avoid using
+        * the naming service because that can hang when the machine is
+        * disconnected.
+        */
+    default:
+       state->name = mystrdup("localhost");
+       state->addr = mystrdup("127.0.0.1");    /* XXX bogus. */
+       state->peer_code = 2;
+       break;
+
+       /*
+        * Look up and "verify" the client hostname.
+        */
+    case AF_INET:
+       state->addr = mystrdup(inet_ntoa(sin.sin_addr));
+       hp = gethostbyaddr((char *) &(sin.sin_addr),
+                          sizeof(sin.sin_addr), AF_INET);
+       if (hp == 0) {
+           state->name = mystrdup("unknown");
+           state->peer_code = (h_errno == TRY_AGAIN ? 4 : 5);
+           break;
+       }
+       if (!valid_hostname(hp->h_name)) {
+           state->name = mystrdup("unknown");
+           state->peer_code = 5;
+           break;
+       }
+       state->name = mystrdup(hp->h_name);     /* hp->name is clobbered!! */
+       state->peer_code = 2;
+
+       /*
+        * Reject the hostname if it does not list the peer address.
+        */
+       hp = gethostbyname(state->name);        /* clobbers hp->name!! */
+       if (hp == 0) {
+           msg_warn("hostname %s verification failed: %s",
+                    state->name, hstrerror(h_errno));
+           myfree(state->name);
+           state->name = mystrdup("unknown");
+           state->peer_code = (h_errno == TRY_AGAIN ? 4 : 5);
+           break;
+       }
+       if (hp->h_length != sizeof(sin.sin_addr)) {
+           msg_warn("hostname %s verification failed: bad address size %d",
+                    state->name, hp->h_length);
+           myfree(state->name);
+           state->name = mystrdup("unknown");
+           state->peer_code = 5;
+           break;
+       }
+       for (i = 0; hp->h_addr_list[i]; i++) {
+           if (memcmp(hp->h_addr_list[i],
+                      (char *) &sin.sin_addr,
+                      sizeof(sin.sin_addr)) == 0)
+               break;
+       }
+       if (hp->h_addr_list[i] == 0) {
+           msg_warn("address %s not listed for name %s",
+                    state->addr, state->name);
+           myfree(state->name);
+           state->name = mystrdup("unknown");
+           state->peer_code = 5;
+           break;
+       }
+       break;
+    }
+    state->namaddr =
+       concatenate(state->name, "[", state->addr, "]", (char *) 0);
+}
+
+/* smtpd_peer_reset - destroy peer information */
+
+void    smtpd_peer_reset(SMTPD_STATE *state)
+{
+    if (state->name)
+       myfree(state->name);
+    if (state->addr)
+       myfree(state->addr);
+    if (state->namaddr)
+       myfree(state->namaddr);
+}
index 531b4db6acc9449e31e145d50f2a7b4c20780ef6..6199b7583eeafb4b0b0ac9d05f82996912accfb1 100644 (file)
@@ -6,11 +6,9 @@
 /* SYNOPSIS
 /*     #include "smtpd.h"
 /*
-/*     void    smtpd_state_init(state, stream, name, addr)
+/*     void    smtpd_state_init(state, stream)
 /*     SMTPD_STATE *state;
 /*     VSTREAM *stream;
-/*     const char *name;
-/*     const char *addr;
 /*
 /*     void    smtpd_state_reset(state)
 /*     SMTPD_STATE *state;
 /*     Session context.
 /* .IP stream
 /*     Stream connected to peer. The stream is not copied.
-/* .IP name
-/*     Printable representation of the peer host name. The
-/*     name is copied.
-/* .IP addr
-/*     Printable representation of the peer host address. The
-/*     address is copied.
 /* DIAGNOSTICS
 /*     All errors are fatal.
 /* LICENSE
@@ -53,7 +45,6 @@
 #include <mymalloc.h>
 #include <vstream.h>
 #include <name_mask.h>
-#include <stringops.h>
 
 /* Global library. */
 
@@ -68,8 +59,7 @@
 
 /* smtpd_state_init - initialize after connection establishment */
 
-void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream,
-                                const char *name, const char *addr)
+void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream)
 {
 
     /*
@@ -79,9 +69,6 @@ void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream,
     state->err = CLEANUP_STAT_OK;
     state->client = stream;
     state->buffer = vstring_alloc(100);
-    state->name = mystrdup(name);
-    state->addr = mystrdup(addr);
-    state->namaddr = concatenate(name, "[", addr, "]", (char *) 0);
     state->error_count = 0;
     state->error_mask = 0;
     state->notify_mask = name_mask(mail_error_masks, var_notify_classes);
@@ -99,6 +86,11 @@ void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream,
     state->protocol = "SMTP";
     state->where = SMTPD_AFTER_CONNECT;
 
+    /*
+     * Initialize peer information.
+     */
+    smtpd_peer_init(state);
+
     /*
      * Initialize the conversation history.
      */
@@ -117,10 +109,5 @@ void    smtpd_state_reset(SMTPD_STATE *state)
      */
     if (state->buffer)
        vstring_free(state->buffer);
-    if (state->name)
-       myfree(state->name);
-    if (state->addr)
-       myfree(state->addr);
-    if (state->namaddr)
-       myfree(state->namaddr);
+    smtpd_peer_reset(state);
 }
index ed0f5c360d1a85d7c61ebd80721d1d544bdc7c6c..09d64cd01e502b55af84336671aff0af28e80d5c 100644 (file)
@@ -8,6 +8,7 @@
 /*
 /*     typedef struct {
 /* .in +4
+/*         int tokval;
 /*         char *strval;
 /*         /* other stuff... */
 /* .in -4
@@ -139,6 +140,7 @@ static char *smtp_next_token(char *cp, SMTPD_TOKEN *arg)
                break;
        } else {                                /* other */
            if (c == '\\') {
+               VSTRING_ADDCH(arg->vstrval, c);
                if ((c = *cp) == 0)
                    break;
                cp++;
index bba391549b02fd40f37f78c12fbb226319339896..21dc969fcfb64588930a2c8a87b4adc60f4b63ac 100644 (file)
@@ -60,7 +60,7 @@ Token value: mail
 Token type:  other
 Token value: from:
 Token type:  other
-Token value: wietse venema@porcupine.org
+Token value: wietse\ venema@porcupine.org
 mail to:<"wietse venema>
 Token type:  other
 Token value: mail
index 471f06ef048b4e72b63816f44af71378e1c39877..d6a724a4e769be24fbacc9c2353778370c7f4d0a 100644 (file)
@@ -77,6 +77,7 @@ resolve.o: ../include/mail_conf.h
 resolve.o: ../include/quote_822_local.h
 resolve.o: ../include/tok822.h
 resolve.o: ../include/resolve_clnt.h
+resolve.o: ../include/local_transport.h
 resolve.o: trivial-rewrite.h
 resolve.o: transport.h
 rewrite.o: rewrite.c
@@ -105,6 +106,7 @@ transport.o: ../include/vbuf.h
 transport.o: ../include/split_at.h
 transport.o: ../include/dict.h
 transport.o: ../include/vstream.h
+transport.o: ../include/argv.h
 transport.o: ../include/mail_params.h
 transport.o: ../include/maps.h
 transport.o: transport.h
@@ -118,6 +120,7 @@ trivial-rewrite.o: ../include/vstring_vstream.h
 trivial-rewrite.o: ../include/split_at.h
 trivial-rewrite.o: ../include/stringops.h
 trivial-rewrite.o: ../include/dict.h
+trivial-rewrite.o: ../include/argv.h
 trivial-rewrite.o: ../include/mail_params.h
 trivial-rewrite.o: ../include/mail_proto.h
 trivial-rewrite.o: ../include/iostuff.h
index 6e8c2f74a089b1b861c55d10d177eba9eec46c99..4bf5ec695ce7386fbc23a0950c60cec7d0e7b859 100644 (file)
@@ -154,7 +154,7 @@ void    resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
     /*
      * Make sure the resolved envelope recipient has the user@domain form. If
      * no domain was specified in the address, assume the local machine. See
-     * above for what happens with an empty localpart.
+     * above for what happens with an empty address.
      */
     if (domain == 0) {
        if (saved_domain) {
@@ -168,11 +168,11 @@ void    resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
     tok822_internalize(nextrcpt, tree, TOK822_STR_DEFL);
 
     /*
-     * The transport map overrides the default transport and next-hop host
-     * info that was set up just moments ago. For a long time, it was not
-     * possible to override routing of mail that resolves locally, because
-     * Postfix used a zero-length next-hop hostname result to indicate local
-     * delivery, and transport maps cannot return zero-length hostnames.
+     * The transport map overrides any transport and next-hop host info that
+     * is set up below. For a long time, it was not possible to override
+     * routing of mail that resolves locally, because Postfix used a
+     * zero-length next-hop hostname result to indicate local delivery, and
+     * transport maps cannot return zero-length hostnames.
      */
     if (*var_transport_maps
     && transport_lookup(strrchr(STR(nextrcpt), '@') + 1, channel, nexthop)) {
@@ -194,7 +194,7 @@ void    resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
 
     /*
      * Local delivery. Set up the default local transport and the default
-     * next-hop hostname.
+     * next-hop hostname (myself).
      */
     else {
        vstring_strcpy(channel, def_local_transport());
index e7656653b4ebbd9643c7d4709b60e1a53efe320d..6d7c512463a5dba83500ae97665b448ee8e6ef08 100644 (file)
@@ -319,6 +319,7 @@ dict.o: vstring.h
 dict.o: readlline.h
 dict.o: mac_parse.h
 dict.o: dict.h
+dict.o: argv.h
 dict.o: dict_ht.h
 dict_db.o: dict_db.c
 dict_db.o: sys_defs.h
@@ -331,6 +332,7 @@ dict_db.o: iostuff.h
 dict_db.o: myflock.h
 dict_db.o: dict.h
 dict_db.o: vstream.h
+dict_db.o: argv.h
 dict_db.o: dict_db.h
 dict_dbm.o: dict_dbm.c
 dict_dbm.o: sys_defs.h
@@ -342,6 +344,7 @@ dict_env.o: safe.h
 dict_env.o: dict.h
 dict_env.o: vstream.h
 dict_env.o: vbuf.h
+dict_env.o: argv.h
 dict_env.o: dict_env.h
 dict_ht.o: dict_ht.c
 dict_ht.o: sys_defs.h
@@ -350,6 +353,7 @@ dict_ht.o: htable.h
 dict_ht.o: dict.h
 dict_ht.o: vstream.h
 dict_ht.o: vbuf.h
+dict_ht.o: argv.h
 dict_ht.o: dict_ht.h
 dict_ldap.o: dict_ldap.c
 dict_ldap.o: sys_defs.h
@@ -365,6 +369,7 @@ dict_nis.o: vstring.h
 dict_nis.o: vbuf.h
 dict_nis.o: dict.h
 dict_nis.o: vstream.h
+dict_nis.o: argv.h
 dict_nis.o: dict_nis.h
 dict_nisplus.o: dict_nisplus.c
 dict_nisplus.o: sys_defs.h
@@ -374,6 +379,7 @@ dict_nisplus.o: htable.h
 dict_nisplus.o: dict.h
 dict_nisplus.o: vstream.h
 dict_nisplus.o: vbuf.h
+dict_nisplus.o: argv.h
 dict_nisplus.o: dict_nisplus.h
 dict_open.o: dict_open.c
 dict_open.o: sys_defs.h
@@ -410,6 +416,7 @@ dict_regexp.o: vstring.h
 dict_regexp.o: stringops.h
 dict_regexp.o: readlline.h
 dict_regexp.o: dict.h
+dict_regexp.o: argv.h
 dict_regexp.o: dict_regexp.h
 dict_regexp.o: mac_parse.h
 dict_unix.o: dict_unix.c
@@ -420,6 +427,7 @@ dict_unix.o: vstring.h
 dict_unix.o: vbuf.h
 dict_unix.o: dict.h
 dict_unix.o: vstream.h
+dict_unix.o: argv.h
 dict_unix.o: dict_unix.h
 dir_forest.o: dir_forest.c
 dir_forest.o: sys_defs.h
@@ -591,6 +599,7 @@ match_ops.o: split_at.h
 match_ops.o: dict.h
 match_ops.o: vstream.h
 match_ops.o: vbuf.h
+match_ops.o: argv.h
 match_ops.o: match_ops.h
 match_ops.o: stringops.h
 msg.o: msg.c
index 88b4a698260e09d62c0b9a06f72392ec25990231..cb0cc0dad162d068e731379d0c6a6600db7faf91 100644 (file)
@@ -102,6 +102,5 @@ extern int dict_changed(void);
 /*     P.O. Box 704
 /*     Yorktown Heights, NY 10598, USA
 /*--*/
-/**INDENT** Error@47: Unmatched #endif */
 
 #endif
index 6665f8d39e10ff6336c4163659162fa2dae6e4a8..0cfa3fde2a7f616d1dd5a7d1fe91597e54e73b9c 100644 (file)
@@ -91,6 +91,7 @@ extern int opterr;
 #define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (S_IFSOCK))
 #define DUP2_DUPS_CLOSE_ON_EXEC
 #define MISSING_USLEEP
+#define NO_HERRNO
 #endif
 
 #ifdef OSF1
@@ -145,6 +146,7 @@ extern int opterr;
 #define USE_STATFS
 #define STATFS_IN_SYS_VFS_H
 #define memmove(d,s,l) bcopy(s,d,l)
+#define NO_HERRNO
 #endif
 
 #ifdef SUNOS5
index db1e412fad235ccbdecbb23b2b5c13a1221fa448..e712c24e41e91de8816432a303fcfd43b78be6b3 100644 (file)
@@ -155,7 +155,11 @@ WATCHDOG *watchdog_create(unsigned timeout, WATCHDOG_FN action, char *context)
     wp->saved_watchdog = watchdog_curr;
     wp->saved_time = alarm(0);
     sigemptyset(&sig_action.sa_mask);
+#ifdef SA_RESTART
     sig_action.sa_flags = SA_RESTART;
+#else
+    sig_action.sa_flags = 0;
+#endif
     sig_action.sa_handler = watchdog_event;
     if (sigaction(SIGALRM, &sig_action, &wp->saved_action) < 0)
        msg_fatal("%s: sigaction(SIGALRM): %m", myname);