]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.2.2 v2.2.2
authorWietse Venema <wietse@porcupine.org>
Fri, 1 Apr 2005 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 21:11:42 +0000 (16:11 -0500)
19 files changed:
postfix/HISTORY
postfix/conf/header_checks
postfix/conf/virtual
postfix/html/header_checks.5.html
postfix/html/virtual.5.html
postfix/man/man5/header_checks.5
postfix/man/man5/virtual.5
postfix/proto/header_checks
postfix/proto/virtual
postfix/src/cleanup/cleanup_message.c
postfix/src/global/mail_version.h
postfix/src/lmtp/lmtp_chat.c
postfix/src/lmtp/lmtp_trouble.c
postfix/src/smtp/smtp_addr.c
postfix/src/smtp/smtp_chat.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtp/smtp_session.c
postfix/src/smtp/smtp_trouble.c
postfix/src/util/dict_open.c

index 926f0b02722982b7f17003a582a1b01db1e73dc5..8af435734de925ac39e7bcfc8b81393ab54cf171 100644 (file)
@@ -10485,3 +10485,30 @@ Apologies for any names omitted.
        Bugfix: when <unistd.h> is included, read is a reserved
        identifier. File: smtpstone/smtp-source.c.
 
+20050317
+
+       Cleanup: change wording of error message when an IPv6 address
+       is mistaken for maptype:mapname. File: util/dict_open.c.
+
+20050321
+
+       Robustness: don't look for SMTP status code when there was
+       none. File: smtp/smtp_chat.c, lmtp/lmtp_chat.c.
+
+       Portability: missing netinet/in.h include, so that ntohs()
+       was not defined on HP-UX. File: smtp/smtp_proto.c.
+
+20050327
+
+       Bugfix: the SMTP and LMTP clients did not ask the queue
+       manager to reduce destination concurrency when "lost
+       connection" or "connection timed out" happened AFTER Postfix
+       received the server greeting. Files: smtp/smtp_trouble.c,
+       lmtp/lmtp-trouble.c.
+
+20050328
+
+       Cleanup: the REPLACE action is no longer implemented as
+       PREPEND+IGNORE. The result remains in the input stream, and
+       is subject to address rewriting and other processing where
+       applicable.  File: cleanup/cleanup_message.c.
index 14b7d6f3c8433aba7ff54ab8e58a6b9466318fdb..038470778bc56b91f1dc78a57bd0aac009b96ef8 100644 (file)
@@ -1,4 +1,4 @@
-# HEADER_CHECKS(5)                                 HEADER_CHECKS(5)
+# HEADER_CHECKS(5)                                              HEADER_CHECKS(5)
 # 
 # NAME
 #        header_checks - Postfix built-in header/body inspection
 #                      line,  immediately  before  the  input  that
 #                      triggered the PREPEND action.
 # 
+#               o      The prepended text is not considered part of
+#                      the  input  stream:  it  is  not  subject to
+#                      header/body checks or address rewriting, and
+#                      it does not affect the way that Postfix adds
+#                      missing message headers.
+# 
 #               o      When prepending text before a message header
 #                      line,  the  prepended text must begin with a
 #                      valid message header label.
 #               Replace  the  current  line with the specified text
 #               and inspect the next input line.
 # 
-#               Note: when replacing a  message  header  line,  the
-#               replacement  text  must  begin  with a valid header
-#               label.
-# 
 #               This feature is available in Postfix 2.2 and later.
+#               The  description below applies to Postfix 2.2.2 and
+#               later.
+# 
+#               Notes:
+# 
+#               o      When replacing a message  header  line,  the
+#                      replacement  text  must  begin  with a valid
+#                      header label.
+# 
+#               o      The replaced text remains part of the  input
+#                      stream.  Unlike  the result from the PREPEND
+#                      action, a replaced  message  header  may  be
+#                      subject  to address rewriting and may affect
+#                      the way that Postfix  adds  missing  message
+#                      headers.
 # 
 #        REJECT optional text...
 #               Reject  the  entire  message.  Reply  with optional
 #        P.O. Box 704
 #        Yorktown Heights, NY 10598, USA
 # 
