diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | driver.c | 13 | ||||
-rw-r--r-- | fetchmail.c | 2 | ||||
-rw-r--r-- | fetchmail.man | 10 | ||||
-rw-r--r-- | options.c | 66 | ||||
-rw-r--r-- | sample.rcfile | 4 |
6 files changed, 61 insertions, 36 deletions
@@ -11,6 +11,8 @@ fetchmail-4.5.2 (): * German-language internationalization in the RPM, thanks to Jochen Hayek. * .fetchmailrc files are now permitted to be executable by user and group. +* Eric Daniel's guard code against very long lines. +* Added --nosyslog option. fetchmail-4.5.1 (Wed Jul 1 19:27:56 EDT 1998): * Checkalias option from Enrico Musio <enrico.musio@spaziozerouno.it>. @@ -1630,7 +1630,7 @@ int len; /* length of message */ flag forward; /* TRUE to forward */ { int linelen; - unsigned char buf[MSGBUFSIZE+1]; + unsigned char buf[MSGBUFSIZE+4]; unsigned char *inbufp = buf; flag issoftline = FALSE; @@ -1638,7 +1638,7 @@ flag forward; /* TRUE to forward */ while (protocol->delimited || len > 0) { set_timeout(ctl->server.timeout); - if ((linelen = SockRead(sock, inbufp, sizeof(buf)-1-(inbufp-buf)))==-1) + if ((linelen = SockRead(sock, inbufp, sizeof(buf)-4-(inbufp-buf)))==-1) { set_timeout(0); if (ctl->mda) @@ -1694,9 +1694,16 @@ flag forward; /* TRUE to forward */ /* ship out the text line */ if (forward && (!issoftline)) { - int n = stuffline(ctl, buf); + int n; inbufp = buf; + /* guard against very long lines */ + buf[MSGBUFSIZE+1] = '\r'; + buf[MSGBUFSIZE+2] = '\n'; + buf[MSGBUFSIZE+3] = '\0'; + + n = stuffline(ctl, buf); + if (n < 0) { error(0, errno, "writing message text"); diff --git a/fetchmail.c b/fetchmail.c index a15a5328..148d175a 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -970,7 +970,7 @@ static int load_params(int argc, char **argv, int optind) if (cmd_run.invisible) run.invisible = cmd_run.invisible; if (cmd_run.use_syslog) - run.use_syslog = cmd_run.use_syslog; + run.use_syslog = (cmd_run.use_syslog == FLAG_TRUE); /* check and daemon options are not compatible */ if (check_only && run.poll_interval) diff --git a/fetchmail.man b/fetchmail.man index 67b0f02e..1831b040 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -644,6 +644,13 @@ indicate the status of the daemon and the results while fetching mail from the server(s). Error messages for command line options and parsing the \fI.fetchmailrc\fR file are still written to stderr, or the specified log file if the +The +.B --nosyslog +option turns off use of +.IR syslog (3), +assuming it's turned on in the +.I .fetchmailrc +file. .B -L or .B --logfile @@ -990,6 +997,9 @@ T} syslog \& T{ Do error logging through syslog(3). T} +nosyslog \& T{ +Turn off error logging through syslog(3). +T} .TE .PP Remember that all user options must \fIfollow\fR all server options. @@ -31,35 +31,36 @@ #define LA_LOGFILE 9 #define LA_INVISIBLE 10 #define LA_SYSLOG 11 -#define LA_RCFILE 12 -#define LA_IDFILE 13 -#define LA_PROTOCOL 14 -#define LA_UIDL 15 -#define LA_PORT 16 -#define LA_AUTHENTICATE 17 -#define LA_TIMEOUT 18 -#define LA_ENVELOPE 19 -#define LA_QVIRTUAL 20 -#define LA_USERNAME 21 -#define LA_ALL 22 -#define LA_NOKEEP 23 -#define LA_KEEP 24 -#define LA_FLUSH 25 -#define LA_NOREWRITE 26 -#define LA_LIMIT 27 -#define LA_FOLDER 28 -#define LA_SMTPHOST 29 -#define LA_SMTPADDR 30 -#define LA_ANTISPAM 31 -#define LA_BATCHLIMIT 32 -#define LA_FETCHLIMIT 33 -#define LA_EXPUNGE 34 -#define LA_MDA 35 -#define LA_NETSEC 36 -#define LA_INTERFACE 37 -#define LA_MONITOR 38 -#define LA_CONFIGDUMP 39 -#define LA_YYDEBUG 40 +#define LA_NOSYSLOG 12 +#define LA_RCFILE 13 +#define LA_IDFILE 14 +#define LA_PROTOCOL 15 +#define LA_UIDL 16 +#define LA_PORT 17 +#define LA_AUTHENTICATE 18 +#define LA_TIMEOUT 19 +#define LA_ENVELOPE 20 +#define LA_QVIRTUAL 21 +#define LA_USERNAME 22 +#define LA_ALL 23 +#define LA_NOKEEP 24 +#define LA_KEEP 25 +#define LA_FLUSH 26 +#define LA_NOREWRITE 27 +#define LA_LIMIT 28 +#define LA_FOLDER 29 +#define LA_SMTPHOST 30 +#define LA_SMTPADDR 31 +#define LA_ANTISPAM 32 +#define LA_BATCHLIMIT 33 +#define LA_FETCHLIMIT 34 +#define LA_EXPUNGE 35 +#define LA_MDA 36 +#define LA_NETSEC 37 +#define LA_INTERFACE 38 +#define LA_MONITOR 39 +#define LA_CONFIGDUMP 40 +#define LA_YYDEBUG 41 /* options still left: CgGhHjJoORUwWxXYz */ static const char *shortoptions = @@ -78,6 +79,7 @@ static const struct option longoptions[] = { {"logfile", required_argument, (int *) 0, LA_LOGFILE }, {"invisible", no_argument, (int *) 0, LA_INVISIBLE }, {"syslog", no_argument, (int *) 0, LA_SYSLOG }, + {"nosyslog", no_argument, (int *) 0, LA_NOSYSLOG }, {"fetchmailrc",required_argument,(int *) 0, LA_RCFILE }, {"idfile", required_argument, (int *) 0, LA_IDFILE }, @@ -469,7 +471,11 @@ struct query *ctl; /* option record to be initialized */ break; case LA_SYSLOG: - rctl->use_syslog = TRUE; + rctl->use_syslog = FLAG_TRUE; + break; + + case LA_NOSYSLOG: + rctl->use_syslog = FLAG_FALSE; break; case '?': diff --git a/sample.rcfile b/sample.rcfile index b1e8da06..32627ce4 100644 --- a/sample.rcfile +++ b/sample.rcfile @@ -38,8 +38,8 @@ # monitor -- must be followed by device # dns # no dns -# checkalias -- do multidrop address compaison by IP address -# no checkalias -- do multidrop address compaison by name +# checkalias -- do multidrop address comparison by IP address +# no checkalias -- do multidrop address comparison by name # # username (or user) -- must be followed by a name # is -- must be followed by one or more names |