- Added options to add/remove plugins from the commandline (#467108):
[squirrelmail.git] / src / delete_message.php
CommitLineData
59177427 1<?php
895905c0 2
35586184 3/**
4 * delete_message.php
5 *
15e6162e 6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
35586184 7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * Deletes a meesage from the IMAP server
10 *
11 * $Id$
12 */
ef870322 13
35586184 14/*****************************************************************/
15/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
16/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
17/*** + Base level indent should begin at left margin, as ***/
18/*** the require_once below looks. ***/
19/*** + All identation should consist of four space blocks ***/
20/*** + Tab characters are evil. ***/
21/*** + all comments should use "slash-star ... star-slash" ***/
22/*** style -- no pound characters, no slash-slash style ***/
23/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
24/*** ALWAYS USE { AND } CHARACTERS!!! ***/
25/*** + Please use ' instead of ", when possible. Note " ***/
26/*** should always be used in _( ) function calls. ***/
27/*** Thank you for your help making the SM code more readable. ***/
28/*****************************************************************/
29
30require_once('../src/validate.php');
31require_once('../functions/display_messages.php');
32require_once('../functions/imap.php');
d3cdb279 33
e1469126 34 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
d4467150 35
fe84f328 36 sqimap_mailbox_select($imapConnection, $mailbox);
37
a3cb3d5f 38 sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
acaa9842 39 if ($auto_expunge)
8cf653ad 40 sqimap_mailbox_expunge($imapConnection, $mailbox, true);
acaa9842 41
1195c340 42 $location = get_location();
9d7140c9 43 if (isset($where) && isset($what))
1809bad8 44 header ("Location: $location/search.php?where=".urlencode($where)."&what=".urlencode($what)."&mailbox=".urlencode($mailbox));
45 else
46 header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=".urlencode($mailbox));
a48fbf9b 47
48 sqimap_logout($imapConnection);
35586184 49?>