]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-1.1.12-20021124
authorWietse Venema <wietse@porcupine.org>
Sun, 24 Nov 2002 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:28 +0000 (06:28 +0000)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/global/resolve_clnt.c
postfix/src/global/resolve_clnt.h
postfix/src/nqmgr/qmgr_message.c
postfix/src/postalias/Makefile.in
postfix/src/qmgr/qmgr_message.c
postfix/src/trivial-rewrite/Makefile.in
postfix/src/trivial-rewrite/resolve.c

index 979fb9a8ce87a6fe30168791415d6023d30066b6..d9edf263a2db1791c83baecd229a90d91f8b7ab2 100644 (file)
@@ -7226,6 +7226,15 @@ Apologies for any names omitted.
        code had grown into a monster and needed to be replaced.
        trivial-rewrite/transport.c.
 
+20021121
+
+       Bugfix: garbage in "user@garbage"@domain address forms may
+       cause the SMTP or LMTP client to terminate with a fatal
+       error exit because garbage/tcp is not an existing service.
+       This cannot be abused to cause the SMTP or LMTP client to
+       send data into unauthorized ports.  Files:  *qmgr/qmgr_message.c,
+       trivial-rewrite/resolve.c.
+
 Open problems:
 
        Low: revise other local delivery agent duplicate filters.
index 82934d696a053db1fcab1d34030078a006083627..042980ca8b8dd4ecb5c7c0bfa7181bed663c283d 100644 (file)
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only, unless they include the same bugfix as a patch release.
   */
-#define MAIL_RELEASE_DATE      "20021115"
+#define MAIL_RELEASE_DATE      "20021124"
 
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "1.1.11-" MAIL_RELEASE_DATE
+#define DEF_MAIL_VERSION       "1.1.12-" MAIL_RELEASE_DATE
 extern char *var_mail_version;
 
  /*
index c8e6ccca944498c5b3e139691caa3b7af83e54c2..75c29ba900652d5f6922cf8136b487cd583f50f6 100644 (file)
@@ -48,6 +48,8 @@
 /*     After address resolution the recipient localpart contains further
 /*     routing information, so the resolved next-hop destination is not
 /*     the final destination.
+/* .IP RESOLVE_FLAG_ERROR
+/*     The address resolved to something that has invalid syntax.
 /* DIAGNOSTICS
 /*     Warnings: communication failure. Fatal error: mail system is down.
 /* SEE ALSO
index af55d1f4ec481dd7accdd456cba127f24fe63a41..80e9aa990ebb4a220ebd28225e5b10dca6662d47 100644 (file)
@@ -23,6 +23,7 @@
 
 #define RESOLVE_FLAG_FINAL     (1<<0)  /* final delivery */
 #define RESOLVE_FLAG_ROUTED    (1<<1)  /* routed destination */
+#define RESOLVE_FLAG_ERROR     (1<<2)  /* bad destination */
 
 typedef struct RESOLVE_REPLY {
     VSTRING *transport;
index 609a8b51412a83ddf915d169a8fe512cde137dd7..ff2c9205fc43fb96a87e82b04f6729e62392082c 100644 (file)
@@ -664,8 +664,20 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
         */
        if (var_sender_routing == 0) {
            resolve_clnt_query(recipient->address, &reply);
+           if (reply.flags & RESOLVE_FLAG_ERROR) {
+               qmgr_bounce_recipient(message, recipient,
+                                     "bad address syntax: \"%s\"",
+                                     recipient->address);
+               continue;
+           }
        } else {
            resolve_clnt_query(message->sender, &reply);
+           if (reply.flags & RESOLVE_FLAG_ERROR) {
+               qmgr_bounce_recipient(message, recipient,
+                                     "bad address syntax: \"%s\"",
+                                     message->sender);
+               continue;
+           }
            vstring_strcpy(reply.recipient, recipient->address);
        }
        if (message->filter_xport) {
index 5fd24274493e390d65338882fa83d3b1fc4a9570..465ba2c3819c24d93fdc2fa6c909a84fcc8238d5 100644 (file)
@@ -90,7 +90,6 @@ postalias.o: ../../include/msg_vstream.h
 postalias.o: ../../include/readlline.h
 postalias.o: ../../include/stringops.h
 postalias.o: ../../include/split_at.h
-postalias.o: ../../include/get_hostname.h
 postalias.o: ../../include/vstring_vstream.h
 postalias.o: ../../include/set_eugid.h
 postalias.o: ../../include/tok822.h
index 21589505442392115d9ce68c0f603952dc8e3288..76a797e83a0ee3cc7df7df78d58d918ec7e4264d 100644 (file)
@@ -544,8 +544,20 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
         */
        if (var_sender_routing == 0) {
            resolve_clnt_query(recipient->address, &reply);
+           if (reply.flags & RESOLVE_FLAG_ERROR) {
+               qmgr_bounce_recipient(message, recipient,
+                                     "bad address syntax: \"%s\"",
+                                     recipient->address);
+               continue;
+           }
        } else {
            resolve_clnt_query(message->sender, &reply);
+           if (reply.flags & RESOLVE_FLAG_ERROR) {
+               qmgr_bounce_recipient(message, recipient,
+                                     "bad address syntax: \"%s\"",
+                                     message->sender);
+               continue;
+           }
            vstring_strcpy(reply.recipient, recipient->address);
        }
        if (message->filter_xport) {
index 01e2166c8af233d495f7b4c8d6a87b6372338f91..f41bfa562d251c132e469bea598dcd8054319495 100644 (file)
@@ -69,6 +69,7 @@ resolve.o: ../../include/vbuf.h
 resolve.o: ../../include/vstream.h
 resolve.o: ../../include/vstring_vstream.h
 resolve.o: ../../include/split_at.h
+resolve.o: ../../include/valid_hostname.h
 resolve.o: ../../include/mail_params.h
 resolve.o: ../../include/mail_proto.h
 resolve.o: ../../include/iostuff.h
index b53d56563a4b710ebea951806421c0e94151d039..fd47abf5b9d0f9351509c5c12b6c2394abfa3027 100644 (file)
@@ -61,6 +61,7 @@
 #include <vstream.h>
 #include <vstring_vstream.h>
 #include <split_at.h>
+#include <valid_hostname.h>
 
 /* Global library. */
 
@@ -220,8 +221,12 @@ void    resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
            vstring_strcpy(nexthop, destination);
        else if (*var_relayhost)
            vstring_strcpy(nexthop, var_relayhost);
-       else
+       else {
            tok822_internalize(nexthop, domain->next, TOK822_STR_DEFL);
+           if (STR(nexthop)[strspn(STR(nexthop), "[]0123456789.")] != 0
+               && valid_hostname(STR(nexthop), DONT_GRIPE) == 0)
+               *flags |= RESOLVE_FLAG_ERROR;
+       }
        if (*STR(channel) == 0)
            msg_fatal("null transport is not allowed: %s = %s",
                      VAR_DEF_TRANSPORT, var_def_transport);