首先Webmail最不能缺少的就是web服务器,我们使用前面提到的niginx所搭建的环境(http://linuxsvr.blog.51cto.com/2537584/632042)

然后接着postfix上面的环境

下载:

需要下载squirrelmail和多国语言包,但是要下载必须×××,51CTO上供下载
http://down.51cto.com/data/237229#
不得不抱怨一句为什么我下个squirrelmail都需要×××才能下载的了…

安装:

 
  
  1. # tar –zxvf squirrelmail-webmail-1.4.22.tar.gz –C /usr/local/nginx/html  
  2.  
  3. # tar –zxvf all_locales-1.4.18-20090526.tar.gz   
  4.  
  5. # cd locale  
  6.  
  7. # cp * /usr/local/nginx/html/squirrelmail-webmail-1.4.22/locale/ –a  
  8.  
  9. # cd /usr/local/nginx/html/  
  10.  
  11. # mv squirrelmail-webmail-1.4.22/ mail  
  12.  
  13. // 创建调整数据目录和附件目录  
  14.  
  15. # cd mail  
  16.  
  17. # mkdir attach  
  18.  
  19. # chown -R nobody.nobody attach/ data/    # 这里使用nginx+fastcgi的形式,我们这里的nobody是运行fastcgi的用户.   
  20. # chmod 730 attach/  
  21.  
  22. // 建立和调整配置文件  
  23.  
  24. [root@mail mail]# cp config/config_default.php config/config.php   
  25. [root@mail mail]# vi config/config.php   
  26.  
  27. 118 $domain = 'gateway.org';   
  28. 499 $data_dir = '/usr/local/nginx/html/mail/data/';   
  29. 1012 $squirrelmail_default_language = 'zh_CN';   
  30. 1027 $default_charset = 'zh_CN.UTF-8';  
  31.  
  32.    
  33.  

测试:

http://mail.gateway.org/mail

 

 SMTP认证

现在邮件服务器已经基本完成,但是如果你不想你的邮件服务器成为别人用来发送垃圾邮件的服务器我们还需要配置smtp认证

// 配置并启动saslauthd服务器

[root@mail mail]# cd /usr/lib/sasl2/

[root@mail sasl2]# cp Sendmail.conf smtp.conf

[root@mail ~]# vi /etc/postfix/main.cf

添加:

656 # smtp sasl
 657 smtpd_sasl_auth_enable = yes
 658 smtpd_sasl_security_options = noanonymous
 659 smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination  # 若收件人地址未在授权网络内,则拒绝发送

验证:

telnet localhost 25

输入

ehlo localhost

出现250-AUTH LOGIN PLAIN