]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.0.17-20040119
authorWietse Venema <wietse@porcupine.org>
Mon, 19 Jan 2004 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:29:28 +0000 (06:29 +0000)
19 files changed:
postfix/HISTORY
postfix/README_FILES/LMTP_README
postfix/README_FILES/VIRTUAL_README [moved from postfix/README_FILES/VIRTUAL_MAILBOX_README with 100% similarity]
postfix/conf/postfix-files
postfix/conf/sample-smtpd.cf
postfix/html/anvil.8.html
postfix/html/rate.html
postfix/html/smtpd.8.html
postfix/man/man8/anvil.8
postfix/man/man8/smtpd.8
postfix/src/anvil/anvil.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/lmtp/lmtp_trouble.c
postfix/src/smtp/smtp_trouble.c
postfix/src/smtpd/smtpd.c
postfix/src/util/Makefile.in
postfix/src/util/htable.c
postfix/src/util/vstream.h

index 05b8a140376a9c51800bde6dea64c4d50dd75d3e..234dca77cb7cd2946741c13cb51c959e88a822d5 100644 (file)
@@ -8863,7 +8863,8 @@ Apologies for any names omitted.
 
        Robustness: save and restore the resolver _res.options
        settings before and after DNS lookup, to avoid surprises
-       in third-party code. File: dns/dns_lookup.c.
+       in third-party code. This may eliminate some "localhost
+       not found" problems. File: dns/dns_lookup.c.
 
 20031216
 
@@ -9017,7 +9018,11 @@ Apologies for any names omitted.
        Bickers.
 
        Change: queue minfree limit is now 1.5 * message size limit.
-       Files: smtpd/smtpd_check.c.
+       File: smtpd/smtpd_check.c.
+
+       Bugfix: apply hostname restriction even when host address
+       lookup fails in check_{sender,recipient}_{ns,mx}_access.
+       File: smtpd/smtpd_check.c.
 
 20040115
 
@@ -9026,9 +9031,6 @@ Apologies for any names omitted.
        report really serious trouble with the destination.  Files:
        *qmgr/qmgr_deliver.c.
 
-       Bugfix: report lost connection and timeout as a serious
-       destination problem. Files: [sl]mtp/[sl]mtp_trouble.c.
-
        Cleanup: in postfix-files, symbolic links and hard links
        are now first-class entries with explicit mention of
        source and destination pathnames. Files: postfix-install,
@@ -9036,16 +9038,20 @@ Apologies for any names omitted.
 
 20040116
 
-       Cleanup: sendmail -v caused one mail delivery reports upon
+       Cleanup: sendmail -v caused one mail delivery report upon
        every delivery attempt, not just the first one. The fix is
        to "kill" a queue file record after the first delivery
-       attempt. Files:  *qmgr/qmgr_active.c, *qmgr/qmgr_message.c,
-       global/rec_type.c.
+       attempt. This means a new record type. Files:  *qmgr/qmgr_active.c,
+       *qmgr/qmgr_message.c, global/rec_type.c.
 
-Open problems:
+       Cleanup: in anticipation of other built-in rate limiters,
+       the client_connection_rate_time_unit parameter is renamed
+       to client_rate_time_unit.
+
+       Documentation: finished the HOSTING_README file with an
+       overview of methods to host domains with Postfix.
 
-       Low: in the SMTP client, pass the session, request and
-       state structures as separate arguments.
+Open problems:
 
        High: when virtual aliasing is turned off after content
        filtering, local submissions may escape virtual aliasing.
index 26e922807a3038db980f7e200dca4027547204e5..4f511e9b7a3a1af72078bac0a0c622143727736b 100644 (file)
@@ -1,3 +1,7 @@
+This document describes mail delivery via LMTP including Cyrus.
+For an overview of all methods to host domains with Postfix, see
+the HOSTING_README file.
+
 1 - Postfix LMTP support
 ========================
 
index 80ee0a2ded791f3819ff5582afb931e100feced7..f9ec61dec1ee498db29140dd4388b3e640c6333c 100644 (file)
@@ -223,7 +223,6 @@ $readme_directory/SMTPD_PROXY_README:f:root:-:644
 $readme_directory/ULTRIX_README:f:root:-:644
 $readme_directory/UUCP_README:f:root:-:644
 $readme_directory/VERP_README:f:root:-:644
