Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117889222
D5145.1775360873.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D5145.1775360873.diff
View Options
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,14 @@
$item->data['internaldate'] ?? null,
true
);
+ }
- if ($result === false) {
- throw new \Exception("Failed to append IMAP message into {$mailbox}");
+ if ($result === false) {
+ // 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 ({$item->id}) into {$mailbox}: {$this->imap->error}");
+ } else {
+ throw new \Exception("Failed to append IMAP message ({$item->id}) into {$mailbox}: {$this->imap->error}");
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 5, 3:47 AM (13 h, 55 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18828172
Default Alt Text
D5145.1775360873.diff (1 KB)
Attached To
Mode
D5145: Don't abort the migration on some expected errors
Attached
Detach File
Event Timeline