Page MenuHomePhorge

D5145.1775294743.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D5145.1775294743.diff

diff --git a/src/app/DataMigrator/Driver/IMAP.php b/src/app/DataMigrator/Driver/IMAP.php
--- a/src/app/DataMigrator/Driver/IMAP.php
+++ b/src/app/DataMigrator/Driver/IMAP.php
@@ -132,6 +132,7 @@
$this->initIMAP();
$mailbox = self::toUTF7($item->folder->targetname);
+ $result = null;
if (strlen($item->content)) {
$result = $this->imap->append(
@@ -141,10 +142,6 @@
$item->data['internaldate'] ?? null,
true
);
-
- if ($result === false) {
- throw new \Exception("Failed to append IMAP message into {$mailbox}");
- }
} elseif ($item->filename) {
$result = $this->imap->appendFromFile(
$mailbox,
@@ -154,9 +151,15 @@
$item->data['internaldate'] ?? null,
true
);
+ }
- if ($result === false) {
- throw new \Exception("Failed to append IMAP message into {$mailbox}");
+ if ($result === false) {
+ $id = $item->data['internaldate'] ?? "";
+ // Don't abort the migration because of malformed messages
+ if ($this->imap->error == "APPEND: Message contains invalid header") {
+ \Log::warning("Failed to append IMAP message ($id) into {$mailbox}:\n {$this->imap->error}");
+ } else {
+ throw new \Exception("Failed to append IMAP message ($id) into {$mailbox}:\n {$this->imap->error}");
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 9:25 AM (1 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18828785
Default Alt Text
D5145.1775294743.diff (1 KB)

Event Timeline