Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matidau committed Aug 1, 2024
1 parent b8eb7d3 commit a04baf6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/backend/imap/imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3126,7 +3126,12 @@ public function saveDraftMail($sm) {
ZLog::Write(LOGLEVEL_WARN, sprintf("BackendIMAP->SaveDraftMail(): We get the new message"));
ZLog::Write(LOGLEVEL_WARN, sprintf("BackendIMAP->SaveDraftMail(): sm->mimedata: %s", $sm->mimedata));

// set $message if there is mimedata
// set $mimedata, if there isn't set with minimum from header
$mimedata = $sm->mimedata;
if (isempty($mimedata)) {
$mimedata = $sm->from;
}

$mobj = new Mail_mimeDecode($sm->mimedata);
$message = $mobj->decode(array('decode_headers' => 'utf-8', 'decode_bodies' => true, 'include_bodies' => true, 'rfc_822bodies' => true, 'charset' => 'utf-8'));
unset($mobj);
Expand Down Expand Up @@ -3173,7 +3178,7 @@ public function saveDraftMail($sm) {

// if it's a S/MIME message or has VCALENDAR objects I don't do anything with it
if (is_smime($message) || has_calendar_object($message)) {
$mobj = new Mail_mimeDecode($sm->mimedata);
$mobj = new Mail_mimeDecode($mimedata);
// re-using getSendArray() for save drafts
$parts = $mobj->getSendArray();
unset($mobj);
Expand Down

0 comments on commit a04baf6

Please sign in to comment.