diff options
author | alecpl <alec@alec.pl> | 2011-12-07 08:44:48 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-12-07 08:44:48 +0000 |
commit | 40c45e9de99186eda203a925c09424a3a8ec103c (patch) | |
tree | 66d59cf5b1aeb38a701976aed8aa97cbb6f00576 /program/steps/mail/sendmail.inc | |
parent | 86130d6366a18cf3d558d64f67bcf410ff5f0fc2 (diff) |
- Fixed issues with big memory allocation of IMAP results, improved a lot of rcube_imap class
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r-- | program/steps/mail/sendmail.inc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 64deb73d8..0da1ee342 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -701,11 +701,11 @@ if ($store_target) { if ($olddraftmessageid) { // delete previous saved draft // @TODO: use message UID (remember to check UIDVALIDITY) to skip this SEARCH - $a_deleteid = $IMAP->search_once($CONFIG['drafts_mbox'], - 'HEADER Message-ID '.$olddraftmessageid, true); + $delete_idx = $IMAP->search_once($CONFIG['drafts_mbox'], + 'HEADER Message-ID '.$olddraftmessageid); - if (!empty($a_deleteid)) { - $deleted = $IMAP->delete_message($a_deleteid, $CONFIG['drafts_mbox']); + if ($del_uid = $delete_idx->getElement('FIRST')) { + $deleted = $IMAP->delete_message($del_uid, $CONFIG['drafts_mbox']); // raise error if deletion of old draft failed if (!$deleted) @@ -726,8 +726,8 @@ if ($savedraft) { // remember new draft-uid ($saved could be an UID or TRUE here) if (is_bool($saved)) { - $draftuids = $IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid, true); - $saved = $draftuids[0]; + $draft_idx = $IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid); + $saved = $draft_idx->getElement('FIRST'); } $COMPOSE['param']['draft_uid'] = $saved; |