fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]ODMR fixes

2001-06-24 12:19:21
Matt Armstrong <matt(_at_)lickey(_dot_)com>:
I was able to get ODMR working with www.mailkeep.com (with their
mail.mailkeep.com server).  As far as I can tell, this is the only
publicly available ODMR server on the entire Internet!  The site looks
shaky (help links lead to 404 errors, etc.), but the SMTP/ODMR stuff
seems to be working.

There are three bugs in the ODMR support.  Two are fairly trivial, one
requires some design before a good fix can be had (I just did a quick
hack).

All patches against 5.8.8.  I'd love it if they were committed!

I took the ideas, but implemented them in a different way, 
 
First Bug:

    The ODMR code calls into the CRAM code.  Currently the CRAM code
    calls the base64 code without stripping protocol specific prefixes
    from the initial base64 challenge.  Since ODMR is CRAM-MD5 over
    SMTP, the challenge looks different -- it is a 334 SMTP response.
    This patch changes the base64 stuff to understand the SMTP
    response.  The right fix is to strip protocol stuff out before
    sending it to base64, but I am following a precident here:


--- base64.c.orig       Sat Mar  3 21:25:21 2001
+++ base64.c    Fri Jun 22 23:09:05 2001
@@ -60,6 +60,8 @@

     if (in[0] == '+' && in[1] == ' ')
        in += 2;
+    if (strncmp(in, "334 ", 4) == 0)
+       in += 4;
     if (*in == '\r')
        return(0);

I put in a better fix.  The do_cram_md5() function now takes an argument
specifying a prefix to be stripped off the response if present.  In odmr.c 
the prefix is "334 ".

Second Bug:

    odmr.c is missing a logout function, which was leading to seg
    faults.  I copied the one from ETRN.  (Included in patch below.)

Taken.
 
    I think he wrong move was probably overloading the meaning of
    smtphost for ETRN in the first place.  What we need is a
    "fetchdomain" parameter that is used in ETRN and ODMR, which
    leaves smtphost free for ODMR's use.

You're right, and I have done exactly this.  The smtphost option is
now interpreted in odmr.c by a call to the same smtp_open() function used
to initialize listener delivery in POP3 and IMAP modes.  This should mean
that fetchmail can now be used as an ODMR relay to any SMTP listener and
even to LMTP.

Please test these changes when 5.8.9 comes out.  It would be nice to 
know that ODMR is working in the 5.9.0 stable release.
-- 
                <a href="http://www.tuxedo.org/~esr/";>Eric S. Raymond</a>

As the Founding Fathers knew well, a government that does not trust its honest,
law-abiding, taxpaying citizens with the means of self-defense is not itself
worthy of trust. Laws disarming honest citizens proclaim that the government
is the master, not the servant, of the people.
        -- Jeff Snyder


<Prev in Thread] Current Thread [Next in Thread>