From: Wietse Venema Date: Mon, 19 Jan 2004 05:00:00 +0000 (-0500) Subject: postfix-2.0.17-20040119 X-Git-Tag: v2.1-RC1-20040331~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1a3901dbf6639c8d85de4b0ea507d28b8dfe884;p=thirdparty%2Fpostfix.git postfix-2.0.17-20040119 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 05b8a1403..234dca77c 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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. diff --git a/postfix/README_FILES/LMTP_README b/postfix/README_FILES/LMTP_README index 26e922807..4f511e9b7 100644 --- a/postfix/README_FILES/LMTP_README +++ b/postfix/README_FILES/LMTP_README @@ -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 ======================== diff --git a/postfix/README_FILES/VIRTUAL_MAILBOX_README b/postfix/README_FILES/VIRTUAL_README similarity index 100% rename from postfix/README_FILES/VIRTUAL_MAILBOX_README rename to postfix/README_FILES/VIRTUAL_README diff --git a/postfix/conf/postfix-files b/postfix/conf/postfix-files index 80ee0a2de..f9ec61dec 100644 --- a/postfix/conf/postfix-files +++ b/postfix/conf/postfix-files @@ -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 diff --git a/postfix/conf/sample-smtpd.cf b/postfix/conf/sample-smtpd.cf index 5050bbbfa..9f46fbc4c 100644 --- a/postfix/conf/sample-smtpd.cf +++ b/postfix/conf/sample-smtpd.cf @@ -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 diff --git a/postfix/html/anvil.8.html b/postfix/html/anvil.8.html index 341fc8685..43b1c110b 100644 --- a/postfix/html/anvil.8.html +++ b/postfix/html/anvil.8.html @@ -86,7 +86,7 @@ ANVIL(8) ANVIL(8) to this program. Use the postfix reload command after a configuration change. - rate_limiter_time_unit + client_rate_time_unit The unit of time over which connection rates are calculated. diff --git a/postfix/html/rate.html b/postfix/html/rate.html index 1f7c5cbd8..d69a9a5f1 100644 --- a/postfix/html/rate.html +++ b/postfix/html/rate.html @@ -387,7 +387,7 @@ local or trusted clients are excluded.

-

rate_limiter_time_unit +
client_rate_time_unit (default: 60s)
The time unit for computing the client connection and other rates. diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html index 9f9c6a8c9..9e5db190c 100644 --- a/postfix/html/smtpd.8.html +++ b/postfix/html/smtpd.8.html @@ -319,7 +319,7 @@ SMTPD(8) SMTPD(8) smtpd_client_connection_rate_limit The maximal number of connections per unit time - (specified with rate_limiter_time_unit) that any + (specified with client_rate_time_unit) 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- diff --git a/postfix/man/man8/anvil.8 b/postfix/man/man8/anvil.8 index 09e4a15aa..6130aa415 100644 --- a/postfix/man/man8/anvil.8 +++ b/postfix/man/man8/anvil.8 @@ -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 diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8 index b87c802c5..89583d3d3 100644 --- a/postfix/man/man8/smtpd.8 +++ b/postfix/man/man8/smtpd.8 @@ -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. diff --git a/postfix/src/anvil/anvil.c b/postfix/src/anvil/anvil.c index 548f90a9e..4b0581f63 100644 --- a/postfix/src/anvil/anvil.c +++ b/postfix/src/anvil/anvil.c @@ -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); diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 3cd0b20cf..b9b4facb1 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -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; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 6a494335f..aa0a6e88c 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,10 +20,15 @@ * 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; /* diff --git a/postfix/src/lmtp/lmtp_trouble.c b/postfix/src/lmtp/lmtp_trouble.c index b9d1ce500..84ce001e1 100644 --- a/postfix/src/lmtp/lmtp_trouble.c +++ b/postfix/src/lmtp/lmtp_trouble.c @@ -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. diff --git a/postfix/src/smtp/smtp_trouble.c b/postfix/src/smtp/smtp_trouble.c index dbada263c..ea98fb54f 100644 --- a/postfix/src/smtp/smtp_trouble.c +++ b/postfix/src/smtp/smtp_trouble.c @@ -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)); } /* diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 332c237e5..f1f884921 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -250,7 +250,7 @@ /* 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. diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index 439433c25..d88e59bb9 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -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.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 diff --git a/postfix/src/util/htable.c b/postfix/src/util/htable.c index 923bdc200..c64a64b33 100644 --- a/postfix/src/util/htable.c +++ b/postfix/src/util/htable.c @@ -331,3 +331,40 @@ HTABLE_INFO **htable_list(HTABLE *table) list[count] = 0; return (list); } + +#ifdef TEST +#include +#include + +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 diff --git a/postfix/src/util/vstream.h b/postfix/src/util/vstream.h index 322cd188e..13f66e836 100644 --- a/postfix/src/util/vstream.h +++ b/postfix/src/util/vstream.h @@ -18,6 +18,7 @@ #include #include #include +#include /* * Utility library.