diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2000-11-04 23:23:04 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2000-11-04 23:23:04 +0000 |
commit | 28a9baeb83858fdb6ed6e9a31615172d7a8c6c58 (patch) | |
tree | c4980b94ec224eb5248f83f6b1b59d226379cc9a | |
parent | 8e4400dd9871f9043819b3fe50326ab47af96cfc (diff) | |
download | fetchmail-28a9baeb83858fdb6ed6e9a31615172d7a8c6c58.tar.gz fetchmail-28a9baeb83858fdb6ed6e9a31615172d7a8c6c58.tar.bz2 fetchmail-28a9baeb83858fdb6ed6e9a31615172d7a8c6c58.zip |
Added --showdots option by Thomas Jarosch <tomj@gmx.de>
svn path=/trunk/; revision=2981
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | conf.c | 1 | ||||
-rw-r--r-- | driver.c | 4 | ||||
-rw-r--r-- | fetchmail.c | 101 | ||||
-rw-r--r-- | fetchmail.h | 1 | ||||
-rw-r--r-- | fetchmail.man | 9 | ||||
-rwxr-xr-x | fetchmailconf | 7 | ||||
-rw-r--r-- | options.c | 7 | ||||
-rw-r--r-- | rcfile_l.l | 1 | ||||
-rw-r--r-- | rcfile_y.y | 3 | ||||
-rw-r--r-- | sample.rcfile | 1 | ||||
-rw-r--r-- | socket.c | 28 |
12 files changed, 105 insertions, 62 deletions
@@ -2,6 +2,10 @@ (The `lines' figures total .c, .h, .l, and .y files under version control.) +* Chip Salzenberg's patch to prevent wilcards in Common Names from causing + spurious error messages (resolved Debian bug #75011). +* Added --showdots option by Thomas Jarosch <tomj@gmx.de>. + fetchmail-5.5.5 (Tue Oct 17 17:50:46 EDT 2000), 19523 lines: * Killed a nasty segfault due to double-freeing of the header block. @@ -194,6 +194,7 @@ void dump_config(struct runctl *runp, struct query *querylist) booldump("bouncemail", runp->bouncemail); stringdump("properties", runp->properties); booldump("invisible", runp->invisible); + booldump("showdots", runp->showdots); booldump("syslog", runp->use_syslog); if (!querylist) @@ -544,7 +544,7 @@ static int readheaders(int sock, sizeticker += linelen; while (sizeticker >= SIZETICKER) { - if (!run.use_syslog && !isafile(1)) + if ((!run.use_syslog && !isafile(1)) || run.showdots) { fputc('.', stdout); fflush(stdout); @@ -1217,7 +1217,7 @@ static int readbody(int sock, struct query *ctl, flag forward, int len) sizeticker += linelen; while (sizeticker >= SIZETICKER) { - if ((run.poll_interval == 0 || nodetach) && outlevel > O_SILENT && !isafile(1)) + if (outlevel > O_SILENT && (((run.poll_interval == 0 || nodetach) && !isafile(1)) || run.showdots)) { fputc('.', stdout); fflush(stdout); diff --git a/fetchmail.c b/fetchmail.c index 28ad2aa2..617d4e80 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1153,61 +1153,64 @@ static int load_params(int argc, char **argv, int optind) ctl->server.truename = xstrdup(leadname); } #ifdef HAVE_GETHOSTBYNAME - else if (!configdump && (ctl->server.preauthenticate==A_KERBEROS_V4 || - ctl->server.preauthenticate==A_KERBEROS_V5 || - (ctl->server.dns && MULTIDROP(ctl)))) + else if (!configdump) { - struct hostent *namerec; - - /* compute the canonical name of the host */ - errno = 0; - namerec = gethostbyname(ctl->server.queryname); - if (namerec == (struct hostent *)NULL) + if (ctl->server.preauthenticate==A_KERBEROS_V4 || + ctl->server.preauthenticate==A_KERBEROS_V5 || + (ctl->server.dns && MULTIDROP(ctl))) { - report(stderr, - _("couldn't find canonical DNS name of %s\n"), - ctl->server.pollname); - ctl->server.truename = xstrdup(ctl->server.queryname); - ctl->server.trueaddr = NULL; + struct hostent *namerec; + + /* compute the canonical name of the host */ + errno = 0; + namerec = gethostbyname(ctl->server.queryname); + if (namerec == (struct hostent *)NULL) + { + report(stderr, + _("couldn't find canonical DNS name of %s\n"), + ctl->server.pollname); + ctl->server.truename = xstrdup(ctl->server.queryname); + ctl->server.trueaddr = NULL; + } + else + ctl->server.truename=xstrdup((char *)namerec->h_name); } - else - ctl->server.truename=xstrdup((char *)namerec->h_name); - } #endif /* HAVE_GETHOSTBYNAME */ - else { + else { #ifdef HAVE_GETHOSTBYNAME - struct hostent *namerec; - - /* <fetchmail@mail.julianhaight.com> - Get the host's IP, so we can report it like this: - - Received: from hostname [10.0.0.1] - - do we actually need to gethostbyname to find the IP? - it seems like it would be faster to do this later, when - we are actually resolving the hostname for a connection, - but I ain't that smart, so I don't know where to make - the change later.. - */ - errno = 0; - namerec = gethostbyname(ctl->server.queryname); - if (namerec == (struct hostent *)NULL) - { - report(stderr, - _("couldn't find canonical DNS name of %s\n"), - ctl->server.pollname); - exit(PS_DNS); - } - else { - ctl->server.truename=xstrdup((char *)namerec->h_name); - ctl->server.trueaddr=xmalloc(namerec->h_length); - memcpy(ctl->server.trueaddr, - namerec->h_addr_list[0], - namerec->h_length); - } + struct hostent *namerec; + + /* <fetchmail@mail.julianhaight.com> + Get the host's IP, so we can report it like this: + + Received: from hostname [10.0.0.1] + + do we actually need to gethostbyname to find the IP? + it seems like it would be faster to do this later, when + we are actually resolving the hostname for a connection, + but I ain't that smart, so I don't know where to make + the change later.. + */ + errno = 0; + namerec = gethostbyname(ctl->server.queryname); + if (namerec == (struct hostent *)NULL) + { + report(stderr, + _("couldn't find canonical DNS name of %s\n"), + ctl->server.pollname); + exit(PS_DNS); + } + else { + ctl->server.truename=xstrdup((char *)namerec->h_name); + ctl->server.trueaddr=xmalloc(namerec->h_length); + memcpy(ctl->server.trueaddr, + namerec->h_addr_list[0], + namerec->h_length); + } #else - ctl->server.truename = xstrdup(ctl->server.queryname); + ctl->server.truename = xstrdup(ctl->server.queryname); #endif /* HAVE_GETHOSTBYNAME */ + } } /* if no folders were specified, set up the null one as default */ @@ -1479,6 +1482,8 @@ static void dump_params (struct runctl *runp, #endif if (runp->invisible) printf(_("Fetchmail will masquerade and will not generate Received\n")); + if (runp->showdots) + printf(_("Fetchmail will show progress dots even in logfiles\n")); if (runp->postmaster) printf(_("Fetchmail will forward misaddressed multidrop messages to %s.\n"), runp->postmaster); diff --git a/fetchmail.h b/fetchmail.h index c0ffce33..8907696a 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -118,6 +118,7 @@ struct runctl char *properties; flag use_syslog; flag invisible; + flag showdots; }; struct idlist diff --git a/fetchmail.man b/fetchmail.man index 664f13f3..6f803d43 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -242,7 +242,7 @@ to use socks, SSL, ssh, or need some special firewalling setup. The program will be looked up in $PATH and can optionally be passed the hostname and port as arguments using "%h" and "%p" respectively (note that the interpolation logic is rather promitive, and these token must -be bounded by whitespace or beginning of string or end of stribg). +be bounded by whitespace or beginning of string or end of string). Fetchmail will write to the plugin's stdin and read from the plugin's stdout. .TP @@ -899,6 +899,13 @@ 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 --showdots +option (keyword: set showdots) forces fetchmail to show progress dots +even if the current tty is not stdout (for example logfiles). +Starting with fetchmail version 5.3.0, +progress dots are only shown on stdout by default. .SH RETRIEVAL FAILURE MODES The protocols \fIfetchmail\fR uses to talk to mailservers are next to diff --git a/fetchmailconf b/fetchmailconf index f3d7004a..05a599ed 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -4,7 +4,7 @@ # by Eric S. Raymond, <esr@snark.thyrsus.com>. # Requires Python with Tkinter, and the following OS-dependent services: # posix, posixpath, socket -version = "1.29" +version = "1.30" from Tkinter import * from Dialog import * @@ -1747,7 +1747,10 @@ def copy_instance(toclass, fromdict): # The `optional' fields are the ones we can ignore for purposes of # conformability checking; they'll still get copied if they are # present in the dictionary. - optional = ('interface', 'monitor', 'netsec', 'ssl', 'sslkey', 'sslcert') + optional = ('interface', 'monitor', + 'netsec', + 'ssl', 'sslkey', 'sslcert', + 'showdots') class_sig = setdiff(toclass.__dict__.keys(), optional) class_sig.sort() dict_keys = setdiff(fromdict.keys(), optional) @@ -78,6 +78,8 @@ #define LA_SSLCERT 52 #endif +#define LA_SHOWDOTS 53 + /* options still left: CDgGhHjJoORwWxXYz */ 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:yw:"; @@ -94,6 +96,7 @@ static const struct option longoptions[] = { {"quit", no_argument, (int *) 0, LA_QUIT }, {"logfile", required_argument, (int *) 0, LA_LOGFILE }, {"invisible", no_argument, (int *) 0, LA_INVISIBLE }, + {"showdots", no_argument, (int *) 0, LA_SHOWDOTS }, {"syslog", no_argument, (int *) 0, LA_SYSLOG }, {"nosyslog", no_argument, (int *) 0, LA_NOSYSLOG }, {"fetchmailrc",required_argument,(int *) 0, LA_RCFILE }, @@ -299,6 +302,9 @@ struct query *ctl; /* option record to be initialized */ case LA_INVISIBLE: rctl->invisible = TRUE; break; + case LA_SHOWDOTS: + rctl->showdots = TRUE; + break; case 'f': case LA_RCFILE: rcfile = (char *) xstrdup(optarg); @@ -647,6 +653,7 @@ struct query *ctl; /* option record to be initialized */ P(_(" --bsmtp set output BSMTP file\n")); P(_(" --lmtp use LMTP (RFC2033) for delivery\n")); P(_(" -r, --folder specify remote folder name\n")); + P(_(" --showdots show progress dots even in logfiles\n")); #undef P if (helpflag) @@ -65,6 +65,7 @@ idfile { return IDFILE; } daemon { return DAEMON; } syslog { return SYSLOG; } invisible { return INVISIBLE; } +showdots { return SHOWDOTS; } postmaster { return POSTMASTER; } bouncemail { return BOUNCEMAIL; } warnings { return WARNINGS; } @@ -65,7 +65,7 @@ extern char * yytext; %token NETSEC INTERFACE MONITOR PLUGIN PLUGOUT %token IS HERE THERE TO MAP WILDCARD %token BATCHLIMIT FETCHLIMIT EXPUNGE PROPERTIES -%token SET LOGFILE DAEMON SYSLOG IDFILE INVISIBLE POSTMASTER BOUNCEMAIL +%token SET LOGFILE DAEMON SYSLOG IDFILE INVISIBLE POSTMASTER BOUNCEMAIL SHOWDOTS %token <proto> PROTO %token <sval> STRING %token <number> NUMBER @@ -96,6 +96,7 @@ statement : SET LOGFILE optmap STRING {run.logfile = xstrdup($4);} | SET PROPERTIES optmap STRING {run.properties =xstrdup($4);} | SET SYSLOG {run.use_syslog = TRUE;} | SET INVISIBLE {run.invisible = TRUE;} + | SET SHOWDOTS {run.showdots = TRUE;} /* * The way the next two productions are written depends on the fact that diff --git a/sample.rcfile b/sample.rcfile index 54308b4e..299ec8cd 100644 --- a/sample.rcfile +++ b/sample.rcfile @@ -114,6 +114,7 @@ # set daemon -- must be followed by a number # set syslog # set invisible +# set showdots # # The noise keywords `and', `with', `has', `wants', and `options' are ignored # anywhere in an entry; they can be used to make it resemble English. The @@ -650,14 +650,26 @@ int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx ) *str_ptr = '\0'; } if (outlevel == O_VERBOSE) - report(stdout, _("Server CommonName: %s\n"), cbuf ); - /* Should we have some wildcarding here? */ - if ( NULL != _ssl_server_cname - && 0 != strcasecmp( cbuf, _ssl_server_cname ) ) { - report(stdout, - _("Server CommonName mismatch: %s != %s\n"), - cbuf, _ssl_server_cname ); - } + report(stdout, _("Server CommonName: %s\n"), cbuf); + + if (_ssl_server_cname != NULL) + { + char *p1 = cbuf; + char *p2 = _ssl_server_cname; + int n; + + if (*p1 == '*') + { + ++p1; + n = strlen(p2) - strlen(p1); + if (n >= 0) + p2 += n; + } + if ( 0 != strcasecmp( p1, p2 ) ) + report(stdout, + "Server CommonName mismatch: %s != %s\n", + cbuf, _ssl_server_cname ); + } } else { if (outlevel == O_VERBOSE) report(stdout, _("Unknown Server CommonName\n"), cbuf ); |