if (!is_array($msgs)) { settype($msgs, 'array'); } if (isset($_REQUEST['msgmove'])) { $msgmove = $_REQUEST['msgmove']; } $mail = new GetMail(array('Username' => $atmail->username, 'Pop3host' => $atmail->pop3host, 'Password' => $auth->password, 'Type' => $atmail->MailType, 'Mode' => $atmail->Mode)); $status = $mail->login(); // We have an error while logging in. Tell the user if ($status) { print $atmail->parse("html/{$atmail->Language}/auth_misc.html", array('status' => "Remote mail-server not responding - Check connection - {$status}")); $mail->quit(); $atmail->end(); } // Receive the list of mailbox folders $folders = GetMail::_sort_folders($mail->listfolders()); // Make sure the requested folder exists (help avoid XSS etc) if (!empty($var['folder']) && !in_array($var['folder'], $folders)) { die("requested folder does not exist"); } $fol = array(); // Create the select box for moving messages to another folder $var['folderbox'] = $mail->folder_select($var['folder'], $folders); $var['folderbox'] = $mail->folder_select_lang($var['folderbox'], $atmail->Language); // By default, we want to move to Trash $var['folderbox'] = str_replace("value=\"Trash\"", "value=\"Trash\" selected", $var['folderbox']); // If the user has set the messages to another flag; update the UIDL database. if ($var['flag'] && $msgs[0]) { $c = 0; foreach ($msgs as $id) { $folder = urldecode($_REQUEST['folders'][$c]);
if (strtotime("+ 180 seconds") > fileatime($file_name)) { unlink($file_name); } } } closedir($handle); } // If we have expunge on logout ( e.g PDMF IMAP server) if ($pref['expunge_logout'] == '1') { $atmail->status = $auth->getuser($atmail->SessionID); $atmail->loadprefs(1); require_once 'GetMail.php'; $mail = new GetMail(array('Username' => $atmail->username, 'Pop3host' => $atmail->pop3host, 'Password' => $auth->password, 'Mode' => $atmail->Mode, 'Type' => $atmail->MailType)); if ($atmail->MailType == 'imap') { $mail->login(); $folders = $mail->listfolders(); // Create a new folder-tree element $mail->newfolder_tree(); // Loop through each of the folders foreach ($folders as $folder) { $mail->expunge($folder); } } } session_destroy(); } $var['Ajax'] = '1'; $var['error'] = $_REQUEST['error']; $atmail->LoginType = "simple"; $atmail->Ajax = '1'; $atmail->Language = 'english';