aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS7
-rw-r--r--driver.c2
-rw-r--r--fetchmail.c15
-rw-r--r--fetchmail.h1
-rw-r--r--fetchmail.man14
-rw-r--r--rcfile_l.l1
-rw-r--r--rcfile_y.y3
-rw-r--r--sample.rcfile1
8 files changed, 36 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index c551482f..666ac904 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
Release Notes:
------------------------------------------------------------------------------
-fetchmail-2.2 (Fri Dec 6 18:45:42 EST 1996):
+fetchmail-2.2 (Sun Dec 8 23:17:01 EST 1996):
features --
@@ -9,6 +9,11 @@ features --
address is excluded by the local sendmail's spam filter. Drop the mail.
(This is the only circumstance in which mail is thrown away.)
+* The header your mailserver uses to convey envelope addresses is no longer
+ wired to `X-Envelope-Header'. You can now specify it with the `envelope'
+ option in .fetchmailrc. (This header is not RFC822 standard, and we have a
+ report of and ISP using X-Frontier-To).
+
bugs --
* Fixed a startup-time core dump introduced by 2.1's aka-list feature.
diff --git a/driver.c b/driver.c
index 40851052..8d673078 100644
--- a/driver.c
+++ b/driver.c
@@ -382,7 +382,7 @@ struct query *ctl; /* query control record */
tohdr = bufp;
else if (!strncasecmp("Apparently-To:", bufp, 14))
envto = bufp;
- else if (!strncasecmp("X-Envelope-To:", bufp, 14))
+ else if (!strncasecmp(ctl->envelope, bufp, 14))
envto = bufp;
else if (!strncasecmp("Cc:", bufp, 3))
cchdr = bufp;
diff --git a/fetchmail.c b/fetchmail.c
index 9d64f963..617090e0 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -565,6 +565,10 @@ static int load_params(int argc, char **argv, int optind)
ctl->lead_server = ctl;
no_new_server:;
+ /* plug in the semi-standard way of indicating a mail address */
+ if (ctl->envelope == (char *)NULL)
+ ctl->envelope = "X-Envelope-To:";
+
/* sanity checks */
if (ctl->port < 0)
{
@@ -605,7 +609,7 @@ static int load_params(int argc, char **argv, int optind)
initialize_saved_lists(querylist, idfile);
/* if cmd_batchlimit was explicitly set, use it to override batchlimit */
- if (cmd_batchlimit > -1)
+ if (cmd_batchlimit > -1)
batchlimit = cmd_batchlimit;
/* if cmd_logfile was explicitly set, use it to override logfile */
@@ -787,12 +791,15 @@ void dump_params (struct query *ctl)
{
for (idp = ctl->localnames; idp; idp = idp->next)
if (idp->val.id2)
- fprintf(stderr, "\t%s -> %s\n", idp->id, idp->val.id2);
+ printf("\t%s -> %s\n", idp->id, idp->val.id2);
else
- fprintf(stderr, "\t%s\n", idp->id);
+ printf("\t%s\n", idp->id);
if (ctl->wildcard)
- fputs("*\n", stderr);
+ fputs("*\n", stdout);
}
+
+ if (count > 1)
+ printf(" Envelope header is assumed to be: %s\n", ctl->envelope);
}
if (ctl->protocol > P_POP2)
diff --git a/fetchmail.h b/fetchmail.h
index 8c68e1a0..13b9791f 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -68,6 +68,7 @@ struct query
int port;
int authenticate;
int timeout;
+ char *envelope;
int skip;
/* per-user data */
diff --git a/fetchmail.man b/fetchmail.man
index 0326624d..c98676d4 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -441,6 +441,7 @@ Legal server options are:
port
authenticate (or auth)
timeout
+ envelope
aka
Legal user options are
@@ -462,7 +463,7 @@ Legal user options are
norewrite
.PP
All options correspond to the obvious command-line arguments except
-four: `aka', `is', `to', and `password'.
+four: `aka', `is', `to', `password', and `envelope'.
.PP
The `aka' option is for use with multidrop mailboxes. It allows you
to pre-declare a list of DNS aliases for a server. This is an
@@ -472,6 +473,12 @@ while processing a multidrop mailbox, grovels through message headers
looking for names of the mailserver, pre-declaring common ones can
save it from having to do DNS lookups.
.PP
+The `envelope' option changes the header
+.I fetchmail
+assumes will carry a copy of the mail's envelope address. Normally
+this is `X-Envelope-To' but as this header is not standard practice
+varies. See the discussion of multidrop address handling below.
+.PP
The `is' or `to' keywords associate the following local (client)
name(s) (or server-name to client-name mappings separated by =) with
the mailserver user name in the entry. If an is/to list has `*' as
@@ -690,6 +697,11 @@ and the item of mail had just one recipient, the MTA will have written
a `for' clause that gives the envelope addressee into its Received
header. But this doesn't work for other MTAs, nor if there is more
than one recipient.
+.PP
+Alternatively, some SMTP listeners and/or mail servers insert a header
+in each message containing a copy of the envelope addresses. This
+header (when it exists) is often `X-Envelope-To'. Fetchmail's
+assumption about this can be changed with the `envelope' option.
.SH EXIT CODES
To facilitate the use of
.I fetchmail
diff --git a/rcfile_l.l b/rcfile_l.l
index a48b97d8..27b7d5d1 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -32,6 +32,7 @@ port { return PORT; }
auth(enticate)? { return AUTHENTICATE; }
kerberos { return KERBEROS; }
timeout { return TIMEOUT;}
+envelope { return ENVELOPE; }
user(name)? { return USERNAME; }
pass(word)? { return PASSWORD; }
diff --git a/rcfile_y.y b/rcfile_y.y
index 725a7587..ed9e9223 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -42,7 +42,7 @@ static void prc_reset();
}
%token DEFAULTS POLL SKIP AKA PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS
-%token USERNAME PASSWORD FOLDER SMTPHOST MDA LIMIT
+%token ENVELOPE USERNAME PASSWORD FOLDER SMTPHOST MDA LIMIT
%token IS HERE THERE TO MAP WILDCARD
%token SET BATCHLIMIT LOGFILE
%token <proto> PROTO
@@ -107,6 +107,7 @@ serv_option : AKA alias_list
| AUTHENTICATE PASSWORD {current.authenticate = A_PASSWORD;}
| AUTHENTICATE KERBEROS {current.authenticate = A_KERBEROS;}
| TIMEOUT NUMBER {current.timeout = $2;}
+ | ENVELOPE STRING {current.envelope = xstrdup($2);}
;
/*
diff --git a/sample.rcfile b/sample.rcfile
index 58711c77..a56632fa 100644
--- a/sample.rcfile
+++ b/sample.rcfile
@@ -25,6 +25,7 @@
# port -- must be followed by a TCP/IP port number
# authenticate (or auth) -- must be followed by an authentication type
# timeout -- must be followed by a numeric timeout value
+# envelope -- must be followed by an envelope header name
# aka -- must be followed by one or more server aliases
#
# username (or user) -- must be followed by a name