]> Pileus Git - ~andy/fetchmail/blobdiff - etrn.c
Minor bug fixes for socket.c
[~andy/fetchmail] / etrn.c
diff --git a/etrn.c b/etrn.c
index 8912513e5135e15de1ff17670d8badcc2d7d9fef..ac416c86c3bed7eeb7246c268f7f259c12d04f67 100644 (file)
--- a/etrn.c
+++ b/etrn.c
@@ -25,7 +25,8 @@ static int etrn_ok (int sock, char *argbuf)
 {
     int ok;
 
-    ok = SMTP_ok(sock);
+    (void)argbuf;
+    ok = SMTP_ok(sock, SMTP_MODE, TIMEOUT_DEFAULT);
     if (ok == SM_UNRECOVERABLE)
        return(PS_PROTOCOL);
     else
@@ -40,7 +41,10 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id,
     char buf [MSGBUFSIZE+1];
     struct idlist *qnp;                /* pointer to Q names */
 
-    if ((ok = SMTP_ehlo(sock, fetchmailhost, &opts)))
+    (void)id;
+    if ((ok = SMTP_ehlo(sock, SMTP_MODE, fetchmailhost,
+                       ctl->server.esmtp_name, ctl->server.esmtp_password,
+                       &opts)))
     {
        report(stderr, GT_("%s's SMTP listener does not support ESMTP\n"),
              ctl->server.pollname);
@@ -71,18 +75,18 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id,
        switch(atoi(buf))
        {
        case 250:       /* OK, queuing for node <x> started */
-           if (outlevel >= O_SILENT)
+           if (outlevel > O_SILENT)
                report(stdout, GT_("Queuing for %s started\n"), qnp->id);
            break;
 
        case 251:       /* OK, no messages waiting for node <x> */
-           if (outlevel >= O_SILENT)
+           if (outlevel > O_SILENT)
                report(stdout, GT_("No messages waiting for %s\n"), qnp->id);
            return(PS_NOMAIL);
 
        case 252:       /* OK, pending messages for node <x> started */
        case 253:       /* OK, <n> pending messages for node <x> started */
-           if (outlevel >= O_SILENT)
+           if (outlevel > O_SILENT)
                report(stdout, GT_("Pending messages for %s started\n"), qnp->id);
            break;
 
@@ -114,30 +118,29 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id,
 static int etrn_logout(int sock, struct query *ctl)
 /* send logout command */
 {
+    (void)ctl;
     return(gen_transact(sock, "QUIT"));
 }
 
-const static struct method etrn =
+static const struct method etrn =
 {
     "ETRN",            /* ESMTP ETRN extension */
-#if INET6_ENABLE
     "smtp",            /* standard SMTP port */
     "smtps",           /* ssl SMTP port */
-#else /* INET6_ENABLE */
-    25,                        /* standard SMTP port */
-    465,                       /* ssl SMTP port */
-#endif /* INET6_ENABLE */
     FALSE,             /* this is not a tagged protocol */
     FALSE,             /* this does not use a message delimiter */
     etrn_ok,           /* parse command response */
     NULL,              /* no need to get authentication */
     etrn_getrange,     /* initialize message sending */
     NULL,              /* we cannot get a list of sizes */
+    NULL,              /* we cannot get a list of sizes of subsets */
     NULL,              /* how do we tell a message is old? */
     NULL,              /* no way to fetch headers */
     NULL,              /* no way to fetch body */
     NULL,              /* no message trailer */
     NULL,              /* how to delete a message */
+    NULL,              /* how to mark a message as seen */
+    NULL,              /* no mailbox support */
     etrn_logout,       /* log out, we're done */
     FALSE,             /* no, we can't re-poll */
 };
@@ -156,7 +159,7 @@ int doETRN (struct query *ctl)
        return(PS_SYNTAX);
     }
     if (ctl->mailboxes->id) {
-       fprintf(stderr, GT_("Option --remote is not supported with ETRN\n"));
+       fprintf(stderr, GT_("Option --folder is not supported with ETRN\n"));
        return(PS_SYNTAX);
     }
     if (check_only) {