]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3.4-RC2 v2.3.4-RC2
authorWietse Venema <wietse@porcupine.org>
Thu, 19 Oct 2006 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 20:51:20 +0000 (15:51 -0500)
15 files changed:
postfix/HISTORY
postfix/html/local.8.html
postfix/man/man8/local.8
postfix/src/cleanup/Makefile.in
postfix/src/cleanup/cleanup.h
postfix/src/cleanup/cleanup_bounce.c
postfix/src/cleanup/cleanup_milter.c
postfix/src/cleanup/cleanup_state.c
postfix/src/global/mail_version.h
postfix/src/local/local.c
postfix/src/showq/showq.c
postfix/src/smtp/smtp.c
postfix/src/smtp/smtp_reuse.c
postfix/src/smtpd/Makefile.in
postfix/src/smtpd/smtpd_milter.c

index acd6757797748a5c55586136e310f38bc3ed1a4b..b26603692711339d586325e2c022cae542a90d5a 100644 (file)
@@ -12739,3 +12739,33 @@ Apologies for any names omitted.
        Compatibility: Sendmail now invokes the Milter connect
        action with the verified hostname instead of the name
        obtained with PTR lookup. File: smtpd/smtpd.c.
+
+20061004
+
+       Cleanup: force space between mailq queueid+status and file
+       size items. File: showq/showq.c.
+
+20061015
+
+       Cleanup: convert the Milter {mail_addr} and {rcpt_addr}
+       macro values to external form. File: smtpd/smtpd_milter.c.
+
+       Cleanup: the Milter {mail_addr} and {rcpt_addr} macros are
+       now available with non-SMTP mail. File: cleanup/cleanup_milter.c.
+
+       Cleanup: convert addresses in Milter recipient add/delete
+       requests to internal form.  File: cleanup/cleanup_milter.c.
+
+       Cleanup: with non-SMTP mail, convert addresses in simulated
+       MAIL FROM and RCPT TO events to external form.  File:
+       cleanup/cleanup_milter.c.
+
+20061017
+
+       Cleanup: removed spurious warning when the cleanup server
+       attempts to bounce mail with soft_bounce=yes. Problem
+       reported by Ralf Hildebrandt. File: cleanup/cleanup_bounce.c.
+
+       Bugfix: null pointer bug when receiving a non-protocol
+       response on a cached SMTP/LMTP connection.  Report by Brian
+       Kantor.  Fix by Victor Duchovni.  File: smtp/smtp_reuse.c.
index 7b7526787bc58d1b2e62f487720708df87679ed6..0e512a1668101f4c61f6d2812a04d9bfb4d3de3e 100644 (file)
@@ -46,7 +46,7 @@ LOCAL(8)                                                              LOCAL(8)
        local delivery agent tries each pathname in the list until
        a file is found.
 
-       Delivery via ~/.<b>.forward</b> files is done with the privileges
+       Delivery via ~/.<b>forward</b> files is done with the  privileges
        of  the  recipient.   Thus,  ~/.<b>forward</b> like files must be
        readable by the  recipient,  and  their  parent  directory
        needs to have "execute" permission for the recipient.
index 7a3cd2e4cea624778c8e59f29bb01afc409a6d12..324bb2a275d250590a0cb6a444ef03da0b05d140 100644 (file)
@@ -49,7 +49,7 @@ of ~\fR/.\fBforward\fR like files through the \fBforward_path\fR
 configuration parameter. Upon delivery, the local delivery agent
 tries each pathname in the list until a file is found.
 
-Delivery via ~/.\fB.forward\fR files is done with the privileges
+Delivery via ~/.\fBforward\fR files is done with the privileges
 of the recipient.
 Thus, ~/.\fBforward\fR like files must be readable by the
 recipient, and their parent directory needs to have "execute"
index 69dfd981eaa634e7699866774064872ea77afaf0..983442683094765e806f48679baf02455ff0e97d 100644 (file)
@@ -504,6 +504,8 @@ cleanup_milter.o: ../../include/msg.h
 cleanup_milter.o: ../../include/mymalloc.h
 cleanup_milter.o: ../../include/nvtable.h
 cleanup_milter.o: ../../include/off_cvt.h
+cleanup_milter.o: ../../include/quote_821_local.h
+cleanup_milter.o: ../../include/quote_flags.h
 cleanup_milter.o: ../../include/rec_attr_map.h
 cleanup_milter.o: ../../include/rec_type.h
 cleanup_milter.o: ../../include/record.h
