Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4175410
  • 博文数量: 291
  • 博客积分: 8003
  • 博客等级: 大校
  • 技术积分: 4275
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-30 18:28
文章分类

全部博文(291)

文章存档

2017年(1)

2013年(47)

2012年(115)

2011年(121)

2010年(7)

分类: Java

2012-03-31 14:42:37

由于我服务器上的sendmail不好使,而postfix安装太麻烦,我安装了james
1.下载

点击(此处)折叠或打开

  1. wget
2.解压

点击(此处)折叠或打开

  1. tar -zxvf apache-james-2.3.2.tar.gz
  2. ln -s james-2.3.2 mailserver
3.运行
必须先运行一下,才能配置

点击(此处)折叠或打开

  1. cd james-2.3.2/
  2. chmod +x bin/*.sh
  3. vi bin/run.sh #在第一行加入export JAVA_HOME=/opt/java
  4. bin/run.sh

点击(此处)折叠或打开

  1. [root@dev6 james-2.3.2]# sh bin/run.sh
  2. Using PHOENIX_HOME: /opt/james-2.3.2
  3. Using PHOENIX_TMPDIR: /opt/james-2.3.2/temp
  4. Using JAVA_HOME: /opt/java
  5. Running Phoenix:
  6. Phoenix 4.2
  7. James Mail Server 2.3.2
  8. Remote Manager Service started plain:4555
  9. POP3 Service started plain:110
  10. SMTP Service started plain:25
  11. NNTP Service started plain:119
  12. FetchMail Disabled

ctrl+c 后这时apps/下多了一个james的目录
4.配置
1)配置dns服务器修改/etc/resolv.conf
2)看一下自己的ip:ipconfig
3)添加mx记录
4)修改apps/james/SAR-INF/config.xml
   
把autodetect和autodetectIP都改为false,这样我们就可以用test.com做测试了

点击(此处)折叠或打开

  1. false" autodetectIP="false">
  2. test.com
打开下面的注释,否则别人就可以不用密码使用你的邮箱了

点击(此处)折叠或打开

修改允许发送邮件的地址,若是想允许任何ip都可以发送邮件的话就注释掉

点击(此处)折叠或打开

  1. 192.168.60.*" class="ToProcessor">
  2. relay-denied
  3. 550 - Requested action not taken: relaying denied


修改dns服务器ip

点击(此处)折叠或打开

  1. 10.0.0.15
  2. 10.0.0.22
  3. false
修改管理员用户名和密码:

点击(此处)折叠或打开

  1. root" password="root"/>


保存后重新启动,注意若是sendmail已经启动,需要把sendmail关掉

点击(此处)折叠或打开

  1. /opt/mailserver/bin/run.sh >> /opt/mailserver/logs/run.log 2>&1 &
看一下25端口

点击(此处)折叠或打开

  1. [root@dev6 opt]# netstat -npl|grep 25
  2. tcp 0 0 0.0.0.0:892 0.0.0.0:* LISTEN 3254/rpc.statd
  3. tcp 0 0 :::25 :::* LISTEN 16449/java
  4. udp 0 0 0.0.0.0:886 0.0.0.0:* 3254/rpc.statd
  5. udp 0 0 0.0.0.0:889 0.0.0.0:* 3254/rpc.statd
5.创建用户
管理员为root,密码为root,在apps/james/SAR-INF/config.xml可以修改

点击(此处)折叠或打开

  1. [root@dev6 opt]# telnet localhost 4555
  2. Trying 192.168.60.6...
  3. Connected to localhost (192.168.60.6).
  4. Escape character is '^]'.
  5. JAMES Remote Administration Tool 2.3.2
  6. Please enter your login and password
  7. Login id:
  8. root
  9. Password:
  10. root
  11. Welcome root. HELP for a list of commands
  12. adduser yifangyou testpwd1s
  13. User yifangyou added
  14. quit
  15. Bye
  16. Connection closed by foreign host.

6.测试
在你本机的hosts表里加上

点击(此处)折叠或打开

  1. 192.168.60.6 test.com
发送成功!
阅读(5365) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~