Mailbox update

This commit is contained in:
Torsten Schulz
2023-06-16 14:35:38 +02:00
parent b013ca914f
commit 4d302af6c7

View File

@@ -8,7 +8,6 @@ class Emailinbox extends Renderer {
public function __construct(?string $templateName = null) {
parent::__construct();
$folder = utf8_encode(urldecode(filter_input(INPUT_GET, 'folder'))) ?? 'INBOX';
var_dump($folder);
if (!$this->connectToImap($folder)) {
$this->templateName = 'imaperror';
}
@@ -23,6 +22,9 @@ class Emailinbox extends Renderer {
die();
}
$headers = $this->mbox->getMailsInfo($mailsIds);
if (!$headers) {
return [];
}
foreach ($headers as $header) {
try {
$date = \DateTime::createFromFormat('D, d M Y H:i:s O', str_replace([' (CET)', ' (CEST)', ' (UTC)'], '' , $header->date));