-$readme_directory/VIRTUAL_MAILBOX_README:f:root:-:644
-$readme_directory/VIRTUAL_README:f:root:-:644:o
+$readme_directory/VIRTUAL_README:f:root:-:644
 $readme_directory/XCLIENT_README:f:root:-:644
 $readme_directory/XFORWARD_README:f:root:-:644
index 5050bbbfa361c9e224d4ea5baf320d09aabba22a..9f46fbc4c320c59dd8489521bde263230bfca3be 100644 (file)
@@ -123,7 +123,7 @@ smtpd_client_connection_count_limit = 50
 # connection attempts any client is allowed to make to this service
 # per time unit.
 # 
-# The time unit is specified with the rate_limiter_time_unit
+# The time unit is specified with the client_rate_time_unit
 # configuration parameter, and defaults to one minute.
 # 
 # By default, every client can make as many connections as Postfix
index 341fc8685f9c8dccbf0a9a326136ce513f87c12f..43b1c110b35a4df5e9c7212abe5b6c2bb60e4fde 100644 (file)
@@ -86,7 +86,7 @@ ANVIL(8)                                                 ANVIL(8)
        to  this  program.  Use the <b>postfix reload</b> command after a
        configuration change.
 
-       <b>rate_limiter_time_unit</b>
+       <b>client_rate_time_unit</b>
               The unit of time over which  connection  rates  are
               calculated.
 
index 1f7c5cbd87ba4599d7534ccf6732f8e8bc7122fc..d69a9a5f139e146c8cecf8846d9762e21bd6ae82 100644 (file)
@@ -387,7 +387,7 @@ local or trusted clients are excluded.
 
 <p>
 
-<dt> <a name="rate_limiter_time_unit"> <b>rate_limiter_time_unit</b></a>
+<dt> <a name="client_rate_time_unit"> <b>client_rate_time_unit</b></a>
 (default: 60s) <dd> The time unit for computing the client connection
 and other rates.
 
index 9f9c6a8c9ab81c2ad85e6f62528ff1e710294d0d..9e5db190c21a4019433187540dd78761ad8bf7b5 100644 (file)
@@ -319,7 +319,7 @@ SMTPD(8)                                                 SMTPD(8)
 
        <b>smtpd_client_connection_rate_limit</b>
               The maximal number of  connections  per  unit  time
-              (specified  with  <b>rate_limiter_time_unit</b>)  that any
+              (specified  with  <b>client_rate_time_unit</b>)  that  any
               client is allowed to make to this service.  When  a
               client  exceeds  the  limit, the SMTP server logs a
               warning with the client name/address and  the  ser-
index 09e4a15aa9cb6c85f4e559efe3df99c629ef7f14..6130aa4152be3a8d6ce52521c4c1a76c9916060e 100644 (file)
@@ -109,7 +109,7 @@ are ignored.
 The following \fBmain.cf\fR parameters are especially relevant to
 this program. Use the \fBpostfix reload\fR command after
 a configuration change.
-.IP \fBrate_limiter_time_unit\fR
+.IP \fBclient_rate_time_unit\fR
 The unit of time over which connection rates are calculated.
 .IP \fBclient_connection_status_update_time\fR
 Time interval for logging the maximal connection count
index b87c802c5e0f8a6f8616fae25f3aec140d16d942..89583d3d36faf787fe71e770ff11639db338cc2b 100644 (file)
@@ -264,7 +264,7 @@ the limit, the SMTP server logs a warning with the client
 name/address and the service name as configured in master.cf.
 .IP \fBsmtpd_client_connection_rate_limit\fR
 The maximal number of connections per unit time (specified
-with \fBrate_limiter_time_unit\fR) that any client
+with \fBclient_rate_time_unit\fR) that any client
 is allowed to make to this service. When a client exceeds
 the limit, the SMTP server logs a warning with the client
 name/address and the service name as configured in master.cf.
