3 Aug 2007 07:04
smtp plain authentication
I was surprised to find that mailx doesn't support smtp plain authentication. The mail server I need to connect to only supports plain auth (of course, over a secure channel.) I tried to find a patch, but a Google search came up empty. So I wrote a small patch to add it. It is attached. Cheers, -Joe
--- mailx-12.3/smtp.c.orig 2007-01-12 09:40:25.000000000 -0800
+++ mailx-12.3/smtp.c 2007-08-02 21:40:42.109150972 -0700
<at> <at> -258,11 +258,13 <at> <at>
char *b = NULL, o[LINESIZE];
size_t blen, bsize = 0, count;
char *b64, *authstr, *cp;
- enum { AUTH_NONE, AUTH_LOGIN, AUTH_CRAM_MD5 } auth;
+ enum { AUTH_NONE, AUTH_PLAIN, AUTH_LOGIN, AUTH_CRAM_MD5 } auth;
int inhdr = 1, inbcc = 0;
if ((authstr = smtp_auth_var("", skinned)) == NULL)
auth = user && password ? AUTH_LOGIN : AUTH_NONE;
+ else if (strcmp(authstr, "plain") == 0)
+ auth = AUTH_PLAIN;
else if (strcmp(authstr, "login") == 0)
auth = AUTH_LOGIN;
else if (strcmp(authstr, "cram-md5") == 0)
<at> <at> -322,6 +324,16 <at> <at>
SMTP_OUT(o);
SMTP_ANSWER(2);
break;
(Continue reading)
RSS Feed