From 60c4abd04949ce1e69e3298dad9ad83ac37e104e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 13 Feb 1997 00:23:43 +0000 Subject: Deal with headerless mail. svn path=/trunk/; revision=870 --- NEWS | 4 +++- driver.c | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 89ff315d..e71af0cc 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ Release Notes: ------------------------------------------------------------------------------ -fetchmail-3.4 (Wed Feb 12 13:57:00 EST 1997) +fetchmail-3.4 (Wed Feb 12 19:23:06 EST 1997) features -- @@ -10,6 +10,8 @@ features -- * It is now possible to turn off option flags in individual server entries that had been turned on in a `defaults' entry. +* The code should now deal gracefully with headerless mail. + bugs -- * The bug that displayed incorrect sizes for POP3 connections has been fixed. diff --git a/driver.c b/driver.c index 6ef30419..9999985d 100644 --- a/driver.c +++ b/driver.c @@ -524,6 +524,19 @@ char *realname; /* real name of host */ #endif /* HAVE_RES_SEARCH */ } + /* + * Hack time. If the first line of the message was blank, with no headers + * (this happens occasionally due to bad gatewaying software) cons up + * a set of fake headers. + */ + if (headers == (char *)NULL) + { + sprintf(buf, +"From: FETCHMAIL-DAEMON\r\nTo: %s\r\nSubject: Headerless mail from %s@%s\r\n", + ctl->localnames->id, ctl->remotename, realname); + headers = xstrdup(buf); + } + /* * We can now process message headers before reading the text. * In fact we have to, as this will tell us where to forward to. -- cgit v1.2.3