From a04a168b253b7aed5dc6023224e88904ae86deff Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 9 Dec 2020 10:38:56 +0100 Subject: [PATCH] mail: support invalid and repeated requests Fix random sitemap pages. --- mail/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mail/index.php b/mail/index.php index 908e531..2b6e600 100644 --- a/mail/index.php +++ b/mail/index.php @@ -2,6 +2,7 @@ $mailbox = 'mail/inbox'; @list ($msgid) = explode('/', ltrim($Page->path, '/')); +if (!function_exists('parsemailhead')) { function parsemailhead($headerdata) { $headlist = iconv_mime_decode_headers($headerdata, ICONV_MIME_DECODE_CONTINUE_ON_ERROR); @@ -12,9 +13,14 @@ function parsemailhead($headerdata) }); return $headlist; } +} if ($msgid) { $filename = "$mailbox/$msgid"; + if (!is_readable($filename)) { + return TRUE; + } + list ($headerdata, $rawbody) = explode("\n\n", file_get_contents($filename), 2); $head = parsemailhead($headerdata); $head['date']->setTimezone(new DateTimeZone(date_default_timezone_get())); -- 2.30.0