james开发经验

./run.sh启动james
然后ctrl+c关闭james配置apps/james/conf/config.xml
<postmaster>Postmaster@localhost</postmaster>
……
<servernames autodetect="false" autodetectIP="false">
<servername>localhost</servername>
</servernames>
设置域名
<dnsserver> <servers><server>DNS</server></servers></dnsserver>
设置DNS(cat /etc/resolv.conf linux下查看dns命令)
注释掉
<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">   
    <processor> relay-denied </processor>   
    <notice>550 - Requested action not taken: relaying denied</notice>   
</mailet> 

<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
<processor> relay-denied </processor>
<notice>550 - Requested action not taken: relaying denied</notice>
</mailet>  
解除注释
<authRequired>true</authRequired>

在发送邮件时。部分邮箱需要ssl验证,添加
props.setProperty("mail.smtp.starttls.enable","true");
启动验证

由于linux的防火墙可能导致无法连接james,开启linux端口
iptables -I INPUT -p tcp --dport 4555 -j ACCEPT

你可能感兴趣的:(C++,c,linux,xml,防火墙)