aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fetchmail.c16
-rw-r--r--fetchmail.h11
2 files changed, 18 insertions, 9 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 1a9671b3..98b4e1b5 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -1547,7 +1547,7 @@ static void dump_params (struct runctl *runp,
printf(_("Options for retrieving from %s@%s:\n"),
ctl->remotename, visbuf(ctl->server.pollname));
- if (ctl->server.via && (ctl->server.protocol < P_ETRN))
+ if (ctl->server.via && MAILBOX_PROTOCOL(ctl))
printf(_(" Mail will be retrieved via %s\n"), ctl->server.via);
if (ctl->server.interval)
@@ -1599,7 +1599,7 @@ static void dump_params (struct runctl *runp,
#endif /* INET6_ENABLE */
else if (outlevel >= O_VERBOSE)
printf(_(" (using default port)"));
- if (ctl->server.uidl && (ctl->server.protocol < P_ETRN))
+ if (ctl->server.uidl && MAILBOX_PROTOCOL(ctl))
printf(_(" (forcing UIDL use)"));
putchar('.');
putchar('\n');
@@ -1637,7 +1637,7 @@ static void dump_params (struct runctl *runp,
else
printf(".\n");
- if (ctl->server.protocol < P_ETRN) {
+ if (MAILBOX_PROTOCOL(ctl)) {
if (!ctl->mailboxes->id)
printf(_(" Default mailbox selected.\n"));
else
@@ -1704,7 +1704,7 @@ static void dump_params (struct runctl *runp,
printf(_(" SMTP message batch limit is %d.\n"), ctl->batchlimit);
else if (outlevel >= O_VERBOSE)
printf(_(" No SMTP message batch limit (--batchlimit 0).\n"));
- if (ctl->server.protocol < P_ETRN)
+ if (MAILBOX_PROTOCOL(ctl))
{
if (NUM_NONZERO(ctl->expunge))
printf(_(" Deletion interval between expunges forced to %d (--expunge %d).\n"), ctl->expunge, ctl->expunge);
@@ -1714,7 +1714,7 @@ static void dump_params (struct runctl *runp,
}
if (ctl->bsmtp)
printf(_(" Messages will be appended to %s as BSMTP\n"), visbuf(ctl->bsmtp));
- else if (ctl->mda && (ctl->server.protocol < P_ETRN))
+ else if (ctl->mda && MAILBOX_PROTOCOL(ctl))
printf(_(" Messages will be delivered with \"%s\".\n"), visbuf(ctl->mda));
else
{
@@ -1735,7 +1735,7 @@ static void dump_params (struct runctl *runp,
printf(_(" Address to be put in RCPT TO lines shipped to SMTP will be %s\n"),
ctl->smtpname);
}
- if (ctl->server.protocol < P_ETRN)
+ if (MAILBOX_PROTOCOL(ctl))
{
if (ctl->antispam != (struct idlist *)NULL)
{
@@ -1759,7 +1759,7 @@ static void dump_params (struct runctl *runp,
visbuf(ctl->postconnect));
else if (outlevel >= O_VERBOSE)
printf(_(" No post-connection command.\n"));
- if (ctl->server.protocol < P_ETRN) {
+ if (MAILBOX_PROTOCOL(ctl)) {
if (!ctl->localnames)
printf(_(" No localnames declared for this host.\n"));
else
@@ -1856,7 +1856,7 @@ static void dump_params (struct runctl *runp,
else if (outlevel >= O_VERBOSE)
printf(_(" No plugout command specified.\n"));
- if (ctl->server.protocol > P_POP2 && (ctl->server.protocol < P_ETRN))
+ if (ctl->server.protocol > P_POP2 && MAILBOX_PROTOCOL(ctl))
{
if (!ctl->oldsaved)
printf(_(" No UIDs saved from this host.\n"));
diff --git a/fetchmail.h b/fetchmail.h
index 1bbf7db3..e78e2121 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -15,6 +15,15 @@
#define P_ETRN 7
#define P_ODMR 8
+/*
+ * We need to distinguish between mailbox and mailbag protocols.
+ * Under a mailbox protocol wwe're pulling mail for a speecific user
+ * and the transaction must be authenticated. Under a mailbag protocol
+ * we're fetching mail for an entire domain; the client and server
+ * authenticate to each other but no per-user authentication is needed.
+ */
+#define MAILBOX_PROTOCOL(ctl) ((ctl)->server.protocol < P_ETRN)
+
#if INET6_ENABLE
#define SMTP_PORT "smtp"
#define KPOP_PORT "kpop"
@@ -37,7 +46,7 @@
#define A_SSH 5 /* authentication at session level */
/* some protocols (KERBEROS, GSSAPI, SSH) don't require a password */
-#define NO_PASSWORD(ctl) ((ctl)->server.authenticate > A_PASSWORD || (ctl)->server.protocol >= P_ETRN)
+#define NO_PASSWORD(ctl) ((ctl)->server.authenticate > A_PASSWORD || !MAILBOX_PROTOCOL(ctl))
/*
* Definitions for buffer sizes. We get little help on setting maxima