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

RC file syntax change, folder->mailbox, remote->remotename.

svn path=/trunk/; revision=220
parent f7fa6d04
......@@ -29,6 +29,13 @@ fetchmail-1.6 ():
* Fix bug that prevented SMTP from being specified on the defaults line.
* Changes in .fetchmailrc syntax: The token `remotefolder' no longer
exists; it has been replaced by `mailbox'. The token `remote' no
longer stands for `remotefolder' but for `remotename', a synonym for
`username'. The purpose of these changes (which should only affect
IMAP and POP2 users setting up for non-default mailboxes) is to prepare
for syntax supporting multiple user queries per host.
* Allow program to run with no .fetchmailrc file again.
fetchmail-1.5 (Thu Oct 3 04:35:15 EDT 1996):
......
......@@ -167,7 +167,6 @@ char **argv;
else
printf(" and %s\n", rcfile);
for (hostp = hostlist; hostp; hostp = hostp->next) {
printf("Options for host %s:\n", hostp->servername);
dump_params(hostp);
if (outlevel == O_VERBOSE)
printf(" Lockfile at %s\n", tmpbuf);
......@@ -383,6 +382,8 @@ static int showversioninfo()
int dump_params (queryctl)
struct hostrec *queryctl;
{
printf("Options for %s retrieving from %s:\n",
hostp->localname, hostp->servername);
if (queryctl->skip || outlevel == O_VERBOSE)
printf(" This host will%s be queried when no host is specified.\n",
queryctl->skip ? " not" : "");
......
......@@ -57,7 +57,7 @@ struct hostrec
char localname [USERNAMELEN+1];
char remotename [USERNAMELEN+1];
char password [PASSWORDLEN+1];
char remotefolder [FOLDERLEN];
char mailbox [FOLDERLEN];
char smtphost[HOSTLEN+1];
char mda [MDALEN+1];
int protocol;
......
......@@ -296,9 +296,12 @@ Legal keywords are:
server
protocol (or proto)
localname (or local)
username (or user)
remotename (or remote)
username (or user)
password (or pass)
remotefolder (or remote)
mailbox
smtphost (or smtp)
mda
keep
......
......@@ -101,7 +101,7 @@ int *countp;
/* find out how many messages are waiting */
ok = gen_transact(socket,
"SELECT %s",
queryctl->remotefolder[0] ? queryctl->remotefolder : "INBOX");
queryctl->mailbox[0] ? queryctl->mailbox : "INBOX");
if (ok != 0)
return(ok);
......
......@@ -172,7 +172,7 @@ struct hostrec *queryctl;
break;
case 'r':
case LA_REMOTEFILE:
strncpy(queryctl->remotefolder,optarg,sizeof(queryctl->remotefolder)-1);
strncpy(queryctl->mailbox,optarg,sizeof(queryctl->mailbox)-1);
break;
case 'm':
case LA_MDA:
......
......@@ -82,9 +82,9 @@ int *countp;
return(PS_ERROR);
/* maybe the user wanted a non-default folder */
if (queryctl->remotefolder[0])
if (queryctl->mailbox[0])
{
int ok = gen_transact(socket, "FOLD %s", queryctl->remotefolder);
int ok = gen_transact(socket, "FOLD %s", queryctl->mailbox);
if (ok != 0)
return(ok);
......
......@@ -222,7 +222,7 @@ int doPOP3 (queryctl)
/* retrieve messages using POP3 */
struct hostrec *queryctl;
{
if (queryctl->remotefolder[0]) {
if (queryctl->mailbox[0]) {
fprintf(stderr,"Option --remote is not supported with POP3\n");
return(PS_SYNTAX);
}
......
......@@ -26,9 +26,11 @@ int prc_lineno = 1;
defaults { return KW_DEFAULTS; }
server { return KW_SERVER; }
proto(col)? { return KW_PROTOCOL; }
user(name)? { return KW_USERNAME; }
local(name)? { return KW_LOCALNAME; }
user(name)? { return KW_REMOTENAME; }
remote(name)? { return KW_REMOTENAME; }
pass(word)? { return KW_PASSWORD; }
remote(folder)? { return KW_REMOTEFOLDER; }
mailbox { return KW_MAILBOX; }
smtp(host)? { return KW_SMTPHOST; }
mda { return KW_MDA; }
keep { yylval.flag = FLAG_TRUE; return KW_KEEP; }
......
......@@ -29,8 +29,8 @@ int yydebug; /* in case we didn't generate with -- debug */
char *sval;
}
%token KW_SERVER KW_PROTOCOL KW_USERNAME KW_PASSWORD
%token KW_REMOTEFOLDER KW_SMTPHOST KW_MDA KW_DEFAULTS
%token KW_SERVER KW_PROTOCOL KW_LOCALNAME KW_REMOTENAME KW_PASSWORD
%token KW_MAILBOX KW_SMTPHOST KW_MDA KW_DEFAULTS
%token <proto> KW_PROTO
%token <sval> PARAM_STRING
%token <flag> KW_KEEP KW_FLUSH KW_FETCHALL KW_REWRITE KW_PORT KW_SKIP
......@@ -63,9 +63,10 @@ server_options: serv_option_clause
serv_option_clause:
KW_PROTOCOL KW_PROTO {prc_setproto($2);}
| KW_USERNAME PARAM_STRING {prc_remotename($2);}
| KW_LOCALNAME PARAM_STRING {prc_localname($2);}
| KW_REMOTENAME PARAM_STRING {prc_remotename($2);}
| KW_PASSWORD PARAM_STRING {prc_setpassword($2);}
| KW_REMOTEFOLDER PARAM_STRING {prc_setremote($2);}
| KW_MAILBOX PARAM_STRING {prc_setmailbox($2);}
| KW_SMTPHOST PARAM_STRING {prc_setsmtphost($2);}
| KW_MDA PARAM_STRING {prc_setmda($2);}
| KW_KEEP {prc_setkeep($1==FLAG_TRUE);}
......
......@@ -21,10 +21,11 @@
# Legal keywords are
# server
# protocol (or proto)
# localname (or local)
# username (or user)
# remotename (or remote)
# password (or pass)
# remotefolder (or remote)
# localfolder (or local)
# mailbox
# smtphost (or smtp)
# mda
# keep
......@@ -66,5 +67,4 @@ server other.provider.net proto pop2 user John.Smith password My^Hat
server pop.provider.net \
proto pop3 \
user jsmith \
pass secret1 \
localfolder ~/mbox
pass secret1
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