Yet Another NOCC-开源

  • z8_740772
    了解作者
  • 144.5KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-02 19:31
    上传日期
YANOCC是一个简单,快速的Webmail客户端,可以处理POP3,SMTP和IMAP服务器。 YANOCC基于NOCC的代码,并使用PHP4编写。 它具有多语言支持,MIME附件,显示HTML消息,通讯簿和文件夹支持。
yanocc-0.1.0.zip
内容介绍
<?php /* * Copyright 2001 Julien Tessier <jt@chezjulien.com> * Some parts: * Copyright 2001 Nicolas CHALANSET <nicocha@free.fr> * Copyright 2001 Olivier Cahagne <cahagn_o@epita.fr> * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */ $attach_tab = Array(); /* ----------------------------------------------------- */ function inbox($servr, $user, $passwd, $folder, $sort, $sortdir, $lang, $theme) { $mailhost = $servr; require('conf.php'); $pop = @imap_open('{' . $mailhost . '}' . $folder, $user, $passwd); if ($pop == false) return (-1); else { if (($num_messages = @imap_num_msg($pop)) == 0) { imap_close($pop); return (0); } else { //if ($sort != '' && $sortdir != '') $sorted = imap_sort($pop, $sort, $sortdir, SE_UID); for ($i = 0; $i < $num_messages; $i++) { $subject = $from = ''; $msgnum = $sorted[$i]; $ref_contenu_message = imap_header($pop, imap_msgno($pop, $msgnum)); $struct_msg = imap_fetchstructure($pop, imap_msgno($pop, $msgnum)); $subject_array = imap_mime_header_decode($ref_contenu_message->subject); for ($j = 0; $j < count($subject_array); $j++) $subject .= $subject_array[$j]->text; $from_array = imap_mime_header_decode($ref_contenu_message->fromaddress); for ($j = 0; $j < count($from_array); $j++) $from .= $from_array[$j]->text; if (is_Imap($mailhost)) $msg_size = get_mail_size($struct_msg); else $msg_size = ($struct_msg->bytes > 1000) ? ceil($struct_msg->bytes / 1000) : 1; if ($struct_msg->type == 1) { if ($struct_msg->subtype == 'ALTERNATIVE' || $struct_msg->subtype == 'RELATED') $attach = '&nbsp;'; else $attach = ''; } else $attach = '&nbsp;'; // Check Status Line with UCB POP Server to // see if this is a new message. This is a // non-RFC standard line header. // Set this in conf.php if ($have_ucb_pop_server) { $header_msg = imap_fetchheader($pop, imap_msgno($pop, $msgnum)); $header_lines = explode("\r\n", $header_msg); while (list($k, $v) = each($header_lines)) { list ($header_field, $header_value) = explode(':', $v); if ($header_field == 'Status') $new_mail_from_header = $header_value; } } else { if (($ref_contenu_message->Unseen == 'U') || ($ref_contenu_message->Recent == 'N')) $new_mail_from_header = ''; else $new_mail_from_header = '&nbsp;'; } if ($new_mail_from_header == '') $newmail = ''; else $newmail = '&nbsp;'; $msg_list[$i] = Array( 'new' => $newmail, 'number' => imap_msgno($pop, $msgnum), 'next' => imap_msgno($pop, $sorted[$i + 1]), 'prev' => imap_msgno($pop, $sorted[$i - 1]), 'attach' => $attach, 'from' => htmlspecialchars($from), 'subject' => htmlspecialchars($subject), 'date' => change_date(chop($ref_contenu_message->udate), $lang), 'size' => $msg_size, 'sort' => $sort, 'sortdir' => $sortdir); } imap_close($pop); return ($msg_list); } } } /* ----------------------------------------------------- */ function aff_mail($servr, $user, $passwd, $folder, $mail, $verbose, $lang, $sort, $sortdir) { $mailhost = $servr; require ('conf.php'); require ('check_lang.php'); GLOBAL $attach_tab; GLOBAL $PHP_SELF; $glob_body = ''; $subject = $from = $to = $cc = ''; if (setlocale (LC_TIME, $lang_locale) != $lang_locale) $default_date_format = $no_locale_date_format; $current_date = strftime($default_date_format, time()); $pop = @imap_open('{' . $mailhost . '}' . $folder, $user, $passwd); // Finding the next and previous message number $sorted = imap_sort($pop, $sort, $sortdir); for ($i = 0; $i < sizeof($sorted); $i++) { if ($mail == $sorted[$i]) { $prev_msg = $sorted[$i - 1]; $next_msg = $sorted[$i + 1]; break; } } // END finding the next and previous message number $num_messages = @imap_num_msg($pop); $ref_contenu_message = @imap_header($pop, $mail); $struct_msg = @imap_fetchstructure($pop, $mail); if (sizeof($struct_msg->parts) > 0) GetPart($struct_msg, NULL, $display_rfc822); else GetSinglePart($struct_msg, htmlspecialchars(imap_fetchheader($pop, $mail)), @imap_body($pop, $mail)); if ($verbose == 1 && $use_verbose == 1) $header = htmlspecialchars(imap_fetchheader($pop, $mail)); else $header = ''; $tmp = array_pop($attach_tab); if (eregi('text/html', $tmp['mime']) || eregi('text/plain', $tmp['mime'])) { if ($tmp['transfer'] == 'QUOTED-PRINTABLE') $glob_body = imap_qprint(imap_fetchbody($pop, $mail, $tmp['number'])); elseif ($tmp['transfer'] == 'BASE64') $glob_body = base64_decode(imap_fetchbody($pop, $mail, $tmp['number'])); else $glob_body = imap_fetchbody($pop, $mail, $tmp['number']); $glob_body = remove_stuff($glob_body, $lang, $tmp['mime']); } else array_push($attach_tab, $tmp); @imap_close($pop); if ($struct_msg->subtype != 'ALTERNATIVE' && $struct_msg->subtype != 'RELATED') { switch (sizeof($attach_tab)) { case 0: $link_att = ''; break; case 1: $link_att = '<tr><td align="right" valign="top" class="mail">' . $html_att . '</td><td bgcolor="' . $glob_theme->mail_properties . '" class="mail">' . link_att($mailhost, $mail, $attach_tab, $display_part_no) . '</td></tr>'; break; default: $link_att = '<tr><td align="right" valign="top" class="mail">' . $html_atts . '</td><td bgcolor="' . $glob_theme->mail_properties . '" class="mail">' . link_att($mailhost, $mail, $attach_tab, $display_part_no) . '</td></tr>'; break; } } $subject_array = imap_mime_header_decode($ref_contenu_message->subject); for ($j = 0; $j < count($subject_array); $j++) $subject .= $subject_array[$j]->text; $from_array = imap_mime_header_decode($ref_contenu_message->fromaddress); for ($j = 0; $j < count($from_array); $j++) $from .= $from_array[$j]->text; $to_array = imap_mime_header_decode($ref_contenu_message->toaddress); for ($j = 0; $j < count($to_array); $j++) $to .= $to_array[$j]->text; $cc_array = imap_mime_header_decode($ref_contenu_message->ccaddress); for ($j = 0; $j < count($cc_array); $j++) $cc .= $cc_array[$j]->text; $content = Array( 'from' => htmlspecialchars($from), 'to' => htmlspecialchars($to), 'cc' => htmlspecialchars($cc), 'subject' => htmlspecialchars($subject), 'date' => change_date(chop($ref_contenu_message->udate), $lang), 'att' => $link_att, 'body' => $glob_body, 'body_mime' => $tmp['mime'], 'body_transfer' => $tmp['transfer'], 'header' => $header, 'verbose' => $verbose, 'prev' => $prev_msg, 'next' => $next_msg); return ($content); } /* ----------------------------------------------------- */ // based on a function from matt@bonneau.net function GetPart($this_part, $part_no, $display_rfc822) { GLOBAL $attach_tab; $att_name = '[unknown]'; if ($this_part->ifdescription == TRUE) $att_name = $this_part->description; for ($lcv = 0; $lcv < count($this_part->parameters); $lcv++) { $param = $this_part->parameters[$lcv]; if (($param->attribute == 'NAME') || ($param->attribute == 'name')) { $att_name = $param->value; break; } } switch ($this_part->type) { case TYPETEXT: $mime_type = 'text'; break; case TYPEMULTIPART: $mime_type = 'multipart'; for ($i = 0; $i < count($this_part->parts); $i++) { if ($part_no != '') $part_no = $part_no . '.'; for ($i = 0; $i < count($this_part->parts); $i++) { // if it's an alternative, we skip the text part to only keep the HTML part if ($this_part->subtype == ALTERNATIVE)// && $read == true) GetPart($this_part->parts[++$i], $part_no . ($i +
评论
    相关推荐
    • PHP 简易服务器
      PHP简易服务器PHP简易服务器PHP简易服务器PHP简易服务器PHP简易服务器
    • 无敌服务器php配置文件
      无敌服务器php配置文件| 无敌服务器php配置文件
    • mqtt协议推送服务器php
      好的运用,请大家一起分享,方便php后台和android的国通
    • wifidog认证服务器php脚本
      php编写的wifidog认证服务器脚本,主要实现了用户的登录校验和认证授权。
    • phoenix:HTTP服务器PHP扩展
      phoenix是用于PHP扩展的HTTP服务器 <?php function work_cb ( PhxClient $ client ) { $ name = $ client -> getUriArg ( 'name' ); $ client -> status ( 200 ); $ client -> sendHeader ( "connection: ...
    • php代理服务器 php反代 网页代理
      将upload文件夹下文件放到你的服务器上 这样就可以通过你的服务器访问网页了 很好用 也可以用于简单的 甚至是进入局域网
    • 易语言PHP服务器
      易语言PHP服务器源码,PHP服务器,监听服务,编码转换程序,进制转换,取页面地址,取域名,取端口,取指定内容中间,取文本之间,取文本之后,ChrW,十到十六,到十六进制文本,去除首部零,URL编码_UTF8,Ansi转Utf8,Unicode转Utf8...
    • window2003服务器php环境配置
      此文件包含了文档和文件,一条龙服务,绝对一次成功
    • 服务器php环境搭建(phpwamp服务器集成环境下载)
      服务器php环境搭建(phpwamp服务器集成环境下载)
    • 易语言PHP服务器
      易语言PHP服务器源码系统结构:监听服务,编码转换程序,进制转换,取页面地址,取域名,取端口,取指定内容中间,取文本之间,取文本之后,ChrW,十到十六,到十六进制文本,去除首部零,URL编码