Apache James 搭建自己的邮件服务器,apachejames
Apache James 搭建自己的邮件服务器,apachejames
前提JDK已安装,环境已经配置好。
去官网下载http://james.apache.org/。我的是2.3.2版本的
解压后 进入 bin 目录下的 run.bat文件。启动 出现下面的界面 则成功了
[java] view plaincopy
- Using PHOENIX_HOME: C:/apache-james-2.3.2/james-2.3.2
- Using PHOENIX_TMPDIR: C:/apache-james-2.3.2/james-2.3.2/temp
- Using JAVA_HOME: C:/Program Files/Java/jdk1.5.0_20
- Phoenix 4.2
- James Mail Server 2.3.2
- Remote Manager Service started plain:4555
- POP3 Service started plain:110
- SMTP Service started plain:25
- NNTP Service started plain:119
- 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
- ……
- <postmaster>Postmaster@localhost</postmaster>
- ……
- <servernames autodetect="true" autodetectIP="true">
- <servername>localhost</servername>
- </servernames>
- ……
修改为
[java] view plaincopy
- <postmaster>Postmaster@wisekernel.com</postmaster>
- <servernames autodetect="false" autodetectIP="false">
- <!-- CONFIRM? -->
- <servername>wisekernel.com</servername>
- </servernames>
如果你新建了一个账号 为citi,则你的邮件名为citi@wisekernel.com
找到
[java] view plaincopy
- <mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
- <processor> relay-denied </processor>
- <notice>550 - Requested action not taken: relaying denied</notice>
- </mailet>
将其注释掉
[java] view plaincopy
- <!--mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
- <processor> relay-denied </processor>
- <notice>550 - Requested action not taken: relaying denied</notice>
- </mailet-->
找到 去掉注释
[java] view plaincopy
- <authRequired>true</authRequired>
如果想给外网发邮件
找到
[java] view plaincopy
- <dnsserver>
- <servers>
- <!--Enter ip address of your DNS server, one IP address per server -->
- <!-- element. -->
- <server>202.101.172.35</server>
- </servers>
- <!-- Change autodiscover to false if you would like to turn off autodiscovery -->
- <!-- and set the DNS servers manually in the <servers> section -->
- <autodiscover>true</autodiscover>
- <authoritative>false</authoritative>
- <!-- Maximum number of entries to maintain in the DNS cache -->
- <maxcachesize>50000</maxcachesize>
- </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发送邮件代码一样 改个邮箱就好了
评论暂时关闭