Bug#295546: exim4: auth_hack_outlook4 option
Piotr Roszatycki
Piotr Roszatycki <Piotr_Roszatycki@netia.net.pl>, 295546@bugs.debian.org
Wed, 16 Feb 2005 17:10:49 +0100
--Boundary-00=_JC3ECu+nNFNeKLx
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
tags 295546 patch
thanks
I've forgotten to attach the patch. Here it is.
--
.''`. Piotr Roszatycki, Netia SA
: :' : mailto:Piotr_Roszatycki@netia.net.pl
`. `' mailto:dexter@debian.org
`-
--Boundary-00=_JC3ECu+nNFNeKLx
Content-Type: application/x-shellscript;
name="45_auth_hack_outlook4.dpatch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="45_auth_hack_outlook4.dpatch"
#! /bin/sh -e
## 45_auth_hack_outlook4.dpatch by Piotr Roszatycki
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: If the auth_hack_outlook4 option is set to true, exim duplicate
## DP: AUTH in the EHLO reply and Outlook 4 can work with exim AUTH.
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
@DPATCH@
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)='=';
+ }
+ }
}
}
--Boundary-00=_JC3ECu+nNFNeKLx--