From: Wietse Venema Date: Sat, 20 Jan 2001 05:00:00 +0000 (-0500) Subject: postfix-20010120 X-Git-Tag: v20010228~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a9a598cfe52bfaa99cc7ac54c65be288ed5f8ab;p=thirdparty%2Fpostfix.git postfix-20010120 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index e73524456..c0068c88d 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -4734,3 +4734,11 @@ Apologies for any names omitted. Feature: SASL support for the LMTP client. Recent CYRUS software requires this for Postfix over TCP sockets. This was just a cloning operation. + +20010120 + + Bugfix: the 20001005 revised fallback_relay support caused + Postfix to send mail to the fallback even when the local + machine was an MX host for the final destination. Result: + mailer loop. Found by Laurent Wacrenier (teaser.fr). Files: + smtp/smtp_connect.c, smtp/smtp_addr.c. diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 559e89ac4..93a5bf9cd 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -888,7 +888,7 @@ extern int var_fork_delay; * When locking a mailbox, how often to try and how long to wait. */ #define VAR_FLOCK_TRIES "deliver_lock_attempts" -#define DEF_FLOCK_TRIES 5 +#define DEF_FLOCK_TRIES 10 extern int var_flock_tries; #define VAR_FLOCK_DELAY "deliver_lock_delay" diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index d70bbe20c..f9a7fcd35 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Release-20010119" +#define DEF_MAIL_VERSION "Release-20010120" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/smtp/smtp.h b/postfix/src/smtp/smtp.h index 6643944e7..8c6dd5b06 100644 --- a/postfix/src/smtp/smtp.h +++ b/postfix/src/smtp/smtp.h @@ -85,7 +85,7 @@ extern void smtp_session_free(SMTP_SESSION *); */ extern SMTP_SESSION *smtp_connect(char *, VSTRING *); extern SMTP_SESSION *smtp_connect_host(char *, unsigned, VSTRING *); -extern SMTP_SESSION *smtp_connect_domain(char *, unsigned, VSTRING *); +extern SMTP_SESSION *smtp_connect_domain(char *, unsigned, VSTRING *, int *); /* * smtp_proto.c diff --git a/postfix/src/smtp/smtp_addr.c b/postfix/src/smtp/smtp_addr.c index 75272dde7..7c06a8e5a 100644 --- a/postfix/src/smtp/smtp_addr.c +++ b/postfix/src/smtp/smtp_addr.c @@ -6,9 +6,10 @@ /* SYNOPSIS /* #include "smtp_addr.h" /* -/* DNS_RR *smtp_domain_addr(name, why) +/* DNS_RR *smtp_domain_addr(name, why, found_myself) /* char *name; /* VSTRING *why; +/* int *found_myself; /* /* DNS_RR *smtp_host_addr(name, why) /* char *name; @@ -279,11 +280,11 @@ static int smtp_compare_mx(DNS_RR *a, DNS_RR *b) /* smtp_domain_addr - mail exchanger address lookup */ -DNS_RR *smtp_domain_addr(char *name, VSTRING *why) +DNS_RR *smtp_domain_addr(char *name, VSTRING *why, int *found_myself) { DNS_RR *mx_names; DNS_RR *addr_list = 0; - DNS_RR *self; + DNS_RR *self = 0; unsigned best_pref; unsigned best_found; @@ -363,6 +364,7 @@ DNS_RR *smtp_domain_addr(char *name, VSTRING *why) /* * Clean up. */ + *found_myself = (self != 0); return (addr_list); } diff --git a/postfix/src/smtp/smtp_addr.h b/postfix/src/smtp/smtp_addr.h index d0dabba49..1e7621c9f 100644 --- a/postfix/src/smtp/smtp_addr.h +++ b/postfix/src/smtp/smtp_addr.h @@ -17,7 +17,7 @@ * Internal interfaces. */ extern DNS_RR *smtp_host_addr(char *, VSTRING *); -extern DNS_RR *smtp_domain_addr(char *, VSTRING *); +extern DNS_RR *smtp_domain_addr(char *, VSTRING *, int *); /* LICENSE /* .ad diff --git a/postfix/src/smtp/smtp_connect.c b/postfix/src/smtp/smtp_connect.c index d8017f230..6b9c58f6e 100644 --- a/postfix/src/smtp/smtp_connect.c +++ b/postfix/src/smtp/smtp_connect.c @@ -292,7 +292,8 @@ SMTP_SESSION *smtp_connect_host(char *host, unsigned port, VSTRING *why) /* smtp_connect_domain - connect to smtp server for domain */ -SMTP_SESSION *smtp_connect_domain(char *name, unsigned port, VSTRING *why) +SMTP_SESSION *smtp_connect_domain(char *name, unsigned port, VSTRING *why, + int *found_myself) { SMTP_SESSION *session = 0; DNS_RR *addr_list; @@ -306,7 +307,7 @@ SMTP_SESSION *smtp_connect_domain(char *name, unsigned port, VSTRING *why) * the primary MX host is reachable but does not want to receive our * mail, there is no point in trying the backup hosts. */ - addr_list = smtp_domain_addr(name, why); + addr_list = smtp_domain_addr(name, why, found_myself); for (addr = addr_list; addr; addr = addr->next) { if ((session = smtp_connect_addr(addr, port, why)) != 0) { session->best = (addr->pref == addr_list->pref); @@ -393,6 +394,7 @@ SMTP_SESSION *smtp_connect(char *destination, VSTRING *why) char *save; char *dest; char *cp; + int found_myself; /* * First try to deliver to the indicated destination, then try to deliver @@ -417,7 +419,7 @@ SMTP_SESSION *smtp_connect(char *destination, VSTRING *why) if (var_disable_dns || *dest == '[') { session = smtp_connect_host(host, port, why); } else { - session = smtp_connect_domain(host, port, why); + session = smtp_connect_domain(host, port, why, &found_myself); } myfree(dest_buf); @@ -426,7 +428,7 @@ SMTP_SESSION *smtp_connect(char *destination, VSTRING *why) * is the best MX relay for the destination. Agreed, an errno of OK * after failure is a weird way to reporting progress. */ - if (session != 0 || smtp_errno == SMTP_OK) + if (session != 0 || smtp_errno == SMTP_OK || found_myself) break; }