]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.5-20071229
authorWietse Venema <wietse@porcupine.org>
Sat, 29 Dec 2007 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:33:47 +0000 (06:33 +0000)
postfix/HISTORY
postfix/WISHLIST
postfix/src/global/mail_version.h
postfix/src/milter/milter8.c
postfix/src/util/dummy_read.c
postfix/src/util/dummy_write.c

index a09b76006c2c259a15f4a5cae4c8b8de3b54d05c..d30cc79946939309db915f764fbced377c3fbb46 100644 (file)
@@ -14077,3 +14077,9 @@ Apologies for any names omitted.
        Cleanup: further refinements of the Milter code, allowing
        for multiple macro overrides. The code is now ready for
        serious testing. File: milter/milter8.c.
+
+20071229
+
+       Bugfix: the Milter client did not replace the Postfix-specific
+       form for unknown host names by the Sendmail-specific form.
+       File: milter/milter8.c.
index c4d15e13862b4501ea8d14458edc97eac3327028..3302948b55c5eface84eaea0b5e226d873546d2b 100644 (file)
@@ -1,5 +1,10 @@
 Wish list:
 
+       Milter client: send [ipaddress] instead of "unknown".
+
+       The cleanup server should report "file too large" milter
+       errors as permanent errors.
+
        In the SMTP client, handle 421 replies in smtp_loop() by
        having the input function raise a flag after detecting 421
        (kill connection caching and be sure to do the right thing
index 09cb25eb6d294a12a5b8db7a7a253eaea2a74d6e..89a103c265e918949abb9900352d73e469c59610 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20071227"
+#define MAIL_RELEASE_DATE      "20071229"
 #define MAIL_VERSION_NUMBER    "2.5"
 
 #ifdef SNAPSHOT
index 491e34d8828d8769cf13aa9166f58f8e37475301..37ce0060b9a66257cb942e2810d445f8b56a684e 100644 (file)
@@ -1773,6 +1773,17 @@ static const char *milter8_conn_event(MILTER *m,
     MILTER8 *milter = (MILTER8 *) m;
     int     port;
     int     skip_reply;
+    const char *sm_name;
+    char   *ptr = 0;
+    const char *resp;
+
+    /*
+     * Need a global definition for "unknown" host name or address that is
+     * shared by smtpd, cleanup and libmilter.
+     */
+#define XXX_UNKNOWN    "unknown"
+#define STR_EQ(x,y)    (strcmp((x), (y)) == 0)
+#define STR_NE(x,y)    (strcmp((x), (y)) != 0)
 
     /*
      * XXX Sendmail 8 libmilter closes the MTA-to-filter socket when it finds
@@ -1805,40 +1816,51 @@ static const char *milter8_conn_event(MILTER *m,
        }
        milter->state = MILTER8_STAT_ENVELOPE;
        skip_reply = ((milter->ev_mask & SMFIP_NR_CONN) != 0);
+       /* Transform unknown hostname from Postfix to Sendmail form. */
+       sm_name = (STR_NE(client_name, XXX_UNKNOWN) ? client_name :
+                  STR_EQ(client_addr, XXX_UNKNOWN) ? client_name :
+                  (ptr = concatenate("[", client_addr, "]", (char *) 0)));
        switch (addr_family) {
        case AF_INET:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 skip_reply, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_INET,
-                                 MILTER8_DATA_NSHORT, htons(port),
-                                 MILTER8_DATA_STRING, client_addr,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                skip_reply, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_INET,
+                                MILTER8_DATA_NSHORT, htons(port),
+                                MILTER8_DATA_STRING, client_addr,
+                                MILTER8_DATA_END);
+           break;
 #ifdef HAS_IPV6
        case AF_INET6:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 skip_reply, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_INET6,
-                                 MILTER8_DATA_NSHORT, htons(port),
-                                 MILTER8_DATA_STRING, client_addr,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                skip_reply, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_INET6,
+                                MILTER8_DATA_NSHORT, htons(port),
+                                MILTER8_DATA_STRING, client_addr,
+                                MILTER8_DATA_END);
+           break;
 #endif
        case AF_UNIX:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 skip_reply, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_UNIX,
-                                 MILTER8_DATA_NSHORT, htons(0),
-                                 MILTER8_DATA_STRING, client_addr,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                skip_reply, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_UNIX,
+                                MILTER8_DATA_NSHORT, htons(0),
+                                MILTER8_DATA_STRING, client_addr,
+                                MILTER8_DATA_END);
+           break;
        default:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 skip_reply, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                skip_reply, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
+                                MILTER8_DATA_END);
+           break;
        }
+       if (ptr != 0)
+           myfree(ptr);
+       return (resp);
     default:
        msg_panic("%s: milter %s: bad state %d",
                  myname, milter->m.name, milter->state);
index 6369dd41578633f1f77718120f4e1c8096e5d697..639004f307edd15522364139eca1cc6dbcf76129 100644 (file)
@@ -17,8 +17,8 @@
 /*
 /*     Arguments:
 /* .IP fd
-/*     File descriptor in the range 0..FD_SETSIZE. Its value is logged
-/*     when verbose logging is turned on.
+/*     File descriptor whose value is logged when verbose logging
+/*     is turned on.
 /* .IP buf
 /*     Read buffer pointer. Not used.
 /* .IP buf_len
index 5b7b1e0f4edd1ad5bd192a676be1aa891d39c5a9..943e2ad9f1fa14842b60b36ab5e8f06445fee8bf 100644 (file)
@@ -17,8 +17,8 @@
 /*
 /*     Arguments:
 /* .IP fd
-/*     File descriptor in the range 0..FD_SETSIZE. Its value is logged
-/*     when verbose logging is turned on.
+/*     File descriptor whose value is logged when verbose logging
+/*     is turned on.
 /* .IP buf
 /*     Write buffer pointer. Not used.
 /* .IP buf_len