lumisoft邮件头不规范造成内容无法读取
解决邮件内容为multipart,并且Param_Boundary等于null的不规范邮件内容无法读取问题,这样的邮件内容头部往往带两个或多个ContentType。
红色为自己加的,绿色为注释掉原来的。
修改MIME_h_Collection.cs文件
#region method GetFirst
/// <summary>
/// Gets first header field with the specified name. returns null if specified header field doesn't exist.
/// </summary>
/// <param name="name">Header field name.</param>
/// <returns>Returns first header field with the specified name. returns null if specified header field doesn't exist.</returns>
/// <exception cref="ArgumentNullException">Is raised when <b>name</b> is null reference.</exception>
public MIME_h GetFirst(string name)
{
if(name == null){
throw new ArgumentNullException("name");
}
List<MIME_h> rl= m_pFields.FindAll(x => x.Name == name);
if (rl.Count > 0)
{
if (name != "Content-Type") return rl[0];
foreach (MIME_h field in rl)
{
if (!(field is MIME_h_ContentType))
{
throw new ParseException("Header field 'ContentType' parsing failed.");
}
MIME_h_ContentType h = (MIME_h_ContentType)field;
if (h.Type == "multipart" && h.Param_Boundary == null) continue;
return field;
}
}
//
//foreach (MIME_h field in m_pFields.ToArray())
//{
// if (string.Equals(name, field.Name, StringComparison.InvariantCultureIgnoreCase))
// {
// return field;
// }
//}
return null;
}
#endregion
lumisoft邮件头不规范造成内容无法读取的更多相关文章
- python开发_email_读取邮件头信息
在python中的类库中,python自带了email模块. 在email模块中,我们可以email类库实现对邮件的读取,和邮件的发送等功能. 本文先来谈谈在python中,利用email模块读取邮件 ...
- 教你看懂邮件头信息<转载>
MIME对于邮件系统的扩展是巨大的,因为在MIME出现以前,信件内容如果要包括声音和动画,就必须把它变为ASCII码或把二进制的信息变成可以传送的编码标准,而接收方必须经过解码才可以获得声音和图画信息 ...
- postfix 如何设置邮件头翻译的功能
开始按http://semi-legitimate.com/blog/item/how-to-rewrite-outgoing-address-in-postfix 博客中的方法进行设置,是可以替换, ...
- LumiSoft 邮件操作删除(无法删除解决方法)
最近在用 LumiSoft 进行邮件读取,然后操作相关附件邮件使用的是qq邮箱,读取后进行移除,但是怎么都移除不了 后来咨询了官方客服,原来是设置不对 需要 取消掉 X禁止收信软件删信 (仅对 PO ...
- Android基础笔记(十四)- 内容提供者读取联系人
利用内容提供者读取联系人 利用内容提供者插入联系人 内容观察者的原理 利用内容观察者监听系统应用数据库或者自己应用数据库的变化 利用内容提供者读取联系人 读取联系人相对于读取短信来说就复杂非常多了,我 ...
- 【ThinkPHP学习】ThinkPHP自己主动转义存储富文本编辑器内容导致读取出错
RT. ThinkPHP的conf文件里的Convention.php有一个配置选项 'DEFAULT_FILTER' => 'htmlspecialchars', // 默认參数过滤方法 用于 ...
- postfix 设置邮件头翻译,本域邮件不进行邮件头翻译,仅发送至外网的进行邮件头翻译?
postfix 设置邮件头翻译,本域邮件不进行邮件头翻译,仅发送至外网的进行邮件头翻译? 现在设置的 smtp_generic_maps = hash:/etc/postfix/generic sen ...
- 使用FileStream向txt格式的文本文件 "追加" 新内容并读取
原文:使用FileStream向txt格式的文本文件 "追加" 新内容并读取 //得到文件路径. static string filePath = AppDomain.Curren ...
- lumisoft邮件内容中文乱码问题
修改MIME_b_Text.cs文件,红色字体为添加的部分,绿色为修改部分 private static Encoding m_pEncoding = Encoding.Default; #regio ...
随机推荐
- LeetCode解题报告—— Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...
- Balanced Binary Tree——经典题
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary ...
- Python软件源PyPI中国镜像 2016
作为 easy_install 的升级版,pip 为 Pyhton 的包管理提供了极大的方便.一行命令即可完成所需模块的安装: pip install pandas 可是官方镜像的访问速度相当慢,几乎 ...
- Nginx设置默认目录
server { listen ; server_name basic.com; index index.html index.htm index.php; root /www/wwwroot/bas ...
- PHP策略设计模式
<?php /** 抽象策略角色,以接口实现 */ interface Strategy { /** 算法接口 */ public function algorithmInterface(); ...
- HDU 2089 不要62【数位DP入门题】
不要62 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- Windows命令远程执行工具Winexe
Windows命令远程执行工具Winexe 在对Windows系统执行渗透测试中,通过各种方式可以获取目标主机的用户名和密码.这时,只要对方主机开启文件共享服务,就可以借助Winexe工具远程执行 ...
- android View post(Runnable runnable ) 新线程
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha View post(Runnable runnable ) 方法 不会 创建 新线程, ...
- Codeforces #447 Div.2 Tutorial
Problem A:QAQ 给一个字符串,求出可非连续的QAQ序列有多少个. Analysis:比较水的一道题,记录每一个Q的位置,预处理A的个数即可 然而还是fst了,原因是未考虑一个Q都没有的极端 ...
- 【二分】Subsequence
[POJ3061]Subsequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15908 Accepted: ...