aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS7
-rw-r--r--design-notes.html6
-rw-r--r--driver.c4
-rw-r--r--fetchmail.c13
-rw-r--r--fetchmail.h1
-rw-r--r--fetchmail.man45
-rwxr-xr-xfetchmailconf17
-rw-r--r--options.c64
-rw-r--r--rcfile_l.l1
-rw-r--r--rcfile_y.y8
-rw-r--r--sample.rcfile1
11 files changed, 108 insertions, 59 deletions
diff --git a/NEWS b/NEWS
index 37fc4f21..ea00e3d2 100644
--- a/NEWS
+++ b/NEWS
@@ -2,14 +2,15 @@
* Add an "ident" per-user option for debugging that produces an
"X-Fetchmail-ID" header in fetched messages for debugging.
-* -U/--userdefault option to specify postmaster overriding USER.
* Can the initial gethostname() be eliminated?
Release Notes:
------------------------------------------------------------------------------
fetchmail-4.5.3 ():
-* Minor fixes to the GSSAPI code. Seems to work with stock UW IMAP now!
+* Minor fixes to the GSSAPI code. Seems to work with stock UW IMAP now!
+* Fetchmail running as root now sends misaddressed multidrop mail to
+ `postmaster', not root. Added `postmaster' option to allow override.
There are 267 people on fetchmail-friends and 249 on fetchmail-announce.
@@ -23,7 +24,7 @@ There are 270 people on fetchmail-friends and 245 on fetchmail-announce.
fetchmail-4.5.1 (Wed Jul 1 19:27:56 EDT 1998):
* Checkalias option from Enrico Musio <enrico.musio@spaziozerouno.it>.
-* Discard Unix From_ lines in headers (copes with Debian bug report #23808.
+* Discard Unix From_ lines in headers (copes with Debian bug report #23808).
* Tell fetchmailconf not to care if the attempt to create an icon window fails.
* All fetchmailconf windows now iconify with an image.
* obituary@freshmeat's enhancements to hook fetchmail into the Red Hat
diff --git a/design-notes.html b/design-notes.html
index c856511c..d01833b1 100644
--- a/design-notes.html
+++ b/design-notes.html
@@ -10,7 +10,7 @@
<table width="100%" cellpadding=0><tr>
<td width="30%">Back to <a href="index.html">Fetchmail Home Page</a>
<td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a>
-<td width="30%" align=right>$Date: 1998/07/01 23:29:16 $
+<td width="30%" align=right>$Date: 1998/07/20 06:19:12 $
</table>
<HR>
<H1 ALIGN=CENTER>Design Notes On Fetchmail</H1>
@@ -336,6 +336,8 @@ following minimum steps.
<LI>Add the new token and a brief description to the header comment of
sample.rcfile.
+<LI>Hack fetchmailconf to configure it. Bump the fetchmailconf version.
+
<LI>Add an entry to NEWS.
</UL>
@@ -477,7 +479,7 @@ all shaped the design in one way or another.<P>
<table width="100%" cellpadding=0><tr>
<td width="30%">Back to <a href="index.html">Fetchmail Home Page</a>
<td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a>
-<td width="30%" align=right>$Date: 1998/07/01 23:29:16 $
+<td width="30%" align=right>$Date: 1998/07/20 06:19:12 $
</table>
<P><ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com">&lt;esr@snark.thyrsus.com&gt;</A></ADDRESS>
diff --git a/driver.c b/driver.c
index c045393b..b4a66194 100644
--- a/driver.c
+++ b/driver.c
@@ -976,11 +976,11 @@ int num; /* index of message */
if (!accept_count)
{
no_local_matches = TRUE;
- save_str(&xmit_names, user, XMIT_ACCEPT);
+ save_str(&xmit_names, run.postmaster, XMIT_ACCEPT);
if (outlevel == O_VERBOSE)
error(0, 0,
"no local matches, forwarding to %s",
- user);
+ run.postmaster);
}
}
else /* it's a single-drop box, use first localname */
diff --git a/fetchmail.c b/fetchmail.c
index b91e4765..41a34567 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -987,6 +987,16 @@ static int load_params(int argc, char **argv, int optind)
initialize_saved_lists(querylist, run.idfile);
#endif /* POP3_ENABLE */
+ /*
+ * If the user didn't set a last-resort user to get misaddressed
+ * multidrop mail, set an appropriate default here.
+ */
+ if (!run.postmaster)
+ if (getuid()) /* ordinary user */
+ run.postmaster = user;
+ else /* root */
+ run.postmaster = "postmaster";
+
return(implicitmode);
}
@@ -1146,6 +1156,9 @@ void dump_params (struct runctl *runp, struct query *querylist, flag implicit)
#endif
if (runp->invisible)
printf("Fetchmail will masquerade and will not generate Received\n");
+ if (runp->postmaster)
+ printf("Fetchmail will forward misaddressed multidrop messages to %s.",
+ runp->postmaster);
for (ctl = querylist; ctl; ctl = ctl->next)
{
diff --git a/fetchmail.h b/fetchmail.h
index a1f27b54..cfb729a7 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -96,6 +96,7 @@ struct runctl
int poll_interval;
flag use_syslog;
flag invisible;
+ char *postmaster;
};
struct idlist
diff --git a/fetchmail.man b/fetchmail.man
index 1831b040..ed24bdc9 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -657,17 +657,6 @@ or
option was used.
.PP
The
-.B --invisible
-option (keyword: set invisible) tries to make fetchmail invisible.
-Normally, fetchmail behaves like any other MTA would -- it generates a
-Received header into each message describing its place in the chain of
-transmission, and tells the MTA it forwards to that the mail came from
-the machine fetchmail itself is running on. If the invisible option
-is on, the Received header is suppressed and fetchmail tries to spoof
-the MTA it forwards to into thinking it came directly from the
-mailserver host.
-.PP
-The
.B \-N
or --nodetach option suppresses backgrounding and detachment of the
daemon process from its control terminal. This is primarily useful
@@ -683,6 +672,27 @@ locally due to some transient error, it will be re-fetched during the
next poll cycle. (The IMAP logic doesn't delete messages until
they're delivered, so this problem does not arise.)
+.SH ADMINISTRATIVE OPTIONS
+.PP
+The
+.B --postmaster
+option (keyword: set postmaster) specifies the last-resort username to
+which multidrop mail is to be forwarded if no matching local recipient
+can be found. Normally this is just the user who invoked fetchmail.
+If the invoking user is root, then the default of this option is
+the user `postmaster'.
+.PP
+The
+.B --invisible
+option (keyword: set invisible) tries to make fetchmail invisible.
+Normally, fetchmail behaves like any other MTA would -- it generates a
+Received header into each message describing its place in the chain of
+transmission, and tells the MTA it forwards to that the mail came from
+the machine fetchmail itself is running on. If the invisible option
+is on, the Received header is suppressed and fetchmail tries to spoof
+the MTA it forwards to into thinking it came directly from the
+mailserver host.
+
.SH RETRIEVAL FAILURE MODES
The protocols \fIfetchmail\fR uses to talk to mailservers are next to
bulletproof. In normal operation forwarding to port 25, no message is
@@ -1059,11 +1069,14 @@ headers of retrieved mail (this is `multidrop mode'). It looks for
addresses with hostname parts that match your poll name or your `via',
`aka' or `localdomains' options, and usually also for hostname parts
which DNS tells it are aliases of the mailserver. See the discussion
-of `dns', `checkalias', `localdomains', and `aka' for details on how matching
-addresses are handled. If \fIfetchmail\fR cannot match any mailserver
-usernames or localdomain addresses, the default recipient is the
+of `dns', `checkalias', `localdomains', and `aka' for details on how
+matching addresses are handled.
+.PP
+If \fIfetchmail\fR cannot match any mailserver usernames or
+localdomain addresses, the default recipient is the value of the
+`postmaster' global option if that has been set; otherwise it's the
calling user (as set by the USER or LOGNAME variable in the
-environment; you could use this to redirect to an alias like postmaster).
+environment).
.PP
The `dns' option (normally on) controls the way addresses from
multidrop mailboxes are checked. On, it enables logic to check each
@@ -1536,7 +1549,7 @@ run failed while trying to do an SMTP port open or transaction.
.IP 11
Fatal DNS error. Fetchmail encountered an error while performing
a DNS lookup at startup and could not proceed.
-.IP 11
+.IP 12
Internal error. You should see a message on standard error with
details.
.PP
diff --git a/fetchmailconf b/fetchmailconf
index 6d23a4aa..50eddd42 100755
--- a/fetchmailconf
+++ b/fetchmailconf
@@ -7,7 +7,7 @@
#
# TO DO: Arrange for save and quit buttons to clean up all frames dependent
# on the current ones.
-version = "1.0"
+version = "1.1"
from Tkinter import *
from Dialog import *
@@ -22,6 +22,7 @@ class Configuration:
self.syslog = FALSE # Use syslogd for logging?
self.logfile = None # No logfile, initially
self.idfile = os.environ["HOME"] + "/.fetchids" # Default idfile, initially
+ self.postmaster = None # No last-resort address, initially
self.invisible = FALSE # Suppress Received line & spoof?
self.servers = [] # List of included sites
Configuration.typemap = (
@@ -29,6 +30,7 @@ class Configuration:
('syslog', 'Boolean'),
('logfile', 'String'),
('idfile', 'String'),
+ ('postmaster', 'String'),
('invisible', 'Boolean'))
def __repr__(self):
@@ -39,6 +41,8 @@ class Configuration:
str = str + ("set logfile \"%s\"\n" % (self.logfile,));
if self.idfile != ConfigurationDefaults.idfile:
str = str + ("set idfile \"%s\"\n" % (self.idfile,));
+ if self.postmaster != ConfigurationDefaults.postmaster:
+ str = str + ("set postmaster \"%s\"\n" % (self.postmaster,));
if self.poll_interval > 0:
str = str + "set daemon " + `self.poll_interval` + "\n"
for site in self.servers:
@@ -544,7 +548,13 @@ Idfile
If empty, store seen-message IDs in .fetchids under user's home
directory. If nonempty, use given file name.
-Invisible:
+Postmaster
+ Who to send multidrop mail to as a last resort if no address can
+ be matched. Normally empty; in this case, fetchmail treats the
+ invoking user as the address of last resort unless that user is
+ root. If that user is root, fetchmail sends to `postmaster'.
+
+Invisible
If false (the default) fetchmail generates a Received line into
each message and generates a HELO from the machine it is running on.
If true, fetchmail generates no Received line and HELOs as if it were
@@ -618,6 +628,9 @@ class ConfigurationEdit(Frame, MyWidget):
# Set the idfile
log = LabeledEntry(gf, ' Idfile:', self.idfile, '14')
log.pack(side=RIGHT, anchor=E)
+ # Set the postmaster
+ log = LabeledEntry(gf, ' Postmaster:', self.postmaster, '14')
+ log.pack(side=RIGHT, anchor=E)
gf.pack(fill=X)
diff --git a/options.c b/options.c
index 69ae2c56..892e0f3e 100644
--- a/options.c
+++ b/options.c
@@ -34,35 +34,36 @@
#define LA_NOSYSLOG 12
#define LA_RCFILE 13
#define LA_IDFILE 14
-#define LA_PROTOCOL 15
-#define LA_UIDL 16
-#define LA_PORT 17
-#define LA_AUTHENTICATE 18
-#define LA_TIMEOUT 19
-#define LA_ENVELOPE 20
-#define LA_QVIRTUAL 21
-#define LA_USERNAME 22
-#define LA_ALL 23
-#define LA_NOKEEP 24
-#define LA_KEEP 25
-#define LA_FLUSH 26
-#define LA_NOREWRITE 27
-#define LA_LIMIT 28
-#define LA_FOLDER 29
-#define LA_SMTPHOST 30
-#define LA_SMTPADDR 31
-#define LA_ANTISPAM 32
-#define LA_BATCHLIMIT 33
-#define LA_FETCHLIMIT 34
-#define LA_EXPUNGE 35
-#define LA_MDA 36
-#define LA_NETSEC 37
-#define LA_INTERFACE 38
-#define LA_MONITOR 39
-#define LA_CONFIGDUMP 40
-#define LA_YYDEBUG 41
-
-/* options still left: CgGhHjJoORUwWxXYz */
+#define LA_POSTMASTER 15
+#define LA_PROTOCOL 16
+#define LA_UIDL 17
+#define LA_PORT 18
+#define LA_AUTHENTICATE 19
+#define LA_TIMEOUT 20
+#define LA_ENVELOPE 21
+#define LA_QVIRTUAL 22
+#define LA_USERNAME 23
+#define LA_ALL 24
+#define LA_NOKEEP 25
+#define LA_KEEP 26
+#define LA_FLUSH 27
+#define LA_NOREWRITE 28
+#define LA_LIMIT 29
+#define LA_FOLDER 30
+#define LA_SMTPHOST 31
+#define LA_SMTPADDR 32
+#define LA_ANTISPAM 33
+#define LA_BATCHLIMIT 34
+#define LA_FETCHLIMIT 35
+#define LA_EXPUNGE 36
+#define LA_MDA 37
+#define LA_NETSEC 38
+#define LA_INTERFACE 39
+#define LA_MONITOR 41
+#define LA_CONFIGDUMP 42
+#define LA_YYDEBUG 43
+
+/* options still left: CgGhHjJoORwWxXYz */
static const char *shortoptions =
"?Vcsvd:NqL:f:i:p:UP:A:t:E:Q:u:akKFnl:r:S:Z:b:B:e:m:T:I:M:y";
@@ -82,6 +83,7 @@ static const struct option longoptions[] = {
{"nosyslog", no_argument, (int *) 0, LA_NOSYSLOG },
{"fetchmailrc",required_argument,(int *) 0, LA_RCFILE },
{"idfile", required_argument, (int *) 0, LA_IDFILE },
+ {"postmaster",required_argument, (int *) 0, LA_POSTMASTER },
{"protocol", required_argument, (int *) 0, LA_PROTOCOL },
{"proto", required_argument, (int *) 0, LA_PROTOCOL },
@@ -275,6 +277,9 @@ struct query *ctl; /* option record to be initialized */
rctl->idfile = (char *) xmalloc(strlen(optarg)+1);
strcpy(rctl->idfile,optarg);
break;
+ case LA_POSTMASTER:
+ rctl->postmaster = (char *) xmalloc(strlen(optarg)+1);
+ break;
case 'p':
case LA_PROTOCOL:
/* XXX -- should probably use a table lookup here */
@@ -507,6 +512,7 @@ struct query *ctl; /* option record to be initialized */
fputs(" --invisible suppress Received line & enable host spoofing\n", stderr);
fputs(" -f, --fetchmailrc specify alternate run control file\n", stderr);
fputs(" -i, --idfile specify alternate UIDs file\n", stderr);
+ fputs(" --postmaster specify recipient of last resort\n",stderr);
#if defined(linux) && !INET6
fputs(" -I, --interface interface required specification\n",stderr);
fputs(" -M, --monitor monitor interface for activity\n",stderr);
diff --git a/rcfile_l.l b/rcfile_l.l
index 6bdff96d..90fc2230 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -27,6 +27,7 @@ idfile { return IDFILE; }
daemon { return DAEMON; }
syslog { return SYSLOG; }
invisible { return INVISIBLE; }
+postmaster { return POSTMASTER; }
defaults { return DEFAULTS; }
server { return POLL; }
diff --git a/rcfile_y.y b/rcfile_y.y
index f3af36f8..d6930b2a 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -33,10 +33,6 @@ char *rcfile; /* path name of rc file */
struct query cmd_opts; /* where to put command-line info */
/* parser sets these */
-int poll_interval; /* poll interval in seconds */
-char *logfile; /* log file for daemon mode */
-flag errors_to_syslog; /* if syslog was set */
-flag use_invisible; /* if invisible was set */
struct query *querylist; /* head of server list (globally visible) */
int yydebug; /* in case we didn't generate with -- debug */
@@ -65,9 +61,10 @@ extern char * yytext;
%token AUTHENTICATE TIMEOUT KPOP KERBEROS4 KERBEROS5 KERBEROS
%token ENVELOPE QVIRTUAL USERNAME PASSWORD FOLDER SMTPHOST MDA SMTPADDRESS
%token SPAMRESPONSE PRECONNECT POSTCONNECT LIMIT
+%token NETSEC INTERFACE MONITOR
%token IS HERE THERE TO MAP WILDCARD
%token BATCHLIMIT FETCHLIMIT EXPUNGE
-%token SET LOGFILE DAEMON SYSLOG IDFILE INVISIBLE NETSEC INTERFACE MONITOR
+%token SET LOGFILE DAEMON SYSLOG IDFILE INVISIBLE POSTMASTER
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
@@ -90,6 +87,7 @@ optmap : MAP | /* EMPTY */;
statement : SET LOGFILE optmap STRING {run.logfile = xstrdup($4);}
| SET IDFILE optmap STRING {run.idfile = xstrdup($4);}
| SET DAEMON optmap NUMBER {run.poll_interval = $4;}
+ | SET POSTMASTER optmap STRING {run.postmaster = xstrdup($4);}
| SET SYSLOG {run.use_syslog = TRUE;}
| SET INVISIBLE {run.invisible = TRUE;}
diff --git a/sample.rcfile b/sample.rcfile
index 32627ce4..420a4852 100644
--- a/sample.rcfile
+++ b/sample.rcfile
@@ -94,6 +94,7 @@
#
# set logfile -- must be followed by a string
# set idfile -- must be followed by a string
+# set postmaster -- must be followed by a string
# set daemon -- must be followed by a number
# set syslog
# set invisible