-if (isset($_GET['mailbox'])) {
- $mailbox_array = $_GET['mailbox'];
- $targetmailbox = $_GET['mailbox'];
+/* when using compact paginator, mailbox might be indicated in $startMessage, so look for it now ($startMessage is then processed farther below) */
+$mailbox = '';
+$startMessage = '';
+if (sqGetGlobalVarMultiple('startMessage', $temp, 'paginator_submit', SQ_FORM)) {
+ if (strstr($temp, '_')) list($startMessage, $mailbox) = explode('_', $temp);
+ else $startMessage = $temp;
+}
+if (empty($mailbox)) sqGetGlobalVar('mailbox', $mailbox, SQ_GET, '');
+if (!empty($mailbox)) {
+ $mailbox_array = $mailbox;
+ $targetmailbox = $mailbox;