* Fix bug that prevented messages from being marked oversized unless -v was on.
* Byrial Jensen made the tracepoll information RFC822-conformant.
* Reorder code to avoid accessing line buffers after they have been freed.
+* Steven Krings's patch to deal with over-long header lines.
+* Fix for Debian bug #101500.
+* Updated Danish translation by Byrial Jensen.
+* Chris Maio's patch for POP3 with BSMTP.
fetchmail-5.8.7 (Sun Jun 17 12:02:17 EDT 2001), 20749 lines:
self.plugout = None # Plugin command for going to listener
self.netsec = None # IPV6 security options
self.principal = None # Kerberos principal
- self.tracepolls = FALSE # Add X-Fetchmail-Account header?
+ self.tracepolls = FALSE # Add trace-poll info to headers
self.users = [] # List of user entries for site
Server.typemap = (
('pollname', 'String'),
('protocol', 'String'),
('port', 'Int'),
('uidl', 'Boolean'),
- ('auth', 'String'),
+ ('auth', 'String'),
('timeout', 'Int'),
('envelope', 'String'),
('envskip', 'Int'),
else:
res = res + " "
- if self.tracepolls:
- res = res + "tracepolls\n"
+ if self.tracepolls:
+ res = res + "tracepolls\n"
if self.interface:
res = res + "interface " + str(self.interface)
if self.localnames:
res = res + "is"
for x in self.localnames:
- res = res + " " + x
+ res = res + " " + `x`
res = res + " here"
if (self.keep != UserDefaults.keep
or self.flush != UserDefaults.flush
P(_(" -E, --envelope envelope address header\n"));
P(_(" -Q, --qvirtual prefix to remove from local user id\n"));
P(_(" --principal mail service principal\n"));
- P(_(" --addaccthdr add an X-Fetchmail-Account header (\"label <user@host>\")\n"));
+ P(_(" --tracepolls add poll-tracing information to Received header\n"));
P(_(" -u, --username specify users's login on server\n"));
P(_(" -a, --all retrieve old and new messages\n"));
#include "fetchmail.h"
#include "i18n.h"
-#define HEADER_END(p) ((p)[0] == '\n' && ((p)[1] != ' ' && (p)[1] != '\t' && (p)[1] != '\0'))
+#define HEADER_END(p) ((p)[0] == '\n' && ((p)[1] != ' ' && (p)[1] != '\t'))
#ifdef TESTMAIN
static int verbose;
void release_sink(struct query *ctl)
/* release the per-message output sink, whether it's a pipe or SMTP socket */
{
- if (ctl->bsmtp)
+ if (ctl->bsmtp && sinkfp)
fclose(sinkfp);
else if (ctl->mda)
{
return(FALSE);
}
}
- else if (ctl->bsmtp)
+ else if (ctl->bsmtp && sinkfp)
{
int error;
for (remaining = fetchlen; remaining > 0 || protocol->delimited; remaining -= linelen)
{
char *line;
+ int overlong = FALSE;
line = xmalloc(sizeof(buf));
linelen = 0;
linelen += n;
msgblk.msglen += n;
+ /*
+ * Try to gracefully handle the case, where the length of a
+ * line exceeds MSGBUFSIZE.
+ */
+ if ( n && buf[n-1] != '\n' ) {
+ unsigned int llen = strlen(line);
+ overlong = TRUE;
+ line = realloc(line, llen + n + 1);
+ strcpy(line + llen, buf);
+ ch = ' '; /* So the next iteration starts */
+ continue;
+ }
+
/* lines may not be properly CRLF terminated; fix this for qmail */
if (ctl->forcecr)
{
}
}
- /*
- * Decode MIME encoded headers. We MUST do this before
- * looking at the Content-Type / Content-Transfer-Encoding
- * headers (RFC 2046).
- */
- if (ctl->mimedecode)
- UnMimeHeader(buf);
-
- line = (char *) realloc(line, strlen(line) + strlen(buf) +1);
+ /*
+ * Decode MIME encoded headers. We MUST do this before
+ * looking at the Content-Type / Content-Transfer-Encoding
+ * headers (RFC 2046).
+ */
+ if ( ctl->mimedecode && overlong ) {
+ /*
+ * If we received an overlong line, we have to decode the
+ * whole line at once.
+ */
+ line = (char *) realloc(line, strlen(line) + strlen(buf) +1);
+ strcat(line, buf);
+ UnMimeHeader(line);
+ }
+ else {
+ if ( ctl->mimedecode )
+ UnMimeHeader(buf);
- strcat(line, buf);
+ line = (char *) realloc(line, strlen(line) + strlen(buf) +1);
+ strcat(line, buf);
+ }
/* check for end of headers */
if (EMPTYLINE(line))
*/
if (protocol->delimited && line[0] == '.' && EMPTYLINE(line+1))
{
- free(line);
has_nuls = (linelen != strlen(line));
+ free(line);
goto process_headers;
}
* This header is technically invalid under RFC822.
* POP3, IMAP, etc. are not legal mail-parameter values.
*/
- sprintf(buf, "\tby %s with %s (fetchmail-%s)",
+ sprintf(buf, "\tby %s with %s (fetchmail-%s",
fetchmailhost,
protocol->name,
VERSION);
ctl->server.pollname,
ctl->remotename);
}
- strcat(buf, "\r\n");
+ strcat(buf, ")\r\n");
n = stuffline(ctl, buf);
if (n != -1)
{