Apache James 搭建自己的邮件服务器,apachejames


 前提JDK已安装,环境已经配置好。

 

去官网下载http://james.apache.org/。我的是2.3.2版本的

 

解压后  进入 bin 目录下的 run.bat文件。启动   出现下面的界面  则成功了

[java] view plaincopy
  1. Using PHOENIX_HOME:   C:/apache-james-2.3.2/james-2.3.2  
  2. Using PHOENIX_TMPDIR: C:/apache-james-2.3.2/james-2.3.2/temp  
  3. Using JAVA_HOME:      C:/Program Files/Java/jdk1.5.0_20  
  4. Phoenix 4.2  
  5. James Mail Server 2.3.2  
  6. Remote Manager Service started plain:4555  
  7. POP3 Service started plain:110  
  8. SMTP Service started plain:25  
  9. NNTP Service started plain:119  
  10. FetchMail Disabled  

谢谢http://blog.csdn.net/zl3450341/article/details/5567948

 

关闭  ctrl+c

 

 

下一步  修改配置文件

 

进入james-2.3.1/apps/james/SAR-INF 下的 config.xml 文件

找到

 

[java] view plaincopy
  1. ……     
  2. <postmaster>Postmaster@localhost</postmaster>     
  3.  ……     
  4. <servernames autodetect="true" autodetectIP="true">     
  5.     <servername>localhost</servername>     
  6.  </servernames>     
  7.  ……     

 

修改为

 

[java] view plaincopy
  1. <postmaster>Postmaster@wisekernel.com</postmaster>  
  2.  <servernames autodetect="false" autodetectIP="false">  
  3. <!-- CONFIRM? -->  
  4.      <servername>wisekernel.com</servername>  
  5.   </servernames>  

 

如果你新建了一个账号 为citi,则你的邮件名为citi@wisekernel.com

 

 

找到

[java] view plaincopy
  1. <mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">  
  2.             <processor> relay-denied </processor>  
  3.             <notice>550 - Requested action not taken: relaying denied</notice>  
  4.          </mailet>  

将其注释掉

[java] view plaincopy
  1. <!--mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">  
  2.             <processor> relay-denied </processor>  
  3.             <notice>550 - Requested action not taken: relaying denied</notice>  
  4.          </mailet-->  

 

 

找到 去掉注释

[java] view plaincopy
  1. <authRequired>true</authRequired>  

 

如果想给外网发邮件

找到

[java] view plaincopy
  1. <dnsserver>  
  2.      <servers>  
  3.         <!--Enter ip address of your DNS server, one IP address per server -->  
  4.         <!-- element. -->  
  5.           
  6.          <server>202.101.172.35</server>  
  7.          
  8.      </servers>  
  9.      <!-- Change autodiscover to false if you would like to turn off autodiscovery -->  
  10.      <!-- and set the DNS servers manually in the <servers> section -->  
  11.      <autodiscover>true</autodiscover>  
  12.      <authoritative>false</authoritative>  
  13.      <!-- Maximum number of entries to maintain in the DNS cache -->  
  14.      <maxcachesize>50000</maxcachesize>  
  15.   </dnsserver>  

修改<server>202.101.172.35</server>  里面改为自己的dns   进入cmd ---  ipconfig/all--查看自己的dns

 

 

好了 config.xml修改完了

 

 

现在创建用户    run.bat别关了

cmd---telnet localhost 4555----root----root----adduser wise wise

就创建了一个用户名和密码都为wise的账号

 

账号则为 wise@wisekernel.com

 

发送邮件的代码 就给java发送邮件代码一样     改个邮箱就好了

 

 

 

相关内容

    暂无相关文章