-#                                                  HEADER_CHECKS(5)
+#                                                               HEADER_CHECKS(5)
index 668332f9efdd80342743e3ef39da39d327fc9e00..6aa789bc97e93bdc134143a00ab9f393c9f9b1ac 100644 (file)
@@ -1,4 +1,4 @@
-# VIRTUAL(5)                                             VIRTUAL(5)
+# VIRTUAL(5)                                                          VIRTUAL(5)
 # 
 # NAME
 #        virtual - Postfix virtual alias table format
 #        postmap -q - /etc/postfix/virtual <inputfile
 # 
 # DESCRIPTION
-#        The  optional  virtual(5)  alias  table  specifies address
-#        aliasing  for  arbitrary  local  or  non-local   recipient
-#        addresses.  Virtual  aliasing is recursive, and is done by
-#        the Postfix cleanup(8) daemon.
+#        The  optional  virtual(5)  alias  table rewrites recipient
+#        addresses for all local, virtual and remote mail  destina-
+#        tions.   This is unlike the aliases(5) table which is used
+#        only for local(8) delivery.  Virtual  aliasing  is  recur-
+#        sive,  and is implemented by the Postfix cleanup(8) daemon
+#        before mail is queued.
 # 
 #        The main applications of virtual aliasing are:
 # 
 #            virtual_alias_maps = hash:/etc/postfix/virtual
 # 
 #            Note: some systems use dbm databases instead of  hash.
-#            See  the  output  from  "postconf  -m"  for  available
-#            database types.
+#            See  the output from "postconf -m" for available data-
+#            base types.
 # 
 #        /etc/postfix/virtual:
 #            virtual-alias.domain anything (right-hand content does not matter)
 #        constituent parts, nor is user+foo broken up into user and
 #        foo.
 # 
-#        Patterns are applied in the  order  as  specified  in  the
-#        table,  until  a  pattern is found that matches the search
+#        Patterns are applied in the order as specified in the  ta-
+#        ble,  until  a  pattern  is  found that matches the search
 #        string.
 # 
 #        Results are the same as with indexed  file  lookups,  with
 # TCP-BASED TABLES
 #        This section describes how the table lookups  change  when
 #        lookups are directed to a TCP-based server. For a descrip-
-#        tion  of  the  TCP  client/server  lookup  protocol,   see
-#        tcp_table(5).   This  feature  is  not available up to and
-#        including Postfix version 2.2.
+#        tion of the TCP client/server lookup protocol, see tcp_ta-
+#        ble(5).  This feature is not available up to and including
+#        Postfix version 2.2.
 # 
 #        Each lookup operation uses the entire address once.  Thus,
 #        user@domain  mail  addresses  are not broken up into their
 #        P.O. Box 704
 #        Yorktown Heights, NY 10598, USA
 # 
-#                                                        VIRTUAL(5)
+#                                                                     VIRTUAL(5)
index 9354d3b2547da2f15cb352d91ece8a1085197130..72741788f13f1101ed2a1e54fb90a07ef49ebd20 100644 (file)
@@ -208,6 +208,12 @@ HEADER_CHECKS(5)                                              HEADER_CHECKS(5)
                      line,  immediately  before  the  input  that
                      triggered the <b>PREPEND</b> action.
 
+              <b>o</b>      The prepended text is not considered part of
+                     the  input  stream:  it  is  not  subject to
+                     header/body checks or address rewriting, and
+                     it does not affect the way that Postfix adds
+                     missing message headers.
+
               <b>o</b>      When prepending text before a message header
                      line,  the  prepended text must begin with a
                      valid message header label.
@@ -234,11 +240,22 @@ HEADER_CHECKS(5)                                              HEADER_CHECKS(5)
               Replace  the  current  line with the specified text
               and inspect the next input line.
 
-              Note: when replacing a  message  header  line,  the
-              replacement  text  must  begin  with a valid header
-              label.
-
               This feature is available in Postfix 2.2 and later.
+              The  description below applies to Postfix 2.2.2 and
+              later.
+
+              Notes:
+
+              <b>o</b>      When replacing a message  header  line,  the
+                     replacement  text  must  begin  with a valid
+                     header label.
+
+              <b>o</b>      The replaced text remains part of the  input
+                     stream.  Unlike  the result from the <b>PREPEND</b>
+                     action, a replaced  message  header  may  be
+                     subject  to address rewriting and may affect
+                     the way that Postfix  adds  missing  message
+                     headers.
 
        <b>REJECT</b> <i>optional text...</i>
               Reject  the  entire  message.  Reply  with <i>optional</i>
