aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2005-09-20 00:20:47 +0000
committerMatthias Andree <matthias.andree@gmx.de>2005-09-20 00:20:47 +0000
commiteaf2ce1dd214a1d8716179a25036427096c7c24e (patch)
tree14928c74afea277889f959aafc33deacc416a3de /pop3.c
parentde9c2733a448bdcd64917a82e42513e8f3ab6ac5 (diff)
downloadfetchmail-eaf2ce1dd214a1d8716179a25036427096c7c24e.tar.gz
fetchmail-eaf2ce1dd214a1d8716179a25036427096c7c24e.tar.bz2
fetchmail-eaf2ce1dd214a1d8716179a25036427096c7c24e.zip
Fix "auth ntlm" to send AUTH NTLM (rather than AUTH MSN). Add "auth msn".
svn path=/trunk/; revision=4297
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/pop3.c b/pop3.c
index 13f51409..171c9c3e 100644
--- a/pop3.c
+++ b/pop3.c
@@ -69,12 +69,13 @@ static tSmbNtlmAuthResponse response;
* Much source (ntlm.h, smb*.c smb*.h) was borrowed from Samba.
*/
-static int do_pop3_ntlm(int sock, struct query *ctl)
+static int do_pop3_ntlm(int sock, struct query *ctl,
+ int msn_instead /** if true, send AUTH MSN, else send AUTH NTLM */)
{
char msgbuf[2048];
int result,len;
- gen_send(sock, "AUTH MSN");
+ gen_send(sock, msn_instead ? "AUTH MSN" : "AUTH NTLM");
if ((result = gen_recv(sock, msgbuf, sizeof msgbuf)))
return result;
@@ -318,25 +319,20 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
if (!(ctl->server.sdps) && MULTIDROP(ctl) && strstr(greeting, "demon."))
ctl->server.sdps = TRUE;
#endif /* SDPS_ENABLE */
+
#ifdef NTLM_ENABLE
- /* MSN servers require the use of NTLM (MSN) authentication */
- if (!strcasecmp(ctl->server.pollname, "pop3.email.msn.com") ||
- ctl->server.authenticate == A_NTLM)
- {
- if (!do_pop3_ntlm(sock, ctl))
- {
- return(PS_SUCCESS);
- }
- else
- {
- return(PS_AUTHFAIL);
- }
- }
+ /* MSN servers require the use of NTLM (MSN) authentication */
+ if (!strcasecmp(ctl->server.pollname, "pop3.email.msn.com") ||
+ ctl->server.authenticate == A_MSN)
+ return (do_pop3_ntlm(sock, ctl, 1) == 0) ? PS_SUCCESS : PS_AUTHFAIL;
+ if (ctl->server.authenticate == A_NTLM)
+ return (do_pop3_ntlm(sock, ctl, 0) == 0) ? PS_SUCCESS : PS_AUTHFAIL;
#endif
switch (ctl->server.protocol) {
case P_POP3:
#ifdef RPA_ENABLE
+ /* XXX FIXME: AUTH probing (RFC1734) should become global */
/* CompuServe POP3 Servers as of 990730 want AUTH first for RPA */
if (strstr(ctl->remotename, "@compuserve.com"))
{