summaryrefslogtreecommitdiffstats
path: root/sqwebmail
diff options
context:
space:
mode:
authorSam Varshavchik2015-03-04 20:10:05 -0500
committerSam Varshavchik2015-03-04 20:10:05 -0500
commit070a5986a3ada0cd6cbb74c77f4e41ed3c4eb48c (patch)
tree96f6fe07a4a3be2812f20feb5611d6efdf820e95 /sqwebmail
parent0feb9a21453515e53fbf024fd09455af42d01bf1 (diff)
downloadcourier-libs-070a5986a3ada0cd6cbb74c77f4e41ed3c4eb48c.tar.bz2
imap: handle 01-Jan-1970 as a valid search date.
Diffstat (limited to 'sqwebmail')
-rw-r--r--sqwebmail/ChangeLog4
-rw-r--r--sqwebmail/maildir.c18
-rw-r--r--sqwebmail/msg2html.c15
3 files changed, 22 insertions, 15 deletions
diff --git a/sqwebmail/ChangeLog b/sqwebmail/ChangeLog
index 5769d82..66affb7 100644
--- a/sqwebmail/ChangeLog
+++ b/sqwebmail/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-03 Sam Varshavchik <mrsam@courier-mta.com>
+
+ * Recognize 01-Jan-1970 as a valid RFC 822 date.
+
2015-02-28 Sam Varshavchik <mrsam@courier-mta.com>
* Update to courier-unicode 1.2.
diff --git a/sqwebmail/maildir.c b/sqwebmail/maildir.c
index b822697..79dfbda 100644
--- a/sqwebmail/maildir.c
+++ b/sqwebmail/maildir.c
@@ -325,7 +325,7 @@ static char datebuf[40];
const char *date_yfmt;
const char *date_wfmt;
-
+
date_yfmt = getarg ("DSPFMT_YDATE");
if (*date_yfmt == 0)
date_yfmt = "%d %b %Y";
@@ -1224,7 +1224,7 @@ static void maildir_checknew(const char *folder, const char *dir)
/* Does The Right Thing if this is a shared
** folder
*/
-
+
free(p);
}
}
@@ -1303,7 +1303,7 @@ void maildir_autopurge()
unlink(filename);
free(filename);
- filename=alloc_filename(dire->d_name, "",
+ filename=alloc_filename(dire->d_name, "",
MAILDIRCURCACHE "." DBNAME);
if (!filename) enomem();
unlink(filename);
@@ -2391,7 +2391,7 @@ static int do_search_utf8(struct searchresults *res)
if (res->finished)
return 1;
- return 0;
+ return 0;
}
static int do_search(const char *str, size_t n, void *arg)
@@ -2695,7 +2695,7 @@ static void dodirscan(const char *folder,
fprintf(fp, "%s", cntbuf);
fclose(fp);
-
+
if (rename(createInfo.tmpname, cntfilename) < 0 ||
stat(cntfilename, &c_stat) < 0)
{
@@ -2975,9 +2975,9 @@ int fd;
if (strcmp(hdr, "date") == 0 && mi->date_s == 0)
{
- time_t t=rfc822_parsedt(val);
+ time_t t;
- if (t)
+ if (rfc822_parsedate_chk(val, &t) == 0)
{
mi->date_n=t;
mi->date_s=strdup(displaydate(mi->date_n));
@@ -3784,7 +3784,7 @@ int maildir_closemsg(int n, /* File descriptor */
char *newname;
struct stat stat_buf;
-
+
writeflush(n); /* If there's still anything in the buffer */
if (fstat(n, &stat_buf))
{
@@ -3849,7 +3849,7 @@ int maildir_closemsg(int n, /* File descriptor */
if (isok)
rename(oldname, newname);
-
+
unlink(oldname);
if (isok)
diff --git a/sqwebmail/msg2html.c b/sqwebmail/msg2html.c
index f5b703b..f58df1d 100644
--- a/sqwebmail/msg2html.c
+++ b/sqwebmail/msg2html.c
@@ -215,7 +215,7 @@ static void show_email_header(const char *h)
}
static void print_header_uc(struct msg2html_info *info, char *h)
-{
+{
header_uc(h);
printf("<tr valign=\"baseline\"><th align=\"right\" class=\"message-rfc822-header-name\">");
@@ -588,10 +588,13 @@ off_t pos;
if (save_date)
{
- time_t t=rfc822_parsedt(save_date);
- struct tm *tmp=t ? localtime(&t):0;
+ time_t t;
+ struct tm *tmp=0;
char date_buf[256];
+ if (rfc822_parsedate_chk(save_date, &t) == 0)
+ tmp=localtime(&t);
+
if (tmp)
{
char date_header[10];
@@ -780,7 +783,7 @@ int gpg_status;
{
if (q->isdummy) continue;
-
+
if (nextpart.idnum == 1)
{
printf("<blockquote class=\"%s\">",
@@ -2796,7 +2799,7 @@ msg2html_textplain_start(const char *message_charset,
{
struct msg2html_textplain_info *tinfo=
malloc(sizeof(struct msg2html_textplain_info));
-
+
memset(tinfo, 0, sizeof(*tinfo));
tinfo->flowed=isflowed;
@@ -3018,7 +3021,7 @@ static int download_func(const char *, size_t, void *);
static void disposition_attachment(FILE *fp, const char *p, int attachment)
{
- fprintf(fp, "Content-Disposition: %s; filename=\"",
+ fprintf(fp, "Content-Disposition: %s; filename=\"",
attachment ? "attachment":"inline");
while (*p)
{