index 12b1d77dc92edddec137bfc2b521d0b51fd4f38d..2c7637ecb8cb1922d5d52ef1301ddf096bc32407 100644 (file)
@@ -95,6 +95,8 @@ typedef struct CLEANUP_STATE {
     const char *client_addr;           /* real or ersatz client */
     int     client_af;                 /* real or ersatz client */
     const char *client_port;           /* real or ersatz client */
+    VSTRING *milter_ext_from;          /* externalized sender */
+    VSTRING *milter_ext_rcpt;          /* externalized recipient */
 } CLEANUP_STATE;
 
  /*
index e6deb9586997ff1821176cfa9fbb569f5784c94a..bf8f5236853040c827f5fa3e5618eff4615e8fbd 100644 (file)
@@ -67,10 +67,15 @@ static void cleanup_bounce_append(CLEANUP_STATE *state, RECIPIENT *rcpt,
 {
     MSG_STATS stats;
 
+    /*
+     * Don't log a spurious warning (for example, when soft_bounce is turned
+     * on). bounce_append() already logs a record when the logfile can't be
+     * updated. Set the write error flag, so that a maildrop queue file won't
+     * be destroyed.
+     */
     if (bounce_append(BOUNCE_FLAG_CLEAN, state->queue_id,
                      CLEANUP_MSG_STATS(&stats, state),
                      rcpt, "none", dsn) != 0) {
-       msg_warn("%s: bounce logfile update error", state->queue_id);
        state->errs |= CLEANUP_STAT_WRITE;
     }
 }
index 454083ae087de1b02d373bf0c7e2e432e721b5d3..6e40e1680e3c2e0fc652b8f59841671f115a69b2 100644 (file)
 #include <mail_params.h>
 #include <lex_822.h>
 #include <is_header.h>
+#include <quote_821_local.h>
 
 /* Application-specific. */
 
