diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-27 17:34:00 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-27 17:34:00 +0000 |
commit | e0ca7a370a20acf2732cbe4cd0e93d1751fb5366 (patch) | |
tree | 21f3f9fafddbb204d2fce5a5d31af2367388aa59 | |
parent | 5c09cbae3e433ed47a60ef02f3146926ac915094 (diff) | |
download | fetchmail-e0ca7a370a20acf2732cbe4cd0e93d1751fb5366.tar.gz fetchmail-e0ca7a370a20acf2732cbe4cd0e93d1751fb5366.tar.bz2 fetchmail-e0ca7a370a20acf2732cbe4cd0e93d1751fb5366.zip |
Added the wildcard option.
svn path=/trunk/; revision=575
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | driver.c | 3 | ||||
-rw-r--r-- | fetchmail.c | 4 | ||||
-rw-r--r-- | fetchmail.h | 4 | ||||
-rw-r--r-- | fetchmail.man | 3 | ||||
-rw-r--r-- | rcfile_l.l | 1 | ||||
-rw-r--r-- | rcfile_y.y | 18 |
7 files changed, 27 insertions, 9 deletions
@@ -7,9 +7,10 @@ pl 2.0.1 (): of run, so DNS does less work. During a run, cache host matches on the aka list so no potential alias has to be DNS-checked more than once. * Try to use envelope From. If that fails, fall back on calling-user. -* Added FAQ file * Added `logfile' keyword to rc syntax. * We now use X-Envelope-To headers. +* Added `*' as a wildcard option for multidrop to ... here +* Added FAQ file fetchmail-2.0 (Mon Nov 18 00:32:17 EST 1996): @@ -226,6 +226,9 @@ struct idlist **xmit_names; /* list of recipient names parsed out */ } lname = idpair_find(&ctl->localnames, cp); + if (!lname && ctl->wildcard) + lname = cp; + if (lname != (char *)NULL) { if (outlevel == O_VERBOSE) diff --git a/fetchmail.c b/fetchmail.c index 0a464906..a8fe30c2 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -771,11 +771,15 @@ void dump_params (struct query *ctl) count, (count == 1 && !strcmp(ctl->localnames->id, user)) ? " (by default)" : ""); if (outlevel == O_VERBOSE) + { for (idp = ctl->localnames; idp; idp = idp->next) if (idp->val.id2) fprintf(stderr, "\t%s -> %s\n", idp->id, idp->val.id2); else fprintf(stderr, "\t%s\n", idp->id); + if (ctl->wildcard) + fputs("*\n", stderr); + } } if (ctl->protocol > P_POP2) diff --git a/fetchmail.h b/fetchmail.h index 451b3234..194b472c 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -63,6 +63,7 @@ struct query /* per-host data */ char servername [HOSTLEN+1]; struct idlist *localnames; + int wildcard; /* true if unmatched names should be passed through */ int protocol; int port; int authenticate; @@ -105,7 +106,8 @@ struct query #endif /* HAVE_GETHOSTBYNAME */ }; -#define MULTIDROP(ctl) ((ctl)->localnames && (ctl)->localnames->next) +#define MULTIDROP(ctl) (ctl->wildcard || \ + ((ctl)->localnames && (ctl)->localnames->next)) struct method { diff --git a/fetchmail.man b/fetchmail.man index ba259fca..42f070fa 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -464,7 +464,8 @@ save it from having to do DNS lookups. .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. +the mailserver user name in the entry. If an is/to list has `*' as +its last name, unrecognized names are simply passed through. .PP A single local name can be used to support redirecting your mail when your username on the client machine is different from your name on the @@ -43,6 +43,7 @@ here { return HERE; } there { return THERE; } to { return TO; } = { return MAP; } +"*" { return WILDCARD; } keep { yylval.flag = FLAG_TRUE; return KEEP; } flush { yylval.flag = FLAG_TRUE; return FLUSH; } @@ -42,7 +42,8 @@ static void prc_reset(); } %token DEFAULTS POLL SKIP AKA PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS -%token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE TO MAP LIMIT +%token USERNAME PASSWORD FOLDER SMTPHOST MDA LIMIT +%token IS HERE THERE TO MAP WILDCARD %token SET BATCHLIMIT LOGFILE %token <proto> PROTO %token <sval> STRING @@ -65,7 +66,7 @@ statement_list : statement /* future global options should also have the form SET <name> <value> */ statement : SET BATCHLIMIT MAP NUMBER {batchlimit = $4;} - | SET LOGFILE STRING {logfile = xstrdup($3);} + | SET LOGFILE MAP STRING {logfile = xstrdup($4);} /* * The way the next two productions are written depends on the fact that @@ -134,6 +135,11 @@ user1opts : user_option | user1opts user_option ; +localnames : WILDCARD {current.wildcard = TRUE;} + | mapping_list {current.wildcard = FALSE;} + | mapping_list WILDCARD {current.wildcard = TRUE;} + ; + mapping_list : mapping | mapping_list mapping ; @@ -144,10 +150,10 @@ mapping : STRING {save_id_pair(¤t.localnames, $1, $3);} ; -user_option : TO mapping_list HERE - | TO mapping_list - | IS mapping_list HERE - | IS mapping_list +user_option : TO localnames HERE + | TO localnames + | IS localnames HERE + | IS localnames | IS STRING THERE {strcpy(current.remotename, $2);} | PASSWORD STRING {strcpy(current.password, $2);} |