index 548f90a9e62fb0e9621b2af7269b384af670a4e2..4b0581f6354e79ffde283adc3eeebce0abc4aefe 100644 (file)
@@ -93,7 +93,7 @@
 /*     The following \fBmain.cf\fR parameters are especially relevant to
 /*     this program. Use the \fBpostfix reload\fR command after
 /*     a configuration change.
-/* .IP \fBrate_limiter_time_unit\fR
+/* .IP \fBclient_rate_time_unit\fR
 /*     The unit of time over which connection rates are calculated.
 /* .IP \fBclient_connection_status_update_time\fR
 /*     Time interval for logging the maximal connection count
@@ -252,6 +252,11 @@ typedef struct {
        (local)->anvil_remote = (remote); \
     } while(0)
 
+/* Test if this remote site is listed for this local client. */
+
+#define ANVIL_LOCAL_REMOTE_LINKED(local, remote) \
+    ((local)->anvil_remote == (remote))
+
 /* Drop connection from local server. */
 
 #define ANVIL_LOCAL_DROP_ONE(local, remote) \
@@ -433,17 +438,16 @@ static void anvil_remote_disconnect(VSTREAM *client_stream, const char *ident)
                 (unsigned long) client_stream, ident);
 
     /*
-     * Look up the remote client.
+     * Update local and remote info if this remote site is listed for this
+     * local client.
      */
-    if ((anvil_remote =
-        (ANVIL_REMOTE *) htable_find(anvil_remote_map, ident)) != 0)
+    if ((anvil_local = (ANVIL_LOCAL *) vstream_context(client_stream)) != 0
+       && (anvil_remote =
+           (ANVIL_REMOTE *) htable_find(anvil_remote_map, ident)) != 0
+       && ANVIL_LOCAL_REMOTE_LINKED(anvil_local, anvil_remote)) {
        ANVIL_REMOTE_DROP_ONE(anvil_remote);
-
-    /*
-     * Update the local client information.
-     */
-    if ((anvil_local = (ANVIL_LOCAL *) vstream_context(client_stream)) != 0)
        ANVIL_LOCAL_DROP_ONE(anvil_local, anvil_remote);
+    }
     if (msg_verbose)
        msg_info("%s: anvil_local 0x%lx",
                 myname, (unsigned long) anvil_local);
index 3cd0b20cf318056270a709c32be819e0907ecd35..b9b4facb152ee505e1c52de4bf83b824f47e6d2f 100644 (file)
@@ -1953,7 +1953,7 @@ extern int var_smtpd_cconn_limit;
 #define DEF_SMTPD_HOGGERS              "$" VAR_MYNETWORKS
 extern char *var_smtpd_hoggers;
 
-#define VAR_ANVIL_TIME_UNIT            "rate_limiter_time_unit"
+#define VAR_ANVIL_TIME_UNIT            "client_rate_time_unit"
 #define DEF_ANVIL_TIME_UNIT            "60s"
 extern int var_anvil_time_unit;
 
