当前位置: 首页 > 图文教程 > 服务器 > Mail服务器 > 构建反病毒反垃圾邮件系统(四)

Mail服务器
Webmail攻防实战(8)
用MDaemon搭建邮件服务器(上)
用MDaemon搭建邮件服务器(中)
用MDaemon搭建邮件服务器(下)
综述OWA使用十大技巧
在家中搭建无限容量邮件服务器
Qmail的优点及安装调试
邮件服务器的安全解决方案
基于Sendmail和Perl的邮件附件过滤系统
打造百毒不侵的Imail服务器
企业Sendmail邮件服务器的创建(1)
企业Sendmail邮件服务器的创建(2)
企业Sendmail邮件服务器的创建(3)
用Foxmail搭建邮件服务器
不花一分钱, 轻松打造自己的电子邮局
两个虚拟SMTP服务器防止垃圾邮件中转的总结
邮件服务器:G容量邮件服务器DIY
Windows 2003邮件服务器配置指南(图)
用Linux作邮件服务器
个人SMTP邮件服务器简单配置

Mail服务器 中的 构建反病毒反垃圾邮件系统(四)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 40 ::
收藏到网摘: n/a

 

4、TLS支持

通过修改/usr/lib/ssl/misc/CA.pll脚本实现,以下修改后CA1.pl和未修改CA.pl之间的对比:
  

以下为引用的内容:
  ***CA.pl
  ---CA1.pl
  ***************
  ***59,69****
  }elsif(/^-newcert$/){
  #createacertificate
  !system("$REQ-new-x509-keyoutnewreq.pem-outnewreq.pem$DAYS");
  $RET=$?;
  print"Certificate(andprivatekey)isinnewreq.pem\n"
  }elsif(/^-newreq$/){
  #createacertificaterequest
  !system("$REQ-new-keyoutnewreq.pem-outnewreq.pem$DAYS");
  $RET=$?;
  print"Request(andprivatekey)isinnewreq.pem\n";
  }elsif(/^-newca$/){
  ---59,69----
  }elsif(/^-newcert$/){
  #createacertificate
  !system("$REQ-new-x509-nodes-keyoutnewreq.pem-outnewreq.pem$DAYS");
  $RET=$?;
  print"Certificate(andprivatekey)isinnewreq.pem\n"
  }elsif(/^-newreq$/){
  #createacertificaterequest
  !system("$REQ-new-nodes-keyoutnewreq.pem-outnewreq.pem$DAYS");
  $RET=$?;
  print"Request(andprivatekey)isinnewreq.pem\n";
  }elsif(/^-newca$/){

  
现在就可以使用修改的CA1.pl来签发证书:
  
以下为引用的内容:
  #cd/usr/local/ssl/misc
  #./CA1.pl-newca
  #./CA1.pl-newreq
  #./CA1.pl-sign
  #cpdemoCA/cacert.pem/etc/postfix/CAcert.pem
  #cpnewcert.pem/etc/postfix/cert.pem
  #cpnewreq.pem/etc/postfix/key.pem

修改main.cf,添加:
  

以下为引用的内容:
  smtpd_tls_cert_file=/etc/postfix/cert.pem
  smtpd_tls_key_file=/etc/postfix/privkey.pem
  smtpd_use_tls=yes
  tls_random_source=dev:/dev/urandom
  tls_daemon_random_source=dev:/dev/urandom

  
重起postfix后就可以看到250-STARTTLS
  
很多邮件客户端对TLS的支持并不是非常好,建议使用stunnel来实现相应的smtp和pop3加密。
  
  #apt-getinstallstunnel
  
证书:
  
以下为引用的内容:
  #opensslreq-new-x509-days365-nodes-config/etc/ssl/openssl.cnf-outstunnel.pem-keyoutstunnel.pem
  #opensslgendh512>>stunnel.pem

  
服务端:

以下为引用的内容:
  #stunnel-d60025-r25-snobody-gnogroup
  #stunnel-d60110-r110-snobody-gnogroup

  
如果使用-npop3等参数就只能用邮件客户端收信。
  
客户端:

建一个stunnel.conf文件:
  

以下为引用的内容:
  client=yes
  
  [pop3]
  accept=127.0.0.1:110
  connect=192.168.7.144:60110
  
  [smtp]
  accept=127.0.0.1:25
  connect=192.168.7.144:60025

  
然后启动stunnel.exe,在邮件客户端的smtp和pop3的服务器都填127.0.0.1就可以了,这样从你到邮件服务器端的数据传输就让stunnel给你加密了。
  
5、测试用户
  
以下为引用的内容:
  #mkdir-p/home/vmail/test.org/san/
  #chown-Rnobody.nogroup/home/vmail
  #chmod-R700/home/vmail
  
  mysql>usepostfix
  mysql>insertintotransportsetdomain='test.org',destination='
  virtual:';
  mysql>insertintouserssetemail='[email protected]',clear='test',name='',uid='65534',gid='6553-4',
  homedir='home/vmail',maildir='test.org/san/';

  
然后就可以使用客户端收发邮件,记得用户名是email地址。