aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
...
* Fix Debian bug #230615, making PID file format FHS 2.3 compliant.Matthias Andree2005-07-232-31/+42
* Add a comment.Matthias Andree2005-07-231-0/+6
* Snapshot 6.2.6-pre7.Matthias Andree2005-07-227-70/+70
* If UIDL parser fails, barf with PS_ERROR rather than ignoring the problem.Matthias Andree2005-07-221-2/+3
* Bump version.Matthias Andree2005-07-222-2/+2
* Blank skipping in UIDL code would count spaces from the wrong string.Matthias Andree2005-07-221-1/+2
* Snapshot 6.2.6-pre6.Matthias Andree2005-07-228-71/+71
* Revise.Matthias Andree2005-07-221-24/+54
* Fix NULL dereference when Message-ID or actual UID are missing from input.Matthias Andree2005-07-221-8/+18
* Tag ESR's changes.Matthias Andree2005-07-221-11/+11
* Snapshot line numbers.Matthias Andree2005-07-2112-4029/+4840
* Add security announcement.Matthias Andree2005-07-212-1/+93
* Add CVE name.Matthias Andree2005-07-211-1/+1
* Use sizeof rather than macro to communicate buffer size to fgets.Matthias Andree2005-07-201-1/+1
* strncpy -> strlcpy. Mark 'bogus message count\!' message translatable.Matthias Andree2005-07-201-5/+4
* Don't read more data from ifname than fits in the result buffer.Matthias Andree2005-07-201-3/+3pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * etrn.c -- ETRN protocol methods (see RFC 1985)
 *
 * For license terms, see the file COPYING in this directory.
 */

#include  "config.h"
#ifdef ETRN_ENABLE
#include  <stdio.h>
#include  <stdlib.h>
#include  <assert.h>
#ifdef HAVE_NET_SOCKET_H /* BeOS needs this */
#include <net/socket.h>
#endif
#include  <netdb.h>
#include  <errno.h>
#include  <unistd.h>
#include  "i18n.h"
#include  "fetchmail.h"
#include  "smtp.h"
#include  "socket.h"

static int etrn_ok (int sock, char *argbuf)
/* parse command response */
{
    int ok;

    ok = SMTP_ok(sock);
    if (ok == SM_UNRECOVERABLE)
	return(PS_PROTOCOL);
    else
	return(ok);
}

6-18/+6
* Kill trailing space.Matthias Andree2005-07-181-52/+52
* Run through unexpand to align TAB.Matthias Andree2005-07-181-84/+84
* Make tracepolls a server option, as documented. Fixes Debian bug #156094.Matthias Andree2005-07-187-13/+17
* Update.Matthias Andree2005-07-121-16/+16
* Update.Matthias Andree2005-07-111-311/+356
* Fix minor inaccuracies and update.Matthias Andree2005-07-111-23/+22
* Mention Hannes Beinert's contribution.Matthias Andree2005-07-111-1/+2
* Update licenses.Matthias Andree2005-07-111-2/+19
* Add (C) Copyright and LicenseMatthias Andree2005-07-111-0/+2
* Revise %files section, moving fetchmailconf manual page where it belongs,Matthias Andree2005-07-111-28/+43
* Drop one-liner.Matthias Andree2005-07-111-1/+0
ass="p">); return(PS_PROTOCOL); } /* make sure we don't enter the fetch loop */ *bytes = *countp = *newp = -1; /* * By default, the hostlist has a single entry, the fetchmail host's * canonical DNS name. */ for (qnp = ctl->domainlist; qnp; qnp = qnp->next) { /* ship the actual poll and get the response */ gen_send(sock, "ETRN %s", (char *)qnp->id); if ((ok = gen_recv(sock, buf, sizeof(buf)))) return(ok); /* this switch includes all response codes described in RFC1985 */ switch(atoi(buf)) { case 250: /* OK, queuing for node <x> started */ 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) 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) report(stdout, GT_("Pending messages for %s started\n"), qnp->id); break; case 458: /* Unable to queue messages for node <x> */ report(stderr, GT_("Unable to queue messages for node %s\n"),qnp->id); return(PS_PROTOCOL); case 459: /* Node <x> not allowed: <reason> */ report(stderr, GT_("Node %s not allowed: %s\n"), qnp->id, buf); return(PS_AUTHFAIL); case 500: /* Syntax Error */ report(stderr, GT_("ETRN syntax error\n")); return(PS_PROTOCOL); case 501: /* Syntax Error in Parameters */ report(stderr, GT_("ETRN syntax error in parameters\n")); return(PS_PROTOCOL); default: report(stderr, GT_("Unknown ETRN error %d\n"), atoi(buf)); return(PS_PROTOCOL); } } return(0); } static int etrn_logout(int sock, struct query *ctl) /* send logout command */ { return(gen_transact(sock, "QUIT")); } static const struct method etrn = { "ETRN", /* ESMTP ETRN extension */ #ifdef 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 */ etrn_logout, /* log out, we're done */ FALSE, /* no, we can't re-poll */ }; int doETRN (struct query *ctl) /* retrieve messages using ETRN */ { int status; if (ctl->keep) { fprintf(stderr, GT_("Option --keep is not supported with ETRN\n")); return(PS_SYNTAX); } if (ctl->flush) { fprintf(stderr, GT_("Option --flush is not supported with ETRN\n")); return(PS_SYNTAX); } if (ctl->mailboxes->id) { fprintf(stderr, GT_("Option --remote is not supported with ETRN\n")); return(PS_SYNTAX); } if (check_only) { fprintf(stderr, GT_("Option --check is not supported with ETRN\n")); return(PS_SYNTAX); } peek_capable = FALSE; status = do_protocol(ctl, &etrn); if (status == PS_NOMAIL) status = PS_SUCCESS; return(status); } #endif /* ETRN_ENABLE */ /* etrn.c ends here */