index 6a494335f93b47822537dd980c714258469aac71..aa0a6e88c9d646660e2ef3ae12240b8dcf032322 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      "20040116"
+#define MAIL_RELEASE_DATE      "20040119"
+#define MAIL_VERSION_NUMBER    "2.0.17"
 
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "2.0.16-" MAIL_RELEASE_DATE
+#ifdef SNAPSHOT
+#define DEF_MAIL_VERSION       MAIL_VERSION_NUMBER "-" MAIL_RELEASE_DATE
+#else
+#define DEF_MAIL_VERSION       MAIL_VERSION_NUMBER
+#endif
 extern char *var_mail_version;
 
  /*
index b9d1ce5001c29413206adc54fd848056a6342cdf..84ce001e1700bdeb0b9e6c0a1ccfeef667300f62 100644 (file)
@@ -313,8 +313,6 @@ 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 dbada263ca66eb258ae3e605d4f7ddd9680da7d9..ea98fb54f71b680c63c5c0d44d0a308e0bc367ff 100644 (file)
@@ -402,9 +402,6 @@ 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 332c237e5d98c6d67c66c7bbbe56f48742afc83c..f1f8849216c43c7d970c6c85bc38f4cb74c2aa6e 100644 (file)
 /*     name/address and the service name as configured in master.cf.
 /* .IP \fBsmtpd_client_connection_rate_limit\fR
 /*     The maximal number of connections per unit time (specified
-/*     with \fBrate_limiter_time_unit\fR) that any client
+/*     with \fBclient_rate_time_unit\fR) that any client
 /*     is allowed to make to this service. When a client exceeds
 /*     the limit, the SMTP server logs a warning with the client
 /*     name/address and the service name as configured in master.cf.
index 439433c2574b36a53b9354da527265b8d7321db7..d88e59bb9601adf0571c452e50f964e57c736b3b 100644 (file)
@@ -92,7 +92,7 @@ TESTPROG= dict_open dup2_pass_on_exec events exec_command fifo_open \
        vstring vstring_vstream doze select_bug stream_test mac_expand \
        watchdog unescape hex_quote name_mask rand_sleep sane_time ctable \
        inet_addr_list attr_print64 attr_scan64 base64_code attr_print0 \
-       attr_scan0 host_port attr_scan_plain attr_print_plain
+       attr_scan0 host_port attr_scan_plain attr_print_plain htable
 
 LIB_DIR        = ../../lib
 INC_DIR        = ../../include
@@ -336,6 +336,11 @@ attr_print_plain: $(LIB)
        $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
        mv junk $@.o
 
+htable: $(LIB)
+       mv $@.o junk
+       $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
+       mv junk $@.o
+
 depend: $(MAKES)
        (sed '1,/^# do not edit/!d' Makefile.in; \
        set -e; for i in [a-z][a-z0-9]*.c; do \
@@ -350,7 +355,7 @@ stream_test: stream_test.c $(LIB)
 tests: valid_hostname_test mac_expand_test dict_test unescape_test \
        hex_quote_test ctable_test inet_addr_list_test base64_code_test \
        attr_scan64_test attr_scan0_test dict_pcre_test host_port_test \
-       dict_cidr_test attr_scan_plain_test
+       dict_cidr_test attr_scan_plain_test htable_test
 
 valid_hostname_test: valid_hostname valid_hostname.in valid_hostname.ref
        ./valid_hostname <valid_hostname.in 2>valid_hostname.tmp
@@ -431,6 +436,9 @@ attr_scan_plain_test: attr_print_plain attr_scan_plain attr_scan_plain.ref
        diff attr_scan_plain.ref attr_scan_plain.tmp
        rm -f attr_scan_plain.tmp
 
+htable_test: htable /usr/share/dict/words
+       ./htable < /usr/share/dict/words
+
 # do not edit below this line - it is generated by 'make depend'
 alldig.o: alldig.c
 alldig.o: sys_defs.h
index 923bdc200d6fffe28b9c09d64bc7c356c5c2f94c..c64a64b33d968655be73bc434055800c4aaea7c2 100644 (file)
@@ -331,3 +331,40 @@ HTABLE_INFO **htable_list(HTABLE *table)
     list[count] = 0;
     return (list);
 }
+
+#ifdef TEST
+#include <vstring_vstream.h>
+#include <myrand.h>
+
+int main(int unused_argc, char **unused_argv)
+{
+    VSTRING *buf = vstring_alloc(10);
+    int     count = 0;
+    HTABLE *hash;
+    HTABLE_INFO **ht_info;
+    HTABLE_INFO **ht;
+    HTABLE_INFO *info;
+    int     i;
+    int     r;
+
+    /*
+     * Load a large number of strings and delete them in a random order.
+     */
+    hash = htable_create(10);
+    while (vstring_get(buf, VSTREAM_IN) != VSTREAM_EOF)
+       htable_enter(hash, vstring_str(buf), (void *) count++);
+    ht_info = htable_list(hash);
+    for (i = 0; i < hash->used; i++) {
+       r = myrand() % hash->used;
+       info = ht_info[i];
+       ht_info[i] = ht_info[r];
+       ht_info[r] = info;
+    }
+    for (ht = ht_info; *ht; ht++)
+       htable_delete(hash, ht[0]->key, (void (*) (char *)) 0);
+    if (hash->used > 0)
+       msg_panic("%d entries not deleted", hash->used);
+    return (0);
+}
+
+#endif
index 322cd188e4b0c2c934ec2a272302c712b984834d..13f66e83624e1c8fa3270b96c1602dd51c8540d9 100644 (file)
@@ -18,6 +18,7 @@
 #include <fcntl.h>
 #include <stdarg.h>
 #include <setjmp.h>
+#include <unistd.h>
 
  /*
   * Utility library.