6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * Deletes a meesage from the IMAP server
14 require_once('../src/validate.php');
15 require_once('../functions/display_messages.php');
16 require_once('../functions/imap.php');
18 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
20 sqimap_mailbox_select($imapConnection, $mailbox);
22 sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
24 sqimap_mailbox_expunge($imapConnection, $mailbox, true);
26 if (!isset($saved_draft)) {
30 if (!isset($mail_sent)) {
34 $location = get_location();
35 if (isset($where) && isset($what)) {
36 header("Location: $location/search.php?where=" . urlencode($where) .
37 '&what=' . urlencode($what) . '&mailbox=' . urlencode($mailbox));
39 if ($compose_new_win == '1') {
40 header("Location: $location/compose.php?mail_sent=$mail_sent&saved_draft=$saved_draft");
43 header("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=" .
48 sqimap_logout($imapConnection);