Skip to content

Commit

Permalink
Change the way of getting new saved message uid
Browse files Browse the repository at this point in the history
  • Loading branch information
josaphatim committed Feb 13, 2025
1 parent d15cc45 commit 5beec67
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions modules/imap/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1753,18 +1753,10 @@ function save_sent_msg($handler, $imap_id, $mailbox, $imap_details, $msg, $msg_i
$uid = null;
if ($sent_folder) {
Hm_Debug::add(sprintf("Attempting to save sent message for server %s in folder %s", $mailbox->server_type(), $imap_details['server'], $sent_folder));
if (! $mailbox->store_message($sent_folder, $msg)) {
$uid = $mailbox->store_message($sent_folder, $msg);
if (! $uid) {
Hm_Msgs::add('ERRAn error occurred saving the sent message');
}

$mailbox_page = $mailbox->get_messages($sent_folder, 'ARRIVAL', true, 'ALL', 0, 10);
foreach ($mailbox_page[1] as $mail) {
$msg_header = $mailbox->get_message_headers($sent_folder, $mail['uid']);
if ($msg_header['Message-Id'] === $msg_id) {
$uid = $mail['uid'];
break;
}
}
}
return $uid;
}}

0 comments on commit 5beec67

Please sign in to comment.