: 192.168.0.114 (ubutun)
测试客户端 : 192.168.0.80 (windows 7)
三,配置收信服务器
1.修改邮件服务器的hosts文件
在文件中添加
2.修改测试客户端的hosts文件
以管理员权限运行一个文本编辑器,打开"C:\Windows\System32\drivers\etc\hosts",在里面添加
- 192.168.0.114 dotuian.com
如果已经存在域名了,就不要上述的修改hosts文件的两步了。
3.安装收信服务器
- apt-get install courier-pop
- apt-get install courier-imap
4.修改配置文件
(a)将域名增加到"mydestination"。配置如下
- mydestination = localhost, ubuntu, localhost.localdomain, localhost, dotuian.com
(b)将本地网络增加到"mynetworks"。因为服务器IP地址为192.168.0.114,所以配置如下
- mynetworks = 192.168.0.0/24, 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
(c)为了能够通过网络接受邮件,修改"inet_interfaces"为"all"
- #inet_interfaces = loopback-only
- inet_interfaces = all
5.重启postfix服务器
- /etc/init.d/postfix restart
6.测试域名配置是否成功(a)通过域名dotuian.com发送邮件
- root@ubuntu:/etc/postfix# telnet dotuian.com 25
- Trying 127.0.0.1...
- Connected to dotuian.com.
- Escape character is ‘^]‘.
- 220 ubuntu ESMTP Postfix (Ubuntu)
- ehlo dotuian.com //
- 250-ubuntu
- 250-PIPELINING
- 250-SIZE 10240000
- 250-VRFY
- 250-ETRN
- 250-STARTTLS
- 250-ENHANCEDSTATUSCODES
- 250-8BITMIME
- 250 DSN
- mail from: shou@dotuian.com //
- 250 2.1.0 Ok
- rcpt to: fmaster@dotuian.com //
- 250 2.1.5 Ok
- data //
- 354 End data with .
- Subject: mail test with domain //
- this is a test mail . //
- dotuian.com //
- .
- 250 2.0.0 Ok: queued as 9E95D5F809
- quit //
- 221 2.0.0 Bye
- Connection closed by foreign host.
(b)查收邮件检查/home/fmaster/Maildir/new,可以看到新建了一个独立的文件
- fmaster@ubuntu:~/Maildir/new$ ll
- 合計 16
- drwx------ 2 fmaster fmaster 4096 1月 29 14:10 ./
- drwx------ 5 fmaster fmaster 4096 1月 29 12:35 ../
- -rw------- 1 fmaster fmaster 426 1月 29 12:35 1359430545.Vfc00I16daM671946.ubuntu
- -rw------- 1 fmaster fmaster 446 1月 29 14:10 1359436215.Vfc00I16d8M538132.ubuntu
-
- fmaster@ubuntu:~/Maildir/new$ less 1359436215.Vfc00I16d8M538132.ubuntu
-
- Return-Path:
- X-Original-To: fmaster@dotuian.com
- Delivered-To: fmaster@dotuian.com
- Received: from dotuian.com (localhost [127.0.0.1])
- by ubuntu (Postfix) with ESMTP id 9E95D5F809
- for ; Tue, 29 Jan 2013 14:09:35 +0900 (JST)
- Subject: mail test with domain
- Message-Id: <20130129050947.9E95D5F809@ubuntu>
- Date: Tue, 29 Jan 2013 14:09:35 +0900 (JST)
- From: shou@dotuian.com
-
- this is a test mail .
- dotuian.com
- 1359436215.Vfc00I16d8M538132.ubuntu (END)
7.测试Courier POP3
- root@ubuntu:/etc/postfix# telnet dotuian.com 110
- Trying 127.0.0.1...
- Connected to dotuian.com.
- Escape character is ‘^]‘.
- +OK Hello there.
- user fmaster //
- +OK Password required.
- pass test1234 //
- +OK logged in.
- quit //
- +OK Bye-bye.
- Connection closed by foreign host.
8.测试 Courier IMAP
- root@ubuntu:/etc/postfix# telnet dotuian.com 143
- Trying 127.0.0.1...
- Connected to dotuian.com.
- Escape character is ‘^]‘.
- * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION] Courier-IMAP ready. Copyright 1998-2011 Double Precision, Inc. See COPYING for distribution information.
- a login fmaster test1234 //
- a OK LOGIN Ok.
- a logout //
- * BYE Courier-IMAP server shutting down
- a OK LOGOUT completed
- Connection closed by foreign host.
9.通过Microsoft Outlook收发邮件是的配置