index 2d6681c0fc9be2a26ce4ed91960ef89b97d613f6..937d3ed1f62d43ce65b4d9627e9158665a713a16 100644 (file)
@@ -17,10 +17,12 @@ VIRTUAL(5)                                                          VIRTUAL(5)
        <b>postmap -q - /etc/postfix/virtual</b> &lt;<i>inputfile</i>
 
 <b>DESCRIPTION</b>
-       The  optional  <a href="virtual.5.html"><b>virtual</b>(5)</a>  alias  table  specifies address
-       aliasing  for  arbitrary  local  or  non-local   recipient
-       addresses.  Virtual  aliasing is recursive, and is done by
-       the Postfix <a href="cleanup.8.html"><b>cleanup</b>(8)</a> daemon.
+       The  optional  <a href="virtual.5.html"><b>virtual</b>(5)</a>  alias  table rewrites recipient
+       addresses for all local, virtual and remote mail  destina-
+       tions.   This is unlike the <a href="aliases.5.html"><b>aliases</b>(5)</a> table which is used
+       only for <a href="local.8.html"><b>local</b>(8)</a> delivery.  Virtual  aliasing  is  recur-
+       sive,  and is implemented by the Postfix <a href="cleanup.8.html"><b>cleanup</b>(8)</a> daemon
+       before mail is queued.
 
        The main applications of virtual aliasing are:
 
