Ejemplo n.º 1
0
        $focus->column_fields['subject'] = "{$fwdstr}: " . $focus->column_fields['subject'];
    }
}
// Webmails
if (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"] != "") {
    $mailid = $_REQUEST["mailid"];
    $mailbox = $_REQUEST["mailbox"];
    require_once 'include/utils/UserInfoUtil.php';
    require_once "modules/Webmails/Webmails.php";
    require_once "modules/Webmails/MailParse.php";
    require_once 'modules/Webmails/MailBox.php';
    $mailInfo = getMailServerInfo($current_user);
    $temprow = $adb->fetch_array($mailInfo);
    $MailBox = new MailBox($mailbox);
    $mbox = $MailBox->mbox;
    $webmail = new Webmails($mbox, $mailid);
    $array_tab = array();
    $webmail->loadMail($array_tab);
    $hdr = @imap_headerinfo($mbox, $mailid);
    $smarty->assign('WEBMAIL', "true");
    $smarty->assign('mailid', $mailid);
    $smarty->assign('mailbox', $mailbox);
    $temp_id = $MailBox->boxinfo['mail_id'];
    $smarty->assign('from_add', $temp_id);
    $webmail->subject = utf8_decode(utf8_encode(imap_utf8($webmail->subject)));
    if ($_REQUEST["reply"] == "all") {
        $smarty->assign('TO_MAIL', $webmail->from . ",");
        //added to remove the emailid of webmail client from cc list....to fix the issue #3818
        $cc_address = '';
        $use_to_header = htmlentities($webmail->to_header, ENT_QUOTES, $default_charset);
        $use_cc_address = htmlentities($hdr->ccaddress, ENT_QUOTES, $default_charset);
Ejemplo n.º 2
0
 function insertIntoAttachment($id, $module)
 {
     global $log, $adb;
     $log->debug("Entering into insertIntoAttachment({$id},{$module}) method.");
     $file_saved = false;
     //Added to send generated Invoice PDF with mail
     $pdfAttached = $_REQUEST['pdf_attachment'];
     //created Invoice pdf is attached with the mail
     if (isset($_REQUEST['pdf_attachment']) && $_REQUEST['pdf_attachment'] != '') {
         $file_saved = pdfAttach($this, $module, $pdfAttached, $id);
     }
     //This is to added to store the existing attachment id of the contact where we should delete this when we give new image
     foreach ($_FILES as $fileindex => $files) {
         if ($files['name'] != '' && $files['size'] > 0) {
             $files['original_name'] = vtlib_purify($_REQUEST[$fileindex . '_hidden']);
             $file_saved = $this->uploadAndSaveFile($id, $module, $files);
         }
     }
     if ($module == 'Emails' && isset($_REQUEST['att_id_list']) && $_REQUEST['att_id_list'] != '') {
         $att_lists = explode(";", $_REQUEST['att_id_list'], -1);
         $id_cnt = count($att_lists);
         if ($id_cnt != 0) {
             for ($i = 0; $i < $id_cnt; $i++) {
                 $sql_rel = 'insert into vtiger_seattachmentsrel values(?,?)';
                 $adb->pquery($sql_rel, array($id, $att_lists[$i]));
             }
         }
     }
     if ($_REQUEST['att_module'] == 'Webmails') {
         require_once "modules/Webmails/Webmails.php";
         require_once "modules/Webmails/MailParse.php";
         require_once 'modules/Webmails/MailBox.php';
         //$mailInfo = getMailServerInfo($current_user);
         //$temprow = $adb->fetch_array($mailInfo);
         $MailBox = new MailBox($_REQUEST["mailbox"]);
         $mbox = $MailBox->mbox;
         $webmail = new Webmails($mbox, $_REQUEST['mailid']);
         $array_tab = array();
         $webmail->loadMail($array_tab);
         if (isset($webmail->att_details)) {
             foreach ($webmail->att_details as $fileindex => $files) {
                 if ($files['name'] != '' && $files['size'] > 0) {
                     //print_r($files);
                     $file_saved = $this->saveForwardAttachments($id, $module, $files);
                 }
             }
         }
     }
     $log->debug("Exiting from insertIntoAttachment({$id},{$module}) method.");
 }
Ejemplo n.º 3
0
 * The Initial Developer of the Original Code is FOSS Labs.
 * Portions created by FOSS Labs are Copyright (C) FOSS Labs.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ********************************************************************************/
include 'config.php';
require_once 'include/utils/UserInfoUtil.php';
require_once 'include/utils/utils.php';
require_once 'modules/Webmails/Webmails.php';
require_once 'modules/Webmails/MailBox.php';
global $MailBox, $mod_strings, $theme;
$theme_path = "themes/" . $theme . "/style.css";
$MailBox = new MailBox($_REQUEST["mailbox"]);
$mailid = vtlib_purify($_REQUEST["mailid"]);
$num = vtlib_purify($_REQUEST["num"]);
$email = new Webmails($MailBox->mbox, $mailid);
$attach_tab = array();
$email->loadMail($attach_tab);
echo "<html><head><title>" . $mod_strings['LBL_ATTACHMENTS'] . "</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $email->charsets . "\">\n";
echo "<script src='modules/Webmails/Webmails.js' type='text/javascript'></script>";
echo "<link REL='SHORTCUT ICON' HREF='include/images/vtigercrm_icon.ico'>";
echo "<style type='text/css'>@import url('{$theme_path}');</style>";
echo "</head><body>";
echo "<table class='small' width='100%' cellspacing='1' cellpadding='0' border='0' style='font-size:18px'>";
echo "<tr><td><table border=0 cellspacing=0 cellpadding=0 width=100% class='mailClientWriteEmailHeader'><tr><td >" . $mod_strings['LBL_ATTACHMENTS'] . "</td></tr></table></td></tr>";
if (count($email->attname) <= 0) {
    echo "<tr align='center'><td nowrap>" . $mod_strings['LBL_NO_ATTACHMENTS'] . "</td></tr>";
} else {
    for ($i = 0; $i < count($email->attname); $i++) {
        $attachment_links .= "&nbsp;&nbsp;&nbsp;&nbsp;" . $email->anchor_arr[$i] . $email->attname[$i] . "</a></br>";
Ejemplo n.º 4
0
        echo $mailid;
        flush();
        exit;
    }
    if ($command == "set_flag") {
        $MailBox = new MailBox($mailbox);
        $email = new Webmails($MailBox->mbox, $mailid);
        $email->setFlag();
        imap_close($MailBox->mbox);
        echo $mailid;
        flush();
        exit;
    }
    if ($command == "clear_flag") {
        $MailBox = new MailBox($mailbox);
        $email = new Webmails($MailBox->mbox, $mailid);
        $email->delFlag();
        imap_close($MailBox->mbox);
        echo $mailid;
        flush();
        exit;
    }
    imap_close($MailBox->mbox);
    flush();
    exit;
}
function cal_start($num_mails, $mail_per_page)
{
    if (isset($_REQUEST['start']) && $_REQUEST['start'] != 0) {
        $pre_start = $_REQUEST['start'];
        $cal = ($pre_start - 1) * $mail_per_page;
Ejemplo n.º 5
0
    $smarty->assign('BCC_MAIL', $bcc_add);
    $smarty->assign('IDLISTS', preg_replace('/###/', ',', $adb->query_result($result, 0, 'idlists')));
}
// Webmails
if (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"] != "") {
    $mailid = $_REQUEST["mailid"];
    $mailbox = $_REQUEST["mailbox"];
    require_once 'include/utils/UserInfoUtil.php';
    require_once "modules/Webmails/Webmails.php";
    require_once "modules/Webmails/MailParse.php";
    require_once 'modules/Webmails/MailBox.php';
    $mailInfo = getMailServerInfo($current_user);
    $temprow = $adb->fetch_array($mailInfo);
    $MailBox = new MailBox($mailbox);
    $mbox = $MailBox->mbox;
    $webmail = new Webmails($mbox, $mailid);
    $array_tab = array();
    $webmail->loadMail($array_tab);
    $hdr = @imap_headerinfo($mbox, $mailid);
    $smarty->assign('WEBMAIL', "true");
    $smarty->assign('mailid', $mailid);
    $smarty->assign('mailbox', $mailbox);
    $temp_id = $MailBox->boxinfo['mail_id'];
    $smarty->assign('from_add', $temp_id);
    $webmail->subject = utf8_decode(utf8_encode(imap_utf8($webmail->subject)));
    if ($_REQUEST["reply"] == "all") {
        $smarty->assign('TO_MAIL', $webmail->from . ",");
        //added to remove the emailid of webmail client from cc list....to fix the issue #3818
        $cc_address = '';
        $use_to_header = htmlentities($webmail->to_header, ENT_QUOTES, $default_charset);
        $use_cc_address = htmlentities($hdr->ccaddress, ENT_QUOTES, $default_charset);
Ejemplo n.º 6
0
global $app_strings;
global $mod_strings;
if (isset($_REQUEST["mailbox"]) && $_REQUEST["mailbox"] != "") {
    $mailbox = vtlib_purify($_REQUEST["mailbox"]);
} else {
    $mailbox = "INBOX";
}
if (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"] != "") {
    $mailid = vtlib_purify($_REQUEST["mailid"]);
} else {
    echo "ERROR";
    flush();
    exit;
}
//JFV - convert back html special char
$mailbox = htmlspecialchars_decode($mailbox);
//JFV END
global $MailBox;
$MailBox = new MailBox($mailbox);
$webmail = new Webmails($MailBox->mbox, $mailid);
$elist = $MailBox->mailList["overview"][$mailid - 1];
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0" class="previewWindow"><tr>';
echo '<td>';
echo '</td></tr>';
$array_tab = array();
$webmail->loadMail($array_tab);
//JFV urlencode mailbox name for mail iframe contents
echo '<tr><td align="center"><iframe src="index.php?module=Webmails&action=body&fullview=true&mailid=' . $mailid . '&mailbox=' . urlencode($mailbox) . '" width="100%" height="600" frameborder="0" style="border:1px solid gray">' . $mod_strings['LBL_NO_IFRAMES_SUPPORTED'] . '</iframe></td></tr>';
//echo '<tr><td align="center"><iframe src="index.php?module=Webmails&action=body&fullview=true&mailid='.$mailid.'&mailbox='.$mailbox.'" width="100%" height="600" frameborder="0" style="border:1px solid gray">'.$mod_strings['LBL_NO_IFRAMES_SUPPORTED'].'</iframe></td></tr>';
//JFV END
echo '</table>';
Ejemplo n.º 7
0
require_once 'modules/Settings/MailScanner/core/MailAttachmentMIME.php';
global $current_user;
$local_log =& LoggerManager::getLogger('index');
$focus = new Emails();
$to_address = explode(";", $_REQUEST['to_list']);
$cc_address = explode(";", $_REQUEST['cc_list']);
$bcc_address = explode(";", $_REQUEST['bcc_list']);
$start_message = vtlib_purify($_REQUEST["start_message"]);
if ($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {
    $mailbox = vtlib_purify($_REQUEST["mailbox"]);
} else {
    $mailbox = "INBOX";
}
$MailBox = new MailBox($mailbox);
$mail = $MailBox->mbox;
$email = new Webmails($MailBox->mbox, $_REQUEST["mailid"]);
$subject = imap_utf8($email->subject);
$date = $email->date;
$array_tab = array();
$email->loadMail($array_tab);
$msgData = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', "", $email->body);
$content['attachtab'] = $email->attachtab;
while ($tmp = array_pop($content['attachtab'])) {
    if (!preg_match('/ATTACHMENT/i', $tmp['disposition']) && $conf->display_text_attach && preg_match('/text\\/plain/i', $tmp['mime'])) {
        $msgData .= '<hr />' . view_part_detail($mail, $mailid, $tmp['number'], $tmp['transfer'], $tmp['charset'], $charset);
    }
}
$focus->column_fields['subject'] = $subject;
$focus->column_fields["activitytype"] = "Emails";
$ddate = date("Y-m-d", strtotime($date));
$dtime = date("h:m");