コード例 #1
0
$query = isset($_REQUEST['query']) ? $_REQUEST['query'] : '';
$account = $email->get_account($account_id);
if ($account && $mail->open($account['host'], $account['type'], $account['port'], $account['username'], $GO_CRYPTO->decrypt($account['password']), $mailbox, 0, $account['use_ssl'], $account['novalidate_cert'])) {
    if ($task == 'move_mail') {
        $messages = array($uid);
        $move_to_mailbox = smartstrip($_REQUEST['move_to_mailbox']);
        if ($mail->move($move_to_mailbox, $messages) && $mail->reopen($move_to_mailbox)) {
            header('Location: ' . $GO_MODULES->url . 'index.php?account_id=' . $account_id . '&mailbox=' . $mailbox);
            exit;
        }
    }
    //sort messages for determination of previous and next message
    if ($query != '') {
        $mail->search($em_settings['sort_field'], $em_settings['sort_order'], base64_decode($query));
    } else {
        $mail->sort($em_settings['sort_field'], $em_settings['sort_order']);
    }
    $content = $mail->get_message($uid, 'html', $part);
    $subject = !empty($content["subject"]) ? $content["subject"] : $ml_no_subject;
} else {
    require $GO_THEME->theme_path . 'header.inc';
    echo '<table border="0" cellpadding="10" width="100%"><tr><td>';
    echo '<p class="Error">' . $ml_connect_failed . ' \'' . $account['host'] . '\' ' . $ml_at_port . ': ' . $account['port'] . '</p>';
    echo '<p class="Error">' . imap_last_error() . '</p>';
    require $GO_THEME->theme_path . 'footer.inc';
    exit;
}
//update notified mail state
if ($content["new"] == '1') {
    $_SESSION['notified_new_mail'] -= 1;
    $_SESSION['unseen_in_mailbox'] -= 1;