-/**
- * Path for SquirrelMail required files.
- * @ignore
- */
-define('SM_PATH','../');
-
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-include_once(SM_PATH . 'functions/display_messages.php');
-require_once(SM_PATH . 'functions/imap.php');
-
-/* get globals */
-sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
-
-sqgetGlobalVar('message', $message, SQ_FORM);
-sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
-
-sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_FORM);
-
-global $data_dir;
-/* end globals */
-
-/* get $compose_new_win */
-$compose_new_win=getPref($data_dir,$username,'compose_new_win',0);
-
-/**
- * Script is used when draft is saved again or sent.
- * browser should be redirected to compose.php (compose_new_win=1)
- * or right_main.php
- * Problem: drafts folder listing is not refreshed when
- * compose_new_win=1.
- */
-if (sqGetGlobalVar('saved_draft', $tmp, SQ_GET)) {
- $saved_draft = urlencode($tmp);
-}
-if (sqGetGlobalVar('mail_sent', $tmp, SQ_GET)) {
- $mail_sent = urlencode($tmp);
-}
-/**
- * Script is used in search page.
- * browser should be redirected to search.php
- * Is it really used in search page?
- */
-if (sqGetGlobalVar('where', $tmp, SQ_FORM)) {
- $where = urlencode($tmp);
-}
-if (sqGetGlobalVar('what', $tmp, SQ_FORM)) {
- $what = urlencode($tmp);
-}
-/**
- * FIXME: which part of code uses it?
- */
-if (sqGetGlobalVar('sort', $tmp, SQ_FORM)) {
- $sort = (int) $tmp;
-}
-if (sqGetGlobalVar('startMessage', $tmp, SQ_FORM)) {
- $startMessage = (int) $tmp;
-}
-
-$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
-
-// FIXME: unchecked use of variables.
-sqimap_mailbox_select($imapConnection, $mailbox);
-
-// FIXME: unchecked use of variables.
-sqimap_messages_delete($imapConnection, $message, $message, $mailbox,$bypass_trash);
-if ($auto_expunge) {
- sqimap_mailbox_expunge($imapConnection, $mailbox, true);
-}
-
-$location = get_location();