index 71a48372dd2eaf0665b2bca73fce6b07eba6b797..3475ea3bf07322843792ab505932b94acf3ad3f0 100644 (file)
@@ -194,6 +194,11 @@ Notes:
 The prepended text is output on a separate line, immediately
 before the input that triggered the \fBPREPEND\fR action.
 .IP \(bu
+The prepended text is not considered part of the input
+stream: it is not subject to header/body checks or address
+rewriting, and it does not affect the way that Postfix adds
+missing message headers.
+.IP \(bu
 When prepending text before a message header line, the prepended
 text must begin with a valid message header label.
 .IP \(bu
@@ -216,10 +221,20 @@ This feature is available in Postfix 2.1 and later.
 Replace the current line with the specified text and inspect the next
 input line.
 .sp
-Note: when replacing a message header line, the replacement text
-must begin with a valid header label.
+This feature is available in Postfix 2.2 and later. The
+description below applies to Postfix 2.2.2 and later.
 .sp
-This feature is available in Postfix 2.2 and later.
+Notes:
+.RS
+.IP \(bu
+When replacing a message header line, the replacement text
+must begin with a valid header label.
+.IP \(bu
+The replaced text remains part of the input stream. Unlike
+the result from the \fBPREPEND\fR action, a replaced message
+header may be subject to address rewriting and may affect
+the way that Postfix adds missing message headers.
+.RE
 .IP "\fBREJECT \fIoptional text...\fR
 Reject the entire message. Reply with \fIoptional text...\fR when
 the optional text is specified, otherwise reply with a generic error
index c2851b8b254eb69dc87ad0e4422acf7c321c9eaf..9250663fc706120a441f269974fa00d0d686e4f9 100644 (file)
@@ -16,9 +16,12 @@ Postfix virtual alias table format
 .SH DESCRIPTION
 .ad
 .fi
-The optional \fBvirtual\fR(5) alias table specifies address aliasing
-for arbitrary local or non-local recipient addresses. Virtual aliasing
-is recursive, and is done by the Postfix \fBcleanup\fR(8) daemon.
+The optional \fBvirtual\fR(5) alias table rewrites recipient
+addresses for all local, virtual and remote mail destinations.
+This is unlike the \fBaliases\fR(5) table which is used
+only for \fBlocal\fR(8) delivery.  Virtual aliasing is
+recursive, and is implemented by the Postfix \fBcleanup\fR(8)
+daemon before mail is queued.
 
 The main applications of virtual aliasing are:
 .IP \(bu
index 289acac2584d0361d9cd92f5df6e2498641ac322..6fc1965d32a9ce5e818f21bf9c25a6cb2633c955 100644 (file)
 #      The prepended text is output on a separate line, immediately
 #      before the input that triggered the \fBPREPEND\fR action.
 # .IP \(bu
+#      The prepended text is not considered part of the input
+#      stream: it is not subject to header/body checks or address
+#      rewriting, and it does not affect the way that Postfix adds
+#      missing message headers.
+# .IP \(bu
 #      When prepending text before a message header line, the prepended
 #      text must begin with a valid message header label.
 # .IP \(bu
 #      Replace the current line with the specified text and inspect the next
 #      input line.
 # .sp
-#      Note: when replacing a message header line, the replacement text
-#      must begin with a valid header label.
+#      This feature is available in Postfix 2.2 and later. The
+#      description below applies to Postfix 2.2.2 and later.
 # .sp
-#      This feature is available in Postfix 2.2 and later.
+#      Notes: 
+# .RS
+# .IP \(bu
+#      When replacing a message header line, the replacement text
+#      must begin with a valid header label.
+# .IP \(bu
+#      The replaced text remains part of the input stream. Unlike
+#      the result from the \fBPREPEND\fR action, a replaced message
+#      header may be subject to address rewriting and may affect
+#      the way that Postfix adds missing message headers.
+# .RE
 # .IP "\fBREJECT \fIoptional text...\fR
 #      Reject the entire message. Reply with \fIoptional text...\fR when
 #      the optional text is specified, otherwise reply with a generic error
index cf28b83d45c0cbad05a60fdc538e134b9769593a..8a2a0b1f22b3aa336671ea43f4a2c8bf399aa92b 100644 (file)
 #
 #      \fBpostmap -q - /etc/postfix/virtual <\fIinputfile\fR
 # DESCRIPTION
-#      The optional \fBvirtual\fR(5) alias table specifies address aliasing
-#      for arbitrary local or non-local recipient addresses. Virtual aliasing
-#      is recursive, and is done by the Postfix \fBcleanup\fR(8) daemon.
+#      The optional \fBvirtual\fR(5) alias table rewrites recipient
+#      addresses for all local, virtual and remote mail destinations.
+#      This is unlike the \fBaliases\fR(5) table which is used
+#      only for \fBlocal\fR(8) delivery.  Virtual aliasing is
+#      recursive, and is implemented by the Postfix \fBcleanup\fR(8)
+#      daemon before mail is queued.
 #
 #      The main applications of virtual aliasing are:
 # .IP \(bu
index 0a77d4f3d7587195e29b668cb3d0a024a65c4cc8..029f70688874009d3580160d71b195ecd72208b6 100644 (file)
@@ -295,18 +295,17 @@ static void cleanup_act_log(CLEANUP_STATE *state,
 
 /* cleanup_act - act upon a header/body match */
 
-static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf,
-                              const char *value, const char *map_class)
+static const char *cleanup_act(CLEANUP_STATE *state, char *context,
+                                      const char *buf, const char *value,
+                                      const char *map_class)
 {
     const char *optional_text = value + strcspn(value, " \t");
     int     command_len = optional_text - value;
-    VSTRING *bp;
 
     while (*optional_text && ISSPACE(*optional_text))
        optional_text++;
 
 #define STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0)
-#define CLEANUP_ACT_KEEP 1
 #define CLEANUP_ACT_DROP 0
 
     if (STREQUAL(value, "REJECT", command_len)) {
@@ -316,17 +315,18 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf,
        state->errs |= CLEANUP_STAT_CONT;
        state->flags &= ~CLEANUP_FLAG_FILTER;
        cleanup_act_log(state, "reject", context, buf, state->reason);
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
     }
     if (STREQUAL(value, "WARN", command_len)) {
        cleanup_act_log(state, "warning", context, buf, optional_text);
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
     }
     if (STREQUAL(value, "FILTER", command_len)) {
        if (*optional_text == 0) {
            msg_warn("missing FILTER command argument in %s map", map_class);
        } else if (strchr(optional_text, ':') == 0) {
-           msg_warn("bad FILTER command %s in %s, need transport:destination",
+           msg_warn("bad FILTER command %s in %s -- "
+                    "need transport:destination",
                     optional_text, map_class);
        } else {
            if (state->filter)
@@ -334,57 +334,52 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf,
            state->filter = mystrdup(optional_text);
            cleanup_act_log(state, "filter", context, buf, optional_text);
        }
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
     }
     if (STREQUAL(value, "DISCARD", command_len)) {
        cleanup_act_log(state, "discard", context, buf, optional_text);
        state->flags |= CLEANUP_FLAG_DISCARD;
        state->flags &= ~CLEANUP_FLAG_FILTER;
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
     }
     if (STREQUAL(value, "HOLD", command_len)) {
        cleanup_act_log(state, "hold", context, buf, optional_text);
        state->flags |= CLEANUP_FLAG_HOLD;
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
     }
     if (STREQUAL(value, "PREPEND", command_len)) {
        if (*optional_text == 0) {
            msg_warn("PREPEND action without text in %s map", map_class);
        } else if (strcmp(context, CLEANUP_ACT_CTXT_HEADER) == 0
                   && !is_header(optional_text)) {
-           msg_warn("bad PREPEND header text \"%s\" in %s map, "
+           msg_warn("bad PREPEND header text \"%s\" in %s map -- "
                     "need \"headername: headervalue\"",
                     optional_text, map_class);
        } else {
            cleanup_act_log(state, "prepend", context, buf, optional_text);
            cleanup_out_string(state, REC_TYPE_NORM, optional_text);
        }
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
     }
     if (STREQUAL(value, "REPLACE", command_len)) {
        if (*optional_text == 0) {
            msg_warn("REPLACE action without text in %s map", map_class);
-           return (CLEANUP_ACT_KEEP);
-       } else if (strcmp(context, CLEANUP_ACT_CTXT_HEADER) == 0) {
-           if (!is_header(optional_text)) {
-               msg_warn("bad REPLACE header text \"%s\" in %s map, "
-                        "need \"headername: headervalue\"",
-                        optional_text, map_class);
-               return (CLEANUP_ACT_KEEP);
-           } 
-           /* XXX Impedance mismatch. */
-           bp = vstring_strcpy(vstring_alloc(100), optional_text);
-           cleanup_out_header(state, bp);
-           vstring_free(bp);
+           return (buf);
+       } else if (strcmp(context, CLEANUP_ACT_CTXT_HEADER) == 0
+                  && !is_header(optional_text)) {
+           msg_warn("bad REPLACE header text \"%s\" in %s map -- "
+                    "need \"headername: headervalue\"",
+                    optional_text, map_class);
+           return (buf);
        } else {
-           cleanup_out_string(state, REC_TYPE_NORM, optional_text);
+           cleanup_act_log(state, "replace", context, buf, optional_text);
+           return (mystrdup(optional_text));
        }
-       cleanup_act_log(state, "replace", context, buf, optional_text);
-       return (CLEANUP_ACT_DROP);
     }
     if (STREQUAL(value, "REDIRECT", command_len)) {
        if (strchr(optional_text, '@') == 0) {
-           msg_warn("bad REDIRECT target \"%s\" in %s map, need user@domain",
+           msg_warn("bad REDIRECT target \"%s\" in %s map -- "
+                    "need user@domain",
                     optional_text, map_class);
        } else {
            if (state->redirect)
@@ -393,7 +388,7 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf,
            cleanup_act_log(state, "redirect", context, buf, optional_text);
            state->flags &= ~CLEANUP_FLAG_FILTER;
        }
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
     }
     /* Allow and ignore optional text after the action. */
 
@@ -401,13 +396,13 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf,
        return (CLEANUP_ACT_DROP);
 
     if (STREQUAL(value, "DUNNO", command_len)) /* preferred */
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
 
     if (STREQUAL(value, "OK", command_len))    /* compat */
-       return (CLEANUP_ACT_KEEP);
+       return (buf);
 
     msg_warn("unknown command in %s map: %s", map_class, value);
-    return (CLEANUP_ACT_KEEP);
+    return (buf);
 }
 
 /* cleanup_header_callback - process one complete header line */
@@ -456,10 +451,17 @@ static void cleanup_header_callback(void *context, int header_class,
        const char *value;
 
        if ((value = maps_find(checks, header, 0)) != 0) {
-           if (cleanup_act(state, CLEANUP_ACT_CTXT_HEADER,
-                           header, value, map_class)
-               == CLEANUP_ACT_DROP)
+           const char *result;
+
+           if ((result = cleanup_act(state, CLEANUP_ACT_CTXT_HEADER,
+                                     header, value, map_class))
+               == CLEANUP_ACT_DROP) {
                return;
+           } else if (result != header) {
+               vstring_strcpy(header_buf, result);
+               hdr_opts = header_opts_find(result);
+               myfree((char *) result);
+           }
        }
     }
 
@@ -665,10 +667,17 @@ static void cleanup_body_callback(void *context, int type,
        const char *value;
 
        if ((value = maps_find(cleanup_body_checks, buf, 0)) != 0) {
-           if (cleanup_act(state, CLEANUP_ACT_CTXT_BODY,
-                           buf, value, VAR_BODY_CHECKS)
-               == CLEANUP_ACT_DROP)
+           const char *result;
+
+           if ((result = cleanup_act(state, CLEANUP_ACT_CTXT_BODY,
+                                     buf, value, VAR_BODY_CHECKS))
+               == CLEANUP_ACT_DROP) {
                return;
+           } else if (result != buf) {
+               cleanup_out(state, type, result, strlen(result));
+               myfree((char *) result);
+               return;
+           }
        }
     }
     cleanup_out(state, type, buf, len);
index 8c1a6f86d099baca3fc6f83f9d58da52b40edf6d..d3519119342b67422826ef1f2f14f1302fc7a398 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only.
   */
-#define MAIL_RELEASE_DATE      "20050315"
-#define MAIL_VERSION_NUMBER    "2.2.1"
+#define MAIL_RELEASE_DATE      "20050401"
+#define MAIL_VERSION_NUMBER    "2.2.2"
 
 #define VAR_MAIL_VERSION       "mail_version"
 #ifdef SNAPSHOT
index 43379a75397262a8f4f05dc175496f765c09dac0..b063771382b6d0f27895e574f70da13af323e81b 100644 (file)
@@ -175,6 +175,7 @@ LMTP_RESP *lmtp_chat_resp(LMTP_STATE *state)
     static LMTP_RESP rdata;
     char   *cp;
     int     last_char;
+    int     three_digs = 0;
 
     /*
      * Initialize the response data buffer.
@@ -215,7 +216,7 @@ LMTP_RESP *lmtp_chat_resp(LMTP_STATE *state)
         */
        for (cp = STR(state->buffer); *cp && ISDIGIT(*cp); cp++)
             /* void */ ;
-       if (cp - STR(state->buffer) == 3) {
+       if ((three_digs = (cp - STR(state->buffer) == 3)) != 0) {
            if (*cp == '-')
                continue;
            if (*cp == ' ' || *cp == 0)
@@ -223,7 +224,10 @@ LMTP_RESP *lmtp_chat_resp(LMTP_STATE *state)
        }
        state->error_mask |= MAIL_ERROR_PROTOCOL;
     }
-    rdata.code = atoi(STR(state->buffer));
+    if (three_digs != 0)
+       rdata.code = atoi(STR(state->buffer));
+    else
+       rdata.code = 0;
     VSTRING_TERMINATE(rdata.buf);
     rdata.str = STR(rdata.buf);
     return (&rdata);
index 84ce001e1700bdeb0b9e6c0a1ccfeef667300f62..b9d1ce5001c29413206adc54fd848056a6342cdf 100644 (file)
@@ -313,6 +313,8 @@ int     lmtp_stream_except(LMTP_STATE *state, int code, char *description)
                                      request->arrival_time,
                                      "%s", vstring_str(why));
     }
+    if (request->hop_status == 0)
+       request->hop_status = mystrdup(vstring_str(why));
 
     /*
      * Cleanup.
index 24f08902a79bce034e0cd8453bca18d6be370859..49980a41510eab9ee2d0a95bd884f2fa05de08c4 100644 (file)
@@ -209,7 +209,8 @@ static DNS_RR *smtp_addr_one(DNS_RR *addr_list, char *host, unsigned pref, VSTRI
            freeaddrinfo(res0);
            if (found == 0) {
                vstring_sprintf(why, "%s: host not found", host);
-               smtp_errno = SMTP_ERR_FAIL;
+               if (smtp_errno != SMTP_ERR_RETRY)
+                   smtp_errno = SMTP_ERR_FAIL;
            }
            return (addr_list);
        }
index 4cb5794980bdd01b19d781ecd1e479075b88ac52..2270f774179ff2e053d9f17d3db45e627e59e779 100644 (file)
@@ -198,6 +198,7 @@ SMTP_RESP *smtp_chat_resp(SMTP_SESSION *session)
     static SMTP_RESP rdata;
     char   *cp;
     int     last_char;
+    int     three_digs = 0;
 
     /*
      * Initialize the response data buffer.
@@ -238,7 +239,7 @@ SMTP_RESP *smtp_chat_resp(SMTP_SESSION *session)
         */
        for (cp = STR(session->buffer); *cp && ISDIGIT(*cp); cp++)
             /* void */ ;
-       if (cp - STR(session->buffer) == 3) {
+       if ((three_digs = (cp - STR(session->buffer) == 3)) != 0) {
            if (*cp == '-')
                continue;
            if (*cp == ' ' || *cp == 0)
@@ -246,7 +247,10 @@ SMTP_RESP *smtp_chat_resp(SMTP_SESSION *session)
        }
        session->error_mask |= MAIL_ERROR_PROTOCOL;
     }
-    rdata.code = atoi(STR(session->buffer));
+    if (three_digs != 0)
+       rdata.code = atoi(STR(session->buffer));
+    else
+       rdata.code = 0;
     VSTRING_TERMINATE(rdata.buf);
     rdata.str = STR(rdata.buf);
     return (&rdata);
index ebbe53f1aa8d7ce970c26a98315fa2d91d47dd40..398a951c7d96b5f2ade6ffb22c5d17937fff415f 100644 (file)
@@ -91,6 +91,7 @@
 #include <sys_defs.h>
 #include <sys/stat.h>
 #include <sys/socket.h>                        /* shutdown(2) */
+#include <netinet/in.h>                        /* ntohs() */
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>                    /* 44BSD stdarg.h uses abort() */
index 64cb7f2735eb8ddcc07fcc68cdafba0f986a829f..453cc9e690e7b1159f0c45e93f36a9ce0122bd7b 100644 (file)
 
  /*
   * Per-site policies can override main.cf settings.
-  * 
-  * XXX 200412 This does not work as some people may expect. A policy that
-  * specifies "use TLS" in a policy file while TLS is turned off in main.cf
-  * cannot work, because there is no OpenSSL context for creating sessions
-  * (that context exists only if TLS is enabled via main.cf settings; the
-  * OpenSSL context is created at process initialization time and cannot be
-  * created on the fly).
   */
 typedef struct {
     int     dont_use;                  /* don't use TLS */
index 435a1ae35413fe11b41723363846d7e7267ba65b..1d8ba27e3da0c8d1fdddc515eb2309303e8037d5 100644 (file)
@@ -420,6 +420,9 @@ int     smtp_stream_except(SMTP_STATE *state, int code, char *description)
                                          "%s", vstring_str(why));
            SMTP_RCPT_DROP(state, rcpt);
        }
+       /* XXX This assumes no fall-back relay. */
+       if (request->hop_status == 0)
+           request->hop_status = mystrdup(vstring_str(why));
     }
 
     /*
index 079c51ee32bf39dd5c2fb82e03ac96595f2258b0..c89911f54020f1eca47290a361bb9956cbea05b0 100644 (file)
@@ -266,7 +266,7 @@ DICT   *dict_open(const char *dict_spec, int open_flags, int dict_flags)
     DICT   *dict;
 
     if ((dict_name = split_at(saved_dict_spec, ':')) == 0)
-       msg_fatal("open dictionary: need \"type:name\" form instead of: \"%s\"",
+       msg_fatal("open dictionary: expecting \"type:name\" form instead of \"%s\"",
                  dict_spec);
 
     dict = dict_open3(saved_dict_spec, dict_name, open_flags, dict_flags);
@@ -284,6 +284,9 @@ DICT   *dict_open3(const char *dict_type, const char *dict_name,
     DICT_OPEN_INFO *dp;
     DICT   *dict;
 
+    if (*dict_type == 0 || *dict_name == 0)
+       msg_fatal("open dictionary: expecting \"type:name\" form instead of \"%s:%s\"",
+                 dict_type, dict_name);
     if (dict_open_hash == 0)
        dict_open_init();
     if ((dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type)) == 0)