由于我服务器上的sendmail不好使,而postfix安装太麻烦,我安装了james
1.下载
2.解压
- tar -zxvf apache-james-2.3.2.tar.gz
- ln -s james-2.3.2 mailserver
3.运行
必须先运行一下,才能配置
- cd james-2.3.2/
- chmod +x bin/*.sh
- vi bin/run.sh #在第一行加入export JAVA_HOME=/opt/java
- bin/run.sh
- [root@dev6 james-2.3.2]# sh bin/run.sh
- Using PHOENIX_HOME: /opt/james-2.3.2
- Using PHOENIX_TMPDIR: /opt/james-2.3.2/temp
- Using JAVA_HOME: /opt/java
- Running Phoenix:
-
- 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
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做测试了
- false" autodetectIP="false">
- test.com
-
打开下面的注释,否则别人就可以不用密码使用你的邮箱了
修改允许发送邮件的地址,若是想允许任何ip都可以发送邮件的话就注释掉
- 192.168.60.*" class="ToProcessor">
- relay-denied
- 550 - Requested action not taken: relaying denied
-
修改dns服务器ip
-
- 10.0.0.15
- 10.0.0.22
-
- false
修改管理员用户名和密码:
保存后重新启动,注意若是sendmail已经启动,需要把sendmail关掉
- /opt/mailserver/bin/run.sh >> /opt/mailserver/logs/run.log 2>&1 &
看一下25端口
- [root@dev6 opt]# netstat -npl|grep 25
- tcp 0 0 0.0.0.0:892 0.0.0.0:* LISTEN 3254/rpc.statd
- tcp 0 0 :::25 :::* LISTEN 16449/java
- udp 0 0 0.0.0.0:886 0.0.0.0:* 3254/rpc.statd
- udp 0 0 0.0.0.0:889 0.0.0.0:* 3254/rpc.statd
5.创建用户管理员为root,密码为root,在apps/james/SAR-INF/config.xml可以修改
- [root@dev6 opt]# telnet localhost 4555
- Trying 192.168.60.6...
- Connected to localhost (192.168.60.6).
- Escape character is '^]'.
- JAMES Remote Administration Tool 2.3.2
- Please enter your login and password
- Login id:
- root
- Password:
- root
- Welcome root. HELP for a list of commands
- adduser yifangyou testpwd1s
- User yifangyou added
- quit
- Bye
- Connection closed by foreign host.
6.测试
在你本机的hosts表里加上
发送成功!
阅读(5438) | 评论(0) | 转发(0) |