X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/b9757db57858fdcff8af1a6566e299559e491b17..dceaed615cc4046d0f4145d17580fa1b7471c538:/mail/index.php diff --git a/mail/index.php b/mail/index.php index 908e531..ee7365a 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())); @@ -49,7 +55,7 @@ if ($msgid) { return; } -if (!$User) { +if ($Page->api) { return; } if (!$User->admin('user')) {