]> Pileus Git - ~andy/fetchmail/commitdiff
OTP fix patches from Stanislav Brabec.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 18 Oct 2002 10:20:44 +0000 (10:20 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 18 Oct 2002 10:20:44 +0000 (10:20 -0000)
svn path=/trunk/; revision=3735

NEWS
conf.c
fetchmail-FAQ.html
fetchmailconf
options.c
pop3.c
rcfile_l.l

diff --git a/NEWS b/NEWS
index a78a250f3732369181d8a9dceba0b160fd5a6583..7e08050034e27e59dd51c9c8a7b5b6f7dbfbe4bd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@
 
 (The `lines' figures total .c, .h, .l, and .y files under version control.)
 
+* OTP fix patches from Stanislav Brabec <utx@penguin.cz>
+
 fetchmail-6.1.0 (Sun Sep 22 18:31:23 EDT 2002), 21999 lines:
 
 * Updated French translation.
diff --git a/conf.c b/conf.c
index 089bb93a060c5694fd487ed5339889dcf7a7095f..4681523fcea7e4f4c7588aaa681305a53bd2ceb6 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -294,6 +294,8 @@ void dump_config(struct runctl *runp, struct query *querylist)
                stringdump("auth", "kerberos_v5");
            else if (ctl->server.authenticate == A_SSH)
                stringdump("auth", "ssh");
+           else if (ctl->server.authenticate == A_OTP)
+               stringdump("auth", "otp");
 
 #if defined(HAVE_GETHOSTBYNAME) && defined(HAVE_RES_SEARCH)
            booldump("dns", ctl->server.dns);
index 844f95aa9d9d6b0e2c22780c2d5b87876b3d6856..0bdea96c12b125ee3df8974702908566d5c3732b 100644 (file)
@@ -16,7 +16,7 @@ content="Frequently asked questions about fetchmail."/>
 Page</a></td>
 <td width="30%" align="center">To <a href="/~esr/sitemap.html">Site
 Map</a></td>
-<td width="30%" align="right">$Date: 2002/09/17 09:15:33 $</td>
+<td width="30%" align="right">$Date: 2002/10/18 10:20:44 $</td>
 </tr>
 </table>
 
@@ -2993,21 +2993,34 @@ this has the side effect of forcing RETR use.</p>
 <h2><a id="X6" name="X6">X6. My mail attachments are being dropped
 or mangled.</a></h2>
 
-<p>This isn't fetchmail's doing -- fetchmail never drops lines in
-message bodies or attachments. It may be your POP server, or it may
-be the sender's mail user agent (or a bad combination of both).</p>
+<p>Fetchmail doesn't discard attachments; fetchmail doesn't have any idea
+that attachments are there.  Fetchmail treats the body of each message as
+an uninterpreted byte stream and passes it through without alteration.
+If you are not receiving attachments through fetchmail, it is because 
+your mailserver is not sending them to you.</p>
 
-<p>The Mail Max POP3 server and the InterChange and Imail IMAP
-servers are known to simply drop MIME attachments when uploading
-messages. We've had sporadic reports of problems with Microsoft
-Exchange and Outlook servers. Windows- and NT-based POP servers
+<p>The fix for this is to replace your mailserver with one that works.
+If its operating system makes this difficult, you should replace its
+operating system with one that works. Windows- and NT-based POP servers
 seem especially prone to mangle attachments. If you are running one
 of these, replacing your server with a Unix machine is probably the
 only effective solution.</p>
 
+<p>We've had sporadic reports of problems with Microsoft Exchange and 
+Outlook servers.  These sometimes randomly fail to ship 
+attachments to your client.  They may also mangle the attachments 
+they do pass through.  If you see unreadable attachments with a
+ContentType of "application/x-tnef", you're having this problem.
+The <a href="http://world.std.com/~damned/software.html">TNEF</a>
+utility may help.</p>
+
+<p>The Mail Max POP3 server and the InterChange and Imail IMAP
+servers are known to simply drop MIME attachments when uploading
+messages.</p>
+
 <p>We've also had a report that Lotus Notes sometimes trashes the
 MIME type of messages. In particular, it seems to modify MIME
-headers introducing type application/pdf, mangling the type to
+headers of type application/pdf, mangling the type to
 application/octet-stream. It may corrupt other MIME types as
 well.</p>
 
@@ -3023,12 +3036,6 @@ the MIME parts in the body. This doesn't work. (I have heard a
 rumor that this bug is scheduled to be fixed in Domino release 6;
 you can find a workaround at contrib/domino.)</p>
 
-<p>Another rich source of attachment problems is Microsoft Exchange
-and Microsoft Outlook. If you see unreadable attachments with a
-ContentType of "application/x-tnef", you're having this problem.
-The <a href="http://world.std.com/~damned/software.html">TNEF</a>
-utility may help.</p>
-
 <p>Rob Funk explains: Unfortunately there also remain many mail
 user agents that don't write correct MIME messages. One big
 offender is Sun MailTool attachments, which are formatted enough
@@ -3419,7 +3426,7 @@ the received date from the last Received header.</p>
 Page</a></td>
 <td width="30%" align="center">To <a href="/~esr/sitemap.html">Site
 Map</a></td>
-<td width="30%" align="right">$Date: 2002/09/17 09:15:33 $</td>
+<td width="30%" align="right">$Date: 2002/10/18 10:20:44 $</td>
 </tr>
 </table>
 
index 2afe5b33076bffbb30edab3e21ec6cc2da3749ff..4ce4a319bb12bc0f537a4fe3b4a17a1ba38de85a 100755 (executable)
@@ -414,7 +414,7 @@ defaultports = {"auto":0,
                "ETRN":25,
                "ODMR":366}
 
-authlist = ("any", "password", "gssapi", "kerberos", "ssh")
+authlist = ("any", "password", "gssapi", "kerberos", "ssh", "otp")
 
 listboxhelp = {
     'title' : 'List Selection Help',
index 188db02c525ee22a28ded0f3dfc75d2d81545fd2..bd4ebe7040a036fb8b5358a50599ef06467bd95f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -409,6 +409,8 @@ struct query *ctl;  /* option record to be initialized */
                ctl->server.authenticate = A_SSH;
            else if (strcmp(optarg, "otp") == 0)
                ctl->server.authenticate = A_OTP;
+           else if (strcmp(optarg, "opie") == 0)
+               ctl->server.authenticate = A_OTP;
            else if (strcmp(optarg, "ntlm") == 0)
                ctl->server.authenticate = A_NTLM;
            else if (strcmp(optarg, "cram") == 0)
@@ -677,7 +679,7 @@ struct query *ctl;  /* option record to be initialized */
        P(GT_("  -p, --protocol    specify retrieval protocol (see man page)\n"));
        P(GT_("  -U, --uidl        force the use of UIDLs (pop3 only)\n"));
        P(GT_("  -P, --port        TCP/IP service port to connect to\n"));
-       P(GT_("      --auth        authentication type (password/kerberos/ssh)\n"));
+       P(GT_("      --auth        authentication type (password/kerberos/ssh/otp)\n"));
        P(GT_("  -t, --timeout     server nonresponse timeout\n"));
        P(GT_("  -E, --envelope    envelope address header\n"));
        P(GT_("  -Q, --qvirtual    prefix to remove from local user id\n"));
diff --git a/pop3.c b/pop3.c
index 76d6c437b99228785977a290e52bad44adba109e..e9ffbbaa22685dd60d3a4bd0873ac5103e5bc250 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -318,6 +318,32 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
 
        /* ordinary validation, no one-time password or RPA */ 
        gen_transact(sock, "USER %s", ctl->remotename);
+
+#if OPIE_ENABLE
+       /* see RFC1938: A One-Time Password System */
+       if (challenge = strstr(lastok, "otp-")) {
+         char response[OPIE_RESPONSE_MAX+1];
+         int i;
+
+         i = opiegenerator(challenge, !strcmp(ctl->password, "opie") ? "" : ctl->password, response);
+         if ((i == -2) && !run.poll_interval) {
+           char secret[OPIE_SECRET_MAX+1];
+           fprintf(stderr, GT_("Secret pass phrase: "));
+           if (opiereadpass(secret, sizeof(secret), 0))
+             i = opiegenerator(challenge,  secret, response);
+           memset(secret, 0, sizeof(secret));
+         };
+
+         if (i) {
+           ok = PS_ERROR;
+           break;
+         };
+
+         ok = gen_transact(sock, "PASS %s", response);
+         break;
+       }
+#endif /* OPIE_ENABLE */
+
        strcpy(shroud, ctl->password);
        ok = gen_transact(sock, "PASS %s", ctl->password);
        shroud[0] = '\0';
index 60788b701f570a5522216862aef1ea8ed80b5f8b..bf5379a2953deef9373879066aab1a742cd47785 100644 (file)
@@ -92,6 +92,7 @@ kerberos(_v)?4        { SETSTATE(0); yylval.proto = A_KERBEROS_V4; return AUTHTYPE;}
 kerberos(_v)?5 { SETSTATE(0); yylval.proto = A_KERBEROS_V5; return AUTHTYPE;}
 kerberos       { SETSTATE(0); yylval.proto = A_KERBEROS_V4; return AUTHTYPE;}
 ssh            { SETSTATE(0); yylval.proto = A_SSH; return AUTHTYPE;}
+(otp|opie)     { SETSTATE(0); yylval.proto = A_OTP; return AUTHTYPE;}
 cram(-md5)?    { SETSTATE(0); yylval.proto = A_CRAM_MD5; return AUTHTYPE;}
 ntlm           { SETSTATE(0); yylval.proto = A_NTLM; return AUTHTYPE;}
 <AUTH>password { SETSTATE(0); yylval.proto = A_PASSWORD; return AUTHTYPE;}