Commit e85820ea authored by Eric S. Raymond's avatar Eric S. Raymond

Added the `envelope' option.

svn path=/trunk/; revision=615
parent 0ad6312e
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.
......
......@@ -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;
......
......@@ -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)
......
......@@ -68,6 +68,7 @@ struct query
int port;
int authenticate;
int timeout;
char *envelope;
int skip;
/* per-user data */
......
......@@ -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
......
......@@ -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; }
......
......@@ -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);}
;
/*
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment