一直没有在linux下安装过mail,最近百度了许久总算有些了解
希望对大家有所帮助,本文比较简单大家不要喷,我也只是做个记录
系统是洁净的ubuntu 10.4 ,只装了一个openssh.
下面开始安装postfix
- apt-get install postfix
一句命令就好了,下载回来安装时都选择默认的,因为都可以在配置文件里修改
安装完之后你会发现25端口已经开启
- root@ubuntu2:~# netstat -ntlp
- Active Internet connections (only servers)
- Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
- tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 881/sshd
- tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2102/master
- tcp6 0 0 :::22 :::* LISTEN 881/sshd
然后就是开始测试了
测试发件功能
- root@ubuntu2:~# telnet localhost 25
- Trying 127.0.0.1...
- Connected to localhost.
- Escape character is '^]'.
- 220 ubuntu2.localdomain ESMTP Postfix (Ubuntu)
- HELO localhost
- 250 ubuntu2.localdomain
- MAIL FROM:xiaobai
- 250 2.1.0 Ok
- RCPT TO:root
- 250 2.1.5 Ok
- DATA
- 354 End data with <CR><LF>.<CR><LF>
- HELLO!TEST
- .
- 250 2.0.0 Ok: queued as 06A113FE62
- QUIT
- 221 2.0.0 Bye
- Connection closed by foreign host.
- You have mail in /var/mail/root
- root@ubuntu2:~#
OK 正常 本机收发正常
好了 在这里需要提一下的是 postfix 是一个MTA程序 ,它并不提供pop3 imap功能,所以暂时来说,只能在服务进行邮件直接操作。
转载于:https://blog.51cto.com/rzl01/598480