From: stekkel Date: Sat, 11 Feb 2006 11:33:46 +0000 (+0000) Subject: Fix for #550557 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bda07b93ab2b94665bb7647a0694dbdd60aba2af;p=squirrelmail.git Fix for #550557 Do not try to set the \Answered flag if PERMANENTFLAGS doesn't advertise \Answered. PERMANENTFLAGS contain the flags that can be toggled in the selected mailbox git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10704 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/compose.php b/src/compose.php index c2ed4e22..e0ef1378 100644 --- a/src/compose.php +++ b/src/compose.php @@ -1695,15 +1695,17 @@ function deliverMessage($composeMessage, $draft=false) { $composeMessage->purgeAttachments(); if ($action == 'reply' || $action == 'reply_all') { $aMailbox = sqm_api_mailbox_select($imap_stream, $iAccount, $mailbox,array('setindex' => $what, 'offset' => $startMessage),array()); - //sqimap_mailbox_select ($imap_stream, $mailbox); - $aUpdatedMsgs = sqimap_toggle_flag($imap_stream, array($passed_id), '\\Answered', true, false); - if (isset($aUpdatedMsgs[$passed_id]['FLAGS'])) { - /** - * Only update the cached headers if the header is - * cached. - */ - if (isset($aMailbox['MSG_HEADERS'][$passed_id])) { - $aMailbox['MSG_HEADERS'][$passed_id]['FLAGS'] = $aMsg['FLAGS']; + // check if we are allowed to set the \\Answered flag + if (in_array('\\answered',$aMailbox['PERMANENTFLAGS'], true)) { + $aUpdatedMsgs = sqimap_toggle_flag($imap_stream, array($passed_id), '\\Answered', true, false); + if (isset($aUpdatedMsgs[$passed_id]['FLAGS'])) { + /** + * Only update the cached headers if the header is + * cached. + */ + if (isset($aMailbox['MSG_HEADERS'][$passed_id])) { + $aMailbox['MSG_HEADERS'][$passed_id]['FLAGS'] = $aMsg['FLAGS']; + } } } /**