bugs --
-* Default user name to deliver to is now the calling user (was the remote
- user ID).
+* Default user name to deliver to is now the calling user, unless
+ program is running as root in which case it is the remote user name
+ (default can be overridden with an `is' or `to' declaration).
+ In versions up to 1.7 it was the calling user; in 1.8 the remote
+ user ID. This created some confusion.
fetchmail-1.8 (Fri Oct 11 15:08:10 EDT 1996):
/* if rc file didn't supply a localname, default appropriately */
if (!hostp->localname[0])
- strcpy(hostp->localname, user);
+ if (getuid() == 0)
+ strcpy(hostp->localname, hostp->remotename);
+ else
+ strcpy(hostp->localname, user);
/* check that delivery is going to a real local user */
if ((pw = getpwnam(user)) == (struct passwd *)NULL)
username (or user)
is
+ to
password (or pass)
remotefolder (or remote)
smtphost (or smtp)
norewrite
.PP
All options correspond to the obvious command-line arguments except
-three: \fBis\fR, \fBpassword\fR and \fBskip\fR.
-.PP
-The \fBis\fR keyword associates a following local username with the
-mailserver user name in the entry. It is intended to be used in
-configurations where \fIfetchmail\fR runs as root and retrieves
-mail for multiple local users. If no \fBis\fR clause is present,
-the default local username is the same as the argument of the
-\fBuser\fR keyword.
+four: \fBis\fR, \fBto\fR, \fBpassword\fR and \fBskip\fR.
+.PP
+The \fBis\fR or \fIto\fR keywords associate a following local
+username with the mailserver user name in the entry. They are intended
+to be used in configurations where \fIfetchmail\fR runs as root and
+retrieves mail for multiple local users. If no \fBis\fR or \fIto\fR
+clause is present, the default local username is the calling user,
+unless the calling user is root in which case it is the remote user
+name of the current entry.
.PP
The \fBpassword\fR option requires a string argument, which is the password
to be used with the entry's server.
is { return IS; }
here { return HERE; }
there { return THERE; }
+to { return TO; }
keep { yylval.flag = FLAG_TRUE; return KEEP; }
flush { yylval.flag = FLAG_TRUE; return FLUSH; }
}
%token DEFAULTS SERVER PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS
-%token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE
+%token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE TO
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
| user1opts user_option
;
-user_option : IS STRING {strcpy(current.localname, $2);}
+user_option : TO STRING {strcpy(current.localname, $2);}
+ | TO STRING HERE {strcpy(current.localname, $2);}
+ | IS STRING {strcpy(current.localname, $2);}
| IS STRING HERE {strcpy(current.localname, $2);}
| IS STRING THERE {strcpy(current.remotename, $2);}
| PASSWORD STRING {strcpy(current.password, $2);}