aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--conf.c1
-rw-r--r--driver.c4
-rw-r--r--fetchmail.c101
-rw-r--r--fetchmail.h1
-rw-r--r--fetchmail.man9
-rwxr-xr-xfetchmailconf7
-rw-r--r--options.c7
-rw-r--r--rcfile_l.l1
-rw-r--r--rcfile_y.y3
-rw-r--r--sample.rcfile1
-rw-r--r--socket.c28
12 files changed, 105 insertions, 62 deletions
diff --git a/NEWS b/NEWS
index 74d3ea55..81f7cad2 100644
--- a/NEWS
+++ b/NEWS
@@ -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.
diff --git a/conf.c b/conf.c
index 7ac6fb66..19f8346a 100644
--- a/conf.c
+++ b/conf.c
@@ -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)
diff --git a/driver.c b/driver.c
index 2399c8d2..0c52f9b5 100644
--- a/driver.c
+++ b/driver.c
@@ -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)
diff --git a/options.c b/options.c
index 03f99f5e..6f9aaceb 100644
--- a/options.c
+++ b/options.c
@@ -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)
diff --git a/rcfile_l.l b/rcfile_l.l
index c329fa4d..8ce776bf 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -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; }
diff --git a/rcfile_y.y b/rcfile_y.y
index 1c504143..f24f71a4 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -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
diff --git a/socket.c b/socket.c
index 805f867e..3777e6d9 100644
--- a/socket.c
+++ b/socket.c
@@ -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 );