@@ -968,15 +969,19 @@ static const char *cleanup_del_header(void *context, ssize_t index,
 
 /* cleanup_add_rcpt - append recipient address */
 
-static const char *cleanup_add_rcpt(void *context, char *rcpt)
+static const char *cleanup_add_rcpt(void *context, char *ext_rcpt)
 {
     const char *myname = "cleanup_add_rcpt";
     CLEANUP_STATE *state = (CLEANUP_STATE *) context;
     off_t   new_rcpt_offset;
     off_t   reverse_ptr_offset;
+    int     addr_count;
+    TOK822 *tree;
+    TOK822 *tp;
+    VSTRING *int_rcpt_buf;
 
     if (msg_verbose)
-       msg_info("%s: \"%s\"", myname, rcpt);
+       msg_info("%s: \"%s\"", myname, ext_rcpt);
 
     /*
      * To simplify implementation, the cleanup server writes a dummy
@@ -1006,7 +1011,35 @@ static const char *cleanup_add_rcpt(void *context, char *rcpt)
        msg_warn("%s: seek file %s: %m", myname, cleanup_path);
        return (cleanup_milter_error(state, errno));
     }
-    cleanup_addr_bcc(state, rcpt);
+
+    /*
+     * Transform recipient from external form to internal form. This also
+     * removes the enclosing <>, if present.
+     * 
+     * XXX vstring_alloc() rejects zero-length requests.
+     */
+    int_rcpt_buf = vstring_alloc(strlen(ext_rcpt) + 1);
+    tree = tok822_parse(ext_rcpt);
+    for (addr_count = 0, tp = tree; tp != 0; tp = tp->next) {
+       if (tp->type == TOK822_ADDR) {
+           if (addr_count == 0) {
+               tok822_internalize(int_rcpt_buf, tp->head, TOK822_STR_DEFL);
+               addr_count += 1;
+           } else {
+               msg_warn("%s: Milter request to add multi-recipient: \"%s\"",
+                        state->queue_id, ext_rcpt);
+               break;
+           }
+       }
+    }
+    tok822_free_tree(tree);
+    cleanup_addr_bcc(state, STR(int_rcpt_buf));
+    vstring_free(int_rcpt_buf);
+    if (addr_count == 0) {
+       msg_warn("%s: ignoring attempt from Milter to add null recipient",
+                state->queue_id);
+       return (CLEANUP_OUT_OK(state) ? 0 : cleanup_milter_error(state, 0));
+    }
     if ((reverse_ptr_offset = vstream_ftell(state->dst)) < 0) {
        msg_warn("%s: vstream_ftell file %s: %m", myname, cleanup_path);
        return (cleanup_milter_error(state, errno));
@@ -1042,7 +1075,7 @@ static const char *cleanup_add_rcpt(void *context, char *rcpt)
 
 /* cleanup_del_rcpt - remove recipient and all its expansions */
 
-static const char *cleanup_del_rcpt(void *context, char *rcpt)
+static const char *cleanup_del_rcpt(void *context, char *ext_rcpt)
 {
     const char *myname = "cleanup_del_rcpt";
     CLEANUP_STATE *state = (CLEANUP_STATE *) context;
@@ -1057,9 +1090,13 @@ static const char *cleanup_del_rcpt(void *context, char *rcpt)
     int     rec_type;
     int     junk;
     int     count = 0;
+    TOK822 *tree;
+    TOK822 *tp;
+    VSTRING *int_rcpt_buf;
+    int     addr_count;
 
     if (msg_verbose)
-       msg_info("%s: \"%s\"", myname, rcpt);
+       msg_info("%s: \"%s\"", myname, ext_rcpt);
 
     /*
      * Virtual aliasing and other address rewriting happens after the mail
@@ -1091,9 +1128,32 @@ static const char *cleanup_del_rcpt(void *context, char *rcpt)
        if (dsn_orcpt != 0) \
            myfree(dsn_orcpt); \
        vstring_free(buf); \
+       vstring_free(int_rcpt_buf); \
        return (ret); \
     } while (0)
 
+    /*
+     * Transform recipient from external form to internal form. This also
+     * removes the enclosing <>, if present.
+     * 
+     * XXX vstring_alloc() rejects zero-length requests.
+     */
+    int_rcpt_buf = vstring_alloc(strlen(ext_rcpt) + 1);
+    tree = tok822_parse(ext_rcpt);
+    for (addr_count = 0, tp = tree; tp != 0; tp = tp->next) {
+       if (tp->type == TOK822_ADDR) {
+           if (addr_count == 0) {
+               tok822_internalize(int_rcpt_buf, tp->head, TOK822_STR_DEFL);
+               addr_count += 1;
+           } else {
+               msg_warn("%s: Milter request to drop multi-recipient: \"%s\"",
+                        state->queue_id, ext_rcpt);
+               break;
+           }
+       }
+    }
+    tok822_free_tree(tree);
+
     buf = vstring_alloc(100);
     for (;;) {
        if (CLEANUP_OUT_OK(state) == 0)
@@ -1154,7 +1214,7 @@ static const char *cleanup_del_rcpt(void *context, char *rcpt)
            orig_rcpt = mystrdup(start);
            break;
        case REC_TYPE_RCPT:                     /* rewritten RCPT TO address */
-           if (strcmp(orig_rcpt ? orig_rcpt : start, rcpt) == 0) {
+           if (strcmp(orig_rcpt ? orig_rcpt : start, STR(int_rcpt_buf)) == 0) {
                if (vstream_fseek(state->dst, curr_offset, SEEK_SET) < 0) {
                    msg_warn("%s: seek file %s: %m", myname, cleanup_path);
                    CLEANUP_DEL_RCPT_RETURN(cleanup_milter_error(state, errno));
@@ -1183,7 +1243,7 @@ static const char *cleanup_del_rcpt(void *context, char *rcpt)
 
     if (msg_verbose)
        msg_info("%s: deleted %d records for recipient \"%s\"",
-                myname, count, rcpt);
+                myname, count, ext_rcpt);
 
     CLEANUP_DEL_RCPT_RETURN(0);
 }
@@ -1260,18 +1320,14 @@ static const char *cleanup_milter_eval(const char *name, void *ptr)
     if (strcmp(name, S8_MAC_AUTH_AUTHOR) == 0)
        return (nvtable_find(state->attr, MAIL_ATTR_SASL_SENDER));
 #endif
-#if 0
     if (strcmp(name, S8_MAC_MAIL_ADDR) == 0)
-       return (state->sender);
-#endif
+       return (state->milter_ext_from ? STR(state->milter_ext_from) : 0);
 
     /*
      * RCPT TO macros.
      */
-#if 0
     if (strcmp(name, S8_MAC_RCPT_ADDR) == 0)
-       return (state->recipient);
-#endif
+       return (state->milter_ext_rcpt ? STR(state->milter_ext_rcpt) : 0);
     return (0);
 }
 
@@ -1485,7 +1541,14 @@ void    cleanup_milter_emul_mail(CLEANUP_STATE *state,
        }
     }
     if (CLEANUP_MILTER_OK(state)) {
-       argv[0] = addr;
+       if (state->milter_ext_from == 0)
+           state->milter_ext_from = vstring_alloc(100);
+       /* Sendmail 8.13 does not externalize the null address. */
+       if (*addr)
+           quote_821_local(state->milter_ext_from, addr);
+       else
+           vstring_strcpy(state->milter_ext_from, addr);
+       argv[0] = STR(state->milter_ext_from);
        argv[1] = 0;
        if ((resp = milter_mail_event(milters, argv)) != 0) {
            cleanup_milter_apply(state, "MAIL", resp);
@@ -1515,7 +1578,14 @@ void    cleanup_milter_emul_rcpt(CLEANUP_STATE *state,
      * attribute, but CLEANUP_STAT_DEFER takes precedence. It terminates
      * queue record processing, and prevents bounces from being sent.
      */
-    argv[0] = addr;
+    if (state->milter_ext_rcpt == 0)
+       state->milter_ext_rcpt = vstring_alloc(100);
+    /* Sendmail 8.13 does not externalize the null address. */
+    if (*addr)
+       quote_821_local(state->milter_ext_rcpt, addr);
+    else
+       vstring_strcpy(state->milter_ext_rcpt, addr);
+    argv[0] = STR(state->milter_ext_rcpt);
     argv[1] = 0;
     if ((resp = milter_rcpt_event(milters, argv)) != 0
        && cleanup_milter_apply(state, "RCPT", resp) != 0) {
index 2cbd73ec234a103bc4d5f3b98ecfe0581e02bfa8..9a35f107d81c48fca8247b6d1ba74ebe39152f73 100644 (file)
@@ -113,6 +113,8 @@ CLEANUP_STATE *cleanup_state_alloc(VSTREAM *src)
     state->client_addr = 0;
     state->client_af = 0;
     state->client_port = 0;
+    state->milter_ext_from = 0;
+    state->milter_ext_rcpt = 0;
     return (state);
 }
 
@@ -159,5 +161,9 @@ void    cleanup_state_free(CLEANUP_STATE *state)
        myfree(state->verp_delims);
     if (state->milters)
        milter_free(state->milters);
+    if (state->milter_ext_from)
+       vstring_free(state->milter_ext_from);
+    if (state->milter_ext_rcpt)
+       vstring_free(state->milter_ext_rcpt);
     myfree((char *) state);
 }
index 61d8b75c43752bd4c9ebd3ac896855a798275b7f..0478022ae5c407af6e9e72bc14a811f7112e2f8e 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20061002"
-#define MAIL_VERSION_NUMBER    "2.3.4-RC1"
+#define MAIL_RELEASE_DATE      "20061019"
+#define MAIL_VERSION_NUMBER    "2.3.4-RC2"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index 43a2596c645a59a8e0f13589aeaf26bfb52f841c..623bd4782bc0ee033be6e9c8737663b980f58043 100644 (file)
@@ -39,7 +39,7 @@
 /*     configuration parameter. Upon delivery, the local delivery agent
 /*     tries each pathname in the list until a file is found.
 /*
-/*     Delivery via ~/.\fB.forward\fR files is done with the privileges
+/*     Delivery via ~/.\fBforward\fR files is done with the privileges
 /*     of the recipient.
 /*     Thus, ~/.\fBforward\fR like files must be readable by the
 /*     recipient, and their parent directory needs to have "execute"
index ef7e2a38f21b3f222b3635267777094c001b647f..8cbb278978e58fc6504624ce82756b63d4bb674d 100644 (file)
@@ -140,8 +140,8 @@ int     var_dup_filter_limit;
 char   *var_empty_addr;
 
 #define STRING_FORMAT  "%-10s %8s %-20s %s\n"
-#define SENDER_FORMAT  "%-11s%8ld %20.20s %s\n"
-#define DROP_FORMAT    "%-10s%c%8ld %20.20s (maildrop queue, sender UID %u)\n"
+#define SENDER_FORMAT  "%-11s %7ld %20.20s %s\n"
+#define DROP_FORMAT    "%-10s%c %7ld %20.20s (maildrop queue, sender UID %u)\n"
 
 static void showq_reasons(VSTREAM *, BOUNCE_LOG *, RCPT_BUF *, DSN_BUF *, 
 HTABLE *);
index 21a7aab6b1384f371bbd592e8d847b1272e7d665..5c5d634706ec0ce48e1bfdcc783c03aaee79ba23 100644 (file)
@@ -901,7 +901,7 @@ static void pre_init(char *unused_name, char **unused_argv)
      * EHLO keyword filter.
      */
     if (*var_smtp_ehlo_dis_maps)
-       smtp_ehlo_dis_maps = maps_create(VAR_SMTPD_EHLO_DIS_MAPS,
+       smtp_ehlo_dis_maps = maps_create(VAR_SMTP_EHLO_DIS_MAPS,
                                         var_smtp_ehlo_dis_maps,
                                         DICT_FLAG_LOCK);
 
index 361e4366ecbc290da7762a73d5dd45bfdb5ef6df..1ed72d73bd58e7f39c2373c5ccceb5eb4e75f4f3 100644 (file)
@@ -175,6 +175,7 @@ static SMTP_SESSION *smtp_reuse_common(SMTP_STATE *state, int fd,
        return (0);
     }
     state->session = session;
+    session->state = state;
 
     /*
      * XXX Temporary fix.
index a6ee5150deac4a2f4a3b5a292fb1a39d17c68f39..69ac49e33db0b595e3acd6318000436e8d6dd456 100644 (file)
@@ -200,6 +200,7 @@ smtpd.o: smtpd_token.h
 smtpd_chat.o: ../../include/argv.h
 smtpd_chat.o: ../../include/attr.h
 smtpd_chat.o: ../../include/cleanup_user.h
+smtpd_chat.o: ../../include/int_filt.h
 smtpd_chat.o: ../../include/iostuff.h
 smtpd_chat.o: ../../include/line_wrap.h
 smtpd_chat.o: ../../include/mail_addr.h
@@ -303,6 +304,8 @@ smtpd_milter.o: ../../include/milter.h
 smtpd_milter.o: ../../include/myaddrinfo.h
 smtpd_milter.o: ../../include/name_code.h
 smtpd_milter.o: ../../include/name_mask.h
+smtpd_milter.o: ../../include/quote_821_local.h
+smtpd_milter.o: ../../include/quote_flags.h
 smtpd_milter.o: ../../include/sys_defs.h
 smtpd_milter.o: ../../include/tls.h
 smtpd_milter.o: ../../include/vbuf.h
index 2b4df40a934f77ab434f247ad6c419a878bcaaec..44480ed0ba61390af4d2db5b759052569de92e1d 100644 (file)
@@ -36,6 +36,7 @@
 /* Global library. */
 
 #include <mail_params.h>
+#include <quote_821_local.h>
 
 /* Milter library. */
 
@@ -148,14 +149,33 @@ const char *smtpd_milter_eval(const char *name, void *ptr)
     if (strcmp(name, S8_MAC_AUTH_AUTHOR) == 0)
        return (IF_SASL_ENABLED(state->sasl_sender));
 #endif
-    if (strcmp(name, S8_MAC_MAIL_ADDR) == 0)
-       return (state->sender);
+    if (strcmp(name, S8_MAC_MAIL_ADDR) == 0) {
+       if (state->sender == 0)
+           return (0);
+       if (state->expand_buf == 0)
+           state->expand_buf = vstring_alloc(10);
+       /* Sendmail 8.13 does not externalize the null string. */
+       if (state->sender[0])
+           quote_821_local(state->expand_buf, state->sender);
+       else
+           vstring_strcpy(state->expand_buf, state->sender);
+       return (STR(state->expand_buf));
+    }
 
     /*
      * RCPT TO macros.
      */
-    if (strcmp(name, S8_MAC_RCPT_ADDR) == 0)
-       return (state->recipient);
-
+    if (strcmp(name, S8_MAC_RCPT_ADDR) == 0) {
+       if (state->recipient == 0)
+           return (0);
+       if (state->expand_buf == 0)
+           state->expand_buf = vstring_alloc(10);
+       /* Sendmail 8.13 does not externalize the null string. */
+       if (state->recipient[0])
+           quote_821_local(state->expand_buf, state->recipient);
+       else
+           vstring_strcpy(state->expand_buf, state->recipient);
+       return (STR(state->expand_buf));
+    }
     return (0);
 }