X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/b9757db57858fdcff8af1a6566e299559e491b17..a04a168b253b7aed5dc6023224e88904ae86deff:/mail/index.php 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()));