Subject: Postfix 19991231 Patch 02 (Urgent)

From: [email-masked] (Wietse Venema)
Date: Tue, 4 Jan 2000 08:42:25 -0500 (EST)

A case sensitivity bug had slipped through in the anti-relaying
code, causing mail for [email-masked] to be rejected with
"relay access denied". This was found by Jim Maenpaa.

This defect also present in 199911* and 199912* code snapshots.
It is not present in any 19990906 official release.

The patch below fixes Postfix-19991231-pl01. A fully-patched version
is being made available via the usual FTP servers, primary site:

    ftp://ftp.porcupine.org/mirrors/postfix-release/official/
    http://ftp.porcupine.org/mirrors/postfix-release/

Sorry for the inconvenience, but this needs to be fixed ASAP.

	Wietse

Prereq: "Postfix-19991231-pl01"
diff -cr /tmp/postfix-19991231-pl01/global/mail_version.h ./global/mail_version.h
*** /tmp/postfix-19991231-pl01/global/mail_version.h	Sun Jan  2 12:38:15 2000
--- ./global/mail_version.h	Tue Jan  4 08:12:42 2000
***************
*** 15,21 ****
    * Version of this program.
    */
  #define VAR_MAIL_VERSION	"mail_version"
! #define DEF_MAIL_VERSION	"Postfix-19991231-pl01"
  extern char *var_mail_version;
  
  /* LICENSE
--- 15,21 ----
    * Version of this program.
    */
  #define VAR_MAIL_VERSION	"mail_version"
! #define DEF_MAIL_VERSION	"Postfix-19991231-pl02"
  extern char *var_mail_version;
  
  /* LICENSE
diff -cr /tmp/postfix-19991231-pl01/HISTORY ./HISTORY
*** /tmp/postfix-19991231-pl01/HISTORY	Sun Jan  2 17:11:48 2000
--- ./HISTORY	Tue Jan  4 08:30:35 2000
***************
*** 3527,3529 ****
--- 3527,3536 ----
  	for virtual users.  The SMTP server now explicitly tests
  	for this common error and logs a warning instead of refusing
  	the mail.  File:  smtpd/smtpd_check.c.
+ 
+ 20000103
+ 
+ 	Bugfix: a case sensitivity bug had slipped through in the
+ 	anti-relaying code, causing mail for [email-masked]
+ 	to be rejected with "relay access denied". This was found
+ 	by Jim Maenpaa @ jmm.com.
diff -cr /tmp/postfix-19991231-pl01/smtpd/smtpd_check.c ./smtpd/smtpd_check.c
*** /tmp/postfix-19991231-pl01/smtpd/smtpd_check.c	Sun Jan  2 16:52:43 2000
--- ./smtpd/smtpd_check.c	Tue Jan  4 08:11:52 2000
***************
*** 811,816 ****
--- 811,817 ----
       */
      canon_addr_internal(query, recipient);
      resolve_clnt_query(STR(query), &reply);
+     lowercase(STR(reply.recipient));
  
      /*
       * Handle special case that is not supposed to happen.
***************
*** 947,952 ****
--- 948,954 ----
       */
      canon_addr_internal(query, recipient);
      resolve_clnt_query(STR(query), &reply);
+     lowercase(STR(reply.recipient));
  
      /*
       * If the destination is local, it is acceptable, because we are
***************
*** 1088,1093 ****
--- 1090,1096 ----
       */
      canon_addr_internal(query, addr);
      resolve_clnt_query(STR(query), &reply);
+     lowercase(STR(reply.recipient));
  
      /*
       * Skip local destinations and non-DNS forms.
***************
*** 1369,1374 ****
--- 1372,1378 ----
       */
      canon_addr_internal(query, addr);
      resolve_clnt_query(STR(query), &reply);
+     lowercase(STR(reply.recipient));
  
      /*
       * Garbage in, garbage out. Every address from canon_addr_internal() and
***************
*** 1929,1934 ****
--- 1933,1939 ----
       */
      canon_addr_internal(query, recipient);
      resolve_clnt_query(STR(query), &reply);
+     lowercase(STR(reply.recipient));
  
      /*
       * Skip non-DNS forms. Skip non-local numerical forms.