diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-06-24 14:17:11 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-06-24 14:17:11 +0000 |
commit | 6006dd080700778ae0e7cefc4e56b5e800e8db1e (patch) | |
tree | 7907374655c39329c0c5da71a89afb857f9ceffd /odmr.c | |
parent | e7ec487d41279380def7df865214ae19c5e18399 (diff) | |
download | fetchmail-6006dd080700778ae0e7cefc4e56b5e800e8db1e.tar.gz fetchmail-6006dd080700778ae0e7cefc4e56b5e800e8db1e.tar.bz2 fetchmail-6006dd080700778ae0e7cefc4e56b5e800e8db1e.zip |
First round of ODMR fixes.
svn path=/trunk/; revision=3372
Diffstat (limited to 'odmr.c')
-rw-r--r-- | odmr.c | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -65,7 +65,7 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id, *bytes = *countp = *newp = -1; /* authenticate via CRAM-MD5 */ - ok = do_cram_md5(sock, "AUTH", ctl); + ok = do_cram_md5(sock, "AUTH", ctl, "334 "); if (ok) return(ok); @@ -130,7 +130,14 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id, * use select(2) to watch the read sides of both sockets and just * throw their data at each other. */ - smtp_sock = SockOpen(ctl->smtphost, SMTP_PORT, NULL, NULL); + /* + * FIXME: we hardcode "localhost" here because ODMR is fighting + * over the ETRN meaning of smtphost and the POP/IMAP meaning. + * ODMR needs both meanings, but there is only one config var. So + * for now ODMR always uses the "localhost" SMTP server to connect + * with locally. + */ + smtp_sock = SockOpen("localhost", SMTP_PORT, NULL, NULL); if (smtp_sock == -1) return(PS_SOCKET); else @@ -180,6 +187,12 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id, return(0); } +static int odmr_logout(int sock, struct query *ctl) +/* send logout command */ +{ + return(gen_transact(sock, "QUIT")); +} + const static struct method odmr = { "ODMR", /* ODMR protocol */ @@ -201,7 +214,7 @@ const static struct method odmr = NULL, /* no way to fetch body */ NULL, /* no message trailer */ NULL, /* how to delete a message */ - NULL, /* log out, we're done */ + odmr_logout, /* log out, we're done */ FALSE, /* no, we can't re-poll */ }; |