shithub: riscv

Download patch

ref: fc6d319a3fc26e3a8335cbe61764ce5c67580a3e
parent: ae2bb7f3eaea334bb28f4c388fdee9e370dd5a82
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Sep 25 21:24:17 EDT 2023

upas/fs: don't abort when the server gives us invalid dates

--- a/sys/src/cmd/upas/fs/imap.c
+++ b/sys/src/cmd/upas/fs/imap.c
@@ -352,8 +352,10 @@
 	for(i = 0; i < n; i += 2){
 		if(strcmp(f[i], "internaldate") == 0){
 			l = internaltounix(f[i + 1]);
-			if(l < 418319360)
-				abort();
+			if(l < 418319360){
+				fprint(2, "invalid date %s\n", f[i+1]);
+				l = time(nil);
+			}
 			if(idx < imap->muid)
 				imap->f[idx].dates = l;
 		}else if(strcmp(f[i], "rfc822.size") == 0){