[exim] auth_hack_outlook4 for Exim4

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Piotr Roszatycki
Datum:  
To: exim-users@exim.org
Betreff: [exim] auth_hack_outlook4 for Exim4
I've tried to convince the Debian maintainer to include this patch to the
Debian package. Unfortunately, he wants to be close to the upstream
source. AFAIK, Philip Hazel rejected this patch for some anti-Microsoft
reasons.

As far as we are living on the real world, I've attached the patch which
has been posted some time ago and adapted for the latest Exim source.
I belive it will be useful.

See http://bugs.debian.org/295546

-- 
.''`.    Piotr Roszatycki, Netia SA
: :' :    mailto:Piotr_Roszatycki@netia.net.pl
`. `'     mailto:dexter@debian.org
   `-
diff -ru exim-4.44.orig/src/globals.c exim-4.44/src/globals.c
--- exim-4.44.orig/src/globals.c    2005-01-11 14:43:27 +0100
+++ exim-4.44/src/globals.c    2005-02-16 16:44:37 +0100
@@ -281,6 +281,7 @@
 BOOL    allow_unqualified_recipient = TRUE;    /* For local messages */
 BOOL    allow_unqualified_sender = TRUE;       /* Reset for SMTP */
 BOOL    allow_utf8_domains     = FALSE;
+BOOL    auth_hack_outlook4     = FALSE;
 uschar *authenticated_id       = NULL;
 uschar *authenticated_sender   = NULL;
 BOOL    authentication_failed  = FALSE;
diff -ru exim-4.44.orig/src/globals.h exim-4.44/src/globals.h
--- exim-4.44.orig/src/globals.h    2005-01-11 14:43:27 +0100
+++ exim-4.44/src/globals.h    2005-02-16 16:44:37 +0100
@@ -130,6 +130,7 @@
 extern BOOL    allow_unqualified_recipient; /* As it says */
 extern BOOL    allow_unqualified_sender; /* Ditto */
 extern BOOL    allow_utf8_domains;     /* For experimenting */
+extern BOOL    auth_hack_outlook4;     /* If FALSE, advertise only when needed */
 extern uschar *authenticated_id;       /* ID that was authenticated */
 extern uschar *authenticated_sender;   /* From AUTH on MAIL */
 extern BOOL    authentication_failed;  /* TRUE if AUTH was tried and failed */
diff -ru exim-4.44.orig/src/readconf.c exim-4.44/src/readconf.c
--- exim-4.44.orig/src/readconf.c    2005-01-11 13:54:54 +0100
+++ exim-4.44/src/readconf.c    2005-02-16 16:45:12 +0100
@@ -153,6 +153,7 @@
   { "allow_mx_to_ip",           opt_bool,        &allow_mx_to_ip },
   { "allow_utf8_domains",       opt_bool,        &allow_utf8_domains },
   { "auth_advertise_hosts",     opt_stringptr,   &auth_advertise_hosts },
+  { "auth_hack_outlook4",       opt_bool,        &auth_hack_outlook4 },
   { "auto_thaw",                opt_time,        &auto_thaw },
   { "bi_command",               opt_stringptr,   &bi_command },
   { "bounce_message_file",      opt_stringptr,   &bounce_message_file },
diff -ru exim-4.44.orig/src/smtp_in.c exim-4.44/src/smtp_in.c
--- exim-4.44.orig/src/smtp_in.c    2005-01-11 14:30:55 +0100
+++ exim-4.44/src/smtp_in.c    2005-02-16 16:44:37 +0100
@@ -2470,7 +2470,9 @@
         if (verify_check_host(&auth_advertise_hosts) == OK)
           {
           auth_instance *au;
+          int s_auth;
           BOOL first = TRUE;
+          s_auth=ptr;
           for (au = auths; au != NULL; au = au->next)
             {
             if (au->server && (au->advertise_condition == NULL ||
@@ -2493,7 +2495,15 @@
               }
             else au->advertised = FALSE;
             }
-          if (!first) s = string_cat(s, &size, &ptr, US"\r\n", 2);
+          if (!first) 
+            {
+            s = string_cat(s, &size, &ptr, US"\r\n", 2);
+            if (auth_hack_outlook4) 
+              {
+              s = string_cat(s, &size, &ptr, s+s_auth,ptr-s_auth);
+              *(s+s_auth+8)='=';
+              }
+            }
           }
         }