554 Message does not conform to standards
来源:互联网 发布:iphone录屏软件 编辑:程序博客网 时间:2024/06/05 10:06
今天,同事做java邮件发送功能时,外网邮箱发送一切正常,切换到内外邮箱发送邮件,报出 554 Message does not conform to standards错误。
刚开始以为是认证的问题,查了一下smtp协议,然后对比日志看了下,身份验证用login,还有md5的,认证通过了,就是在发送内容的时候,突然蹦了这么个信息。协议交互过程比对了半天,都正常,就是在发送的时候出问题。只能求救网络了,最先找到的信息就是说:发送方面没问题,服务器上的rfc验证没通过。关闭rfc验证即可。
不是太明白,继续搜寻,后来又看到这么一段话:
發現不是信件內容問題,後來搜尋了一下只要把符合RFC文件的勾拿掉就可以了!!
在setup–>Miscellaneous options–>Server–>取消SMTP Server Checks commands and headers for RFC Compliance
在去測試就可以收到信件!!
想到是不是发送的邮件内容不符合rfc文件标准,跟服务器设置的确有关系,这也可以解释为什么外网可以发送出去,内网不行了。
既然这样,改发送内容,符合rfc文件标准应该就可以了,带着这样的思路,搜索headers for RFC Compliance,看到http://lists.altn.com/WebX/.5985e696类似,说缺少date header
然后查找java如何添加mail header头
MimeMessage message = new MimeMessage(session);message.setContent("Hello", "text/plain");message.setHeader("Content-Type", "text/html; charset=UTF-8");message.setSentDate(new Date());
然后同事对照着改了下,添加了date头,ok,太激动了,回头测试去掉message.setSentDate(newDate());那个554 Message does not conform to standards错误又出来了,哈哈搞定。再切换到外网,也没问题。
总结:出现554 Message does not conform to standards,
原因就是:服务器上的rfc验证没通过,发送邮件内容不符合rfc文件标准,邮件需要增加date头信息。message.setSentDate(newDate())。至于rfc文件标准可再看看相关资料
另:本人不是搞java的,对java在探索中,主要对c/c++比较熟悉。在看到同事郁闷着这个问题时,正好没什么事情,就看看。期间自己也收获不少,越来越感觉到语言就是一种工具,解决问题的时候与语言无关,原理很重要,解决问题的思路很重要。与人为乐,何乐而不为呢
- 554 Message does not conform to standards
- swift:does not conform to protocol解决方法
- Certificates does not conform to algorithm constraints
- Certificates does not conform to algorithm constraints
- warning MIDL2039 : interface does not conform to [oleautomation] attribute : [ Parameter ... ...
- type 'CFString!' does not conform to protocol 'NSCopying'
- Certificates does not conform to algorithm constraints 异常的解决方法
- Xcode 报错: Type '**Controller' does not conform to '**Delegate
- Swift报错type ''does not conform to protocol 'UITableViewDataSource'
- Type 'ViewController' does not conform to protocol 'xxxdelegate'
- Swift3-Type 'String' does not conform to protocol 'Sequence'
- type 'simple Class' does not conform to protocol 'Example Protocol'错误
- Swift 实现UITableView报错, does not conform to protocol 'UITableViewDataSource'
- 编译ImageIO库type 'CFString!' does not conform to protocol 'NSCopying'
- Swift开发教程--实现UITableView报错does not conform to protocol 'UITableViewDataSource‘
- Swift Compiler Error Type 'int' does not conform to protocol 'Boolean Type'
- java.security.cert.CertificateException: Certificates does not conform to algorithm constraints
- Xcode 报错: value of type InerfaceController does not conform to HKWorkoutSessionDelegate in assignmen
- 17周项目二,1,(数组名做形参)
- HTML5 LocalStorage 本地存储
- 二叉树的遍历
- 火龙果
- 是否发生交换(2)
- 554 Message does not conform to standards
- 《黑客免杀攻防学习笔记》——反病毒软件与免杀原理
- WinDbg 查看函数的参数
- Quartz 实现机制
- ext3 ext4 gridpanel 列自动撑开
- 17周 项目1.1
- JCS实现项目缓存总结之二
- CFoundry::AppPackageInvalid: 150001: The app package is invalid: failed repacking application
- 二叉树的实现和遍历