Apache James问题小记(apache-james安装机器以外的主机发邮件)

  一直以来都是把tomcat和apache james 放在一台机器上,发送邮件来完成注册,通知等功能。

  今天把tomcat部署在151的主机上,James部署在105的主机,151主机用105上面的james发邮件,结果未成功,提示javax.mail.AuthenticationFailedException,检查了用户名和密码,都是正确的。然后就开始检查配置文件,<servername></servername>是正确的,再往下看,<smtpserver></smtpserver>中有一个配置项<authRequired>true</authRequired>,以前都是按照网上的方法去配置,测试可用。

  再往下看,有这么一段说明:

If you use SMTP AUTH, addresses that match those specified here will
be permitted to relay without SMTP AUTH. If you do not use SMTP
AUTH, and you specify addreses here, then only addresses that match
those specified will be permitted to relay.

Addresses may be specified as a an IP address or domain name, with an
optional netmask, e.g.,

127.*, 127.0.0.0/8, 127.0.0.0/255.0.0.0, and localhost/8 are all the same

See also the RemoteAddrNotInNetwork matcher in the transport processor.
You would generally use one OR the other approach.

啊哈,就是这了。SMTP验证,原来是这里出错了,于是在

<authorizedAddresses>127.0.0.0/8</authorizedAddresses>

中添加了151主机的IP,重新发送,走一个,去邮箱查看,收到了!

posted @   代码撕裂者  阅读(661)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· SQL Server 2025 AI相关能力初探
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示