]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20000919
authorWietse Venema <wietse@porcupine.org>
Tue, 19 Sep 2000 00:00:00 +0000 (00:00 +0000)
committerWietse Venema <wietse@porcupine.org>
Thu, 17 Jan 2013 23:12:19 +0000 (18:12 -0500)
13 files changed:
postfix/HISTORY
postfix/INSTALL.sh
postfix/Makefile.in
postfix/RELEASE_NOTES
postfix/base64/base64decode [deleted file]
postfix/base64/base64encode [deleted file]
postfix/global/mail_version.h
postfix/local/dotforward.c
postfix/local/recipient.c
postfix/pipe/pipe.c
postfix/postmap/postmap.c
postfix/util/spawn_command.c
postfix/util/spawn_command.h

index 35cdcb3f304ae5c9ef8bf4a17adb608efa1d684b..31031695d3a48463a04bbf629fd6e13168751d38 100644 (file)
@@ -4206,3 +4206,11 @@ Apologies for any names omitted.
        Gross hack: prevent looping a bad recipient by always
        forwarding recipients in :include: files, even when
        owner-listname is not set. File: local/recipient.c.
+
+20000919
+
+       Convenience: INSTALL.sh now imports default settings from
+       the process environment, in order to make scripting easier.
+
+       Portability: another fix for NEXTSTEP (Masaki MURASE).
+       File: util/spawn_command.h.
index 545dbb9345501397b6021bc991bd25c578eb33b2..e281467d42aa3b0b669f71be14192427dcc43130 100644 (file)
@@ -45,6 +45,10 @@ EOF
 # the time that a file does not exist, and avoid copying over programs
 # in order to not disturb running programs.
 
+censored_ls() {
+    ls "$@" | egrep -v '^\.|/\.|CVS|RCS|SCCS'
+}
+
 compare_or_replace() {
     (cmp $2 $3 >/dev/null 2>&1 && echo Skipping $3...) || {
        echo Updating $3...
@@ -102,21 +106,21 @@ esac
 
 # Default settings. Most are clobbered by remembered settings.
 
-install_root=/
-tempdir=`pwd`
-config_directory=/etc/postfix
-daemon_directory=/usr/libexec/postfix
-command_directory=/usr/sbin
-queue_directory=/var/spool/postfix
+: ${install_root=/}
+: ${tempdir=`pwd`}
+: ${config_directory=/etc/postfix}
+: ${daemon_directory=/usr/libexec/postfix}
+: ${command_directory=/usr/sbin}
+: ${queue_directory=/var/spool/postfix}
 if [ -f /usr/lib/sendmail ]
-    then sendmail_path=/usr/lib/sendmail 
-    else sendmail_path=/usr/sbin/sendmail
+    then : ${sendmail_path=/usr/lib/sendmail}
+    else : ${sendmail_path=/usr/sbin/sendmail}
 fi
-newaliases_path=/usr/bin/newaliases
-mailq_path=/usr/bin/mailq
-mail_owner=postfix
-setgid=no
-manpages=/usr/local/man
+: ${newaliases_path=/usr/bin/newaliases}
+: ${mailq_path=/usr/bin/mailq}
+: ${mail_owner=postfix}
+: ${setgid=no}
+: ${manpages=/usr/local/man}
 
 # Find out the location of configuration files.
 
@@ -245,12 +249,12 @@ done
 
 # Install files. Be careful to not copy over running programs.
 
-for file in `ls libexec | grep -v '^\.'`
+for file in `censored_ls libexec`
 do
     compare_or_replace a+x,go-w libexec/$file $DAEMON_DIRECTORY/$file || exit 1
 done
 
-for file in `ls bin | grep '^post'`
+for file in `censored_ls bin | grep '^post'`
 do
     compare_or_replace a+x,go-w bin/$file $COMMAND_DIRECTORY/$file || exit 1
 done
@@ -263,12 +267,12 @@ test -f bin/sendmail && {
 
 if [ -f $CONFIG_DIRECTORY/main.cf ]
 then
-    for file in LICENSE `cd conf; echo sample*` main.cf.default
+    for file in LICENSE `cd conf; censored_ls sample*` main.cf.default
     do
        compare_or_replace a+r,go-w conf/$file $CONFIG_DIRECTORY/$file || exit 1
     done
 else
-    cp conf/* $CONFIG_DIRECTORY || exit 1
+    cp `censored_ls conf/*` $CONFIG_DIRECTORY || exit 1
     chmod a+r,go-w $CONFIG_DIRECTORY/* || exit 1
 
     test -z "$install_root" && {
@@ -332,7 +336,7 @@ no) ;;
      for dir in man?
         do test -d $MANPAGES/$dir || mkdir -p $MANPAGES/$dir || exit 1
      done
-     for file in man?/*
+     for file in `censored_ls man?/*`
      do
         (test -f $MANPAGES/$file && cmp -s $file $MANPAGES/$file &&
          echo Skipping $MANPAGES/$file...) || {
index 4fa822d0fa01a31806a04363ea6bb20aa889e156..a23a48682b1ed384533a6629b1d2a690a9b2b580 100644 (file)
@@ -4,7 +4,7 @@ OPTS    = "CC=$(CC)"
 DIRS   = util global dns master postfix smtpstone sendmail error \
        pickup cleanup smtpd local lmtp trivial-rewrite qmgr smtp bounce pipe \
        showq postalias postcat postconf postdrop postkick postlock postlog \
-       postmap postsuper nqmgr # spawn base64 proto man html
+       postmap postsuper nqmgr spawn # base64 proto man html
 
 default: update
 
index ff73e4d12a9fff3dd1aaa5ea9ffca0691a020fbd..5a92053cfbfcbf6d7f25b56e0e4a76ce85b36860 100644 (file)
@@ -1,4 +1,27 @@
-Incompatible changes with snapshot-20000625
+Incompatible changes with snapshot-20000919
+===========================================
+
+The queue manager to delivery agent protocol has changed. This does
+not affect the format of queue files, but means that you cannot
+use this software with queue managers or delivery agents of prior
+Postfix versions.
+
+Change in address rewriting: Errors-To:, Reply-To: and Return-Receipt:
+are now rewritten as a sender address (was: recipient).
+
+Major changes with snapshot-20000919
+====================================
+
+Postfix now strips out the Content-Length: header to avoid confusion
+with mail user agents.
+
+The header_checks and body_checks features can now be used to strip
+out unwanted data. Specify IGNORE and the data will go disappear.
+
+Postfix no longer inserts a Sender: message header when the 
+From: address differs from the envelope sender address.
+
+Incompatible changes with snapshot-20000625 (never released)
 ===========================================
 
 The local delivery agent no longer appends a blank line to mail
diff --git a/postfix/base64/base64decode b/postfix/base64/base64decode
deleted file mode 100755 (executable)
index 67cbb9b..0000000
Binary files a/postfix/base64/base64decode and /dev/null differ
diff --git a/postfix/base64/base64encode b/postfix/base64/base64encode
deleted file mode 100755 (executable)
index 8f1869c..0000000
Binary files a/postfix/base64/base64encode and /dev/null differ
index 8830407cf7c807c03a3409eda3bc5e4e06917d9d..24ecdf6830dae12727df151c32c8ecd45f93a82e 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20000918"
+#define DEF_MAIL_VERSION       "Snapshot-20000919"
 extern char *var_mail_version;
 
 /* LICENSE
index 12ae1241d27d4e1f46c874e65cca52ba8fd6685e..e3131d3f800e3e3b9b6e85c4595dba13da9cb202 100644 (file)
@@ -64,7 +64,6 @@
 #include <vstream.h>
 #include <htable.h>
 #include <open_as.h>
-#include <stat_as.h>
 #include <lstat_as.h>
 #include <iostuff.h>
 #include <stringops.h>
@@ -79,7 +78,6 @@
 #include <mail_params.h>
 #include <mail_conf.h>
 #include <ext_prop.h>
-#include <defer.h>
 
 /* Application-specific. */
 
@@ -115,36 +113,18 @@ int     deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
        MSG_LOG_STATE(myname, state);
 
     /*
-     * Skip non-existing users. The mailbox delivery routine will catch the
-     * error.
-     * 
-     * Defer delivery to recipients whose home directory is not accessible.
-     * 
-     * XXX This code should be one level up. The caller should pass the
-     * recipient's password file info along with the call.
-     * 
-     * XXX This code should also be executed for \user deliveries that bypass
-     * aliasing and .forward processing. Said code is currently broken after
-     * a revision of the RFC822 address parser.
+     * Skip this module if per-user forwarding is disabled.
      */
-    if ((mypwd = mypwnam(state.msg_attr.user)) == 0)
+    if (*var_forward_path == 0)
        return (NO);
-    if (var_stat_home_dir
-       && stat_as(mypwd->pw_dir, &st, mypwd->pw_uid, mypwd->pw_gid) < 0) {
-       *statusp = defer_append(BOUNCE_FLAG_KEEP,
-                               BOUNCE_ATTR(state.msg_attr),
-                               "cannot access %s home directory %s: %m",
-                               mypwd->pw_name, mypwd->pw_dir);
-       return (YES);
-    }
 
     /*
-     * Skip this module if per-user forwarding is disabled.
+     * Skip non-existing users. The mailbox delivery routine will catch the
+     * error.
      */
-    if (*var_forward_path == 0)
+    if ((mypwd = mypwnam(state.msg_attr.user)) == 0)
        return (NO);
 
-
     /*
      * From here on no early returns or we have a memory leak.
      */
index dbc7bc0f6140eb863c3de86199ba35376a30fbf4..badf887ec5b7d64e9fb04bd1fe55f4b0c2f854f1 100644 (file)
@@ -60,6 +60,7 @@
 /* System library. */
 
 #include <sys_defs.h>
+#include <sys/stat.h>
 #include <unistd.h>
 #include <string.h>
 
 #include <split_at.h>
 #include <stringops.h>
 #include <dict.h>
+#include <stat_as.h>
 
 /* Global library. */
 
 #include <bounce.h>
+#include <defer.h>
 #include <mail_params.h>
 #include <split_addr.h>
 #include <ext_prop.h>
+#include <mypwd.h>
 
 /* Application-specific. */
 
@@ -93,6 +97,8 @@ static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
 {
     char   *myname = "deliver_switch";
     int     status = 0;
+    struct stat st;
+    struct mypasswd *mypwd;
 
     /*
      * Make verbose logging easier to understand.
@@ -108,6 +114,8 @@ static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
      * XXX This code currently does not work due to revision of the RFC822
      * address parser. \user should be permitted only in locally specified
      * aliases, includes or forward files.
+     * 
+     * XXX Should test for presence of user home directory.
      */
     if (state.msg_attr.recipient[0] == '\\') {
        state.msg_attr.recipient++, state.msg_attr.local++, state.msg_attr.user++;
@@ -161,13 +169,22 @@ static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
     /*
      * Always forward recipients in :include: files.
      */
-    if (state.msg_attr.exp_type = EXPAND_TYPE_INCL)
+    if (state.msg_attr.exp_type == EXPAND_TYPE_INCL)
        return (deliver_indirect(state));
 
     /*
      * Delivery to local user. First try expansion of the recipient's
-     * $HOME/.forward file, then mailbox delivery.
+     * $HOME/.forward file, then mailbox delivery. Back off when the user's
+     * home directory does not exist.
      */
+    if ((mypwd = mypwnam(state.msg_attr.user)) == 0)
+       return (deliver_unknown(state, usr_attr));
+    if (var_stat_home_dir
+       && stat_as(mypwd->pw_dir, &st, mypwd->pw_uid, mypwd->pw_gid) < 0)
+       return (defer_append(BOUNCE_FLAG_KEEP,
+                            BOUNCE_ATTR(state.msg_attr),
+                            "cannot access home directory %s: %m",
+                            mypwd->pw_dir));
     if (deliver_dotforward(state, usr_attr, &status) == 0
        && deliver_mailbox(state, usr_attr, &status) == 0)
        status = deliver_unknown(state, usr_attr);
index 2a777833e9c08294ef6ff9565038ada17c948c8f..a06552cca8c4926708866386e50cb5cf115ac24d 100644 (file)
@@ -626,10 +626,15 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
     RECIPIENT_LIST *rcpt_list = &request->rcpt_list;
     VSTRING *why = vstring_alloc(100);
     VSTRING *buf;
-    ARGV   *expanded_argv;
+    ARGV   *expanded_argv = 0;
     int     deliver_status;
     int     command_status;
 
+#define DELIVER_MSG_CLEANUP() { \
+       vstring_free(why); \
+       if (expanded_argv) argv_free(expanded_argv); \
+    }
+
     if (msg_verbose)
        msg_info("%s: from <%s>", myname, request->sender);
 
@@ -674,6 +679,7 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
 
        deliver_status = eval_command_status(PIPE_STAT_BOUNCE, service,
                                 request, request->fp, "message too large");
+       DELIVER_MSG_CLEANUP();
        return (deliver_status);
     }
 
@@ -706,8 +712,7 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
     /*
      * Clean up.
      */
-    vstring_free(why);
-    argv_free(expanded_argv);
+    DELIVER_MSG_CLEANUP();
 
     return (deliver_status);
 }
index da51ceb060cf583efb8494fe3e943ce84c99f3a7..49dc87893afb980f9e2b52998fa2a534f60d9165 100644 (file)
@@ -281,7 +281,7 @@ static int postmap_delete(const char *map_type, const char *map_name,
     dict = dict_open3(map_type, map_name, O_RDWR, DICT_FLAG_LOCK);
     status = dict_del(dict, key);
     dict_close(dict);
-    return (status);
+    return (status == 0);
 }
 
 /* usage - explain */
index 3f009d36edc37f0d78a63df7d4e2c9417c8f33c3..f20a66bd83a1bf04cb8dc51f1160d0815054888d 100644 (file)
@@ -286,8 +286,8 @@ WAIT_STATUS_T spawn_command(int key,...)
         */
        if ((err = timed_waitpid(pid, &wait_status, 0, args.time_limit)) < 0
            && errno == ETIMEDOUT) {
-           msg_warn("%s: process id %d: command time limit exceeded",
-                    args.command, pid);
+           msg_warn("%s: process id %lu: command time limit exceeded",
+                    args.command, (unsigned long) pid);
            kill(-pid, SIGKILL);
            err = waitpid(pid, &wait_status, 0);
        }
index a6addf53f642b406191a4520d7eb560bb71a565c..b89887ede5b62a8e59e5392ddafda3d9452a0918 100644 (file)
@@ -26,7 +26,7 @@
 #define SPAWN_CMD_ENV          9       /* extra environment */
 #define SPAWN_CMD_SHELL                10      /* alternative shell */
 
-extern int spawn_command(int,...);
+extern WAIT_STATUS_T spawn_command(int,...);
 
 /* LICENSE
 /* .ad