Chinaunix首页 | 论坛 | 博客
  • 博客访问: 459002
  • 博文数量: 145
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1139
  • 用 户 组: 普通用户
  • 注册时间: 2014-01-14 16:47
个人简介

路漫漫其修远兮,吾将上下而求索

文章分类

全部博文(145)

文章存档

2016年(10)

2015年(15)

2014年(120)

我的朋友

分类: 系统运维

2015-01-19 13:58:29

一:安装openwebmail

因为openwebmail是基于网页所以有必要先将http服务安装好。

yum install -y httpd   安装http服务

service httpd start    启动http服务

chkconfig httpd on     开机自启动http

打开浏览器

   浏览地址以实际为主,能正常浏览网页表示安装成功

配置yum仓库让yum 可以直接安装openwebmail

vi /etc/yum.repos.d/CentOS-Base.repo 

在CentOS-Base.repo最后加入如下蓝色代码【代码是从openwebmail官方网获取的

[openwebmail]

## Thomas Chung 

## 2008.05.29

name=Openwebmail for Fedora or Enterprise Linux

baseurl=

enabled=1

gpgcheck=1

gpgkey=RPM-GPG-KEY-openwebmail

#metadata_expire=0

yum安装openwebmail

此法安装的好处简单一步搞定,不用繁琐的找openwebmail的perl 支持软件包。

yum -y install openwebmail

运行此命令后会自动安装openwebmail 还会自动安装好perl相关支持。

但发现运行此命令后,还是有一个必要的包perl-CGI没装所以再yum一下

yum -y install perl-CGI

安装好openwebmail后修改配置文件openwebmail.conf

vi /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

default_language                zh_CN.GB2312

default_iconset                 Cool3D.Chinese.Simplified

找到并修改上面两行。

 vi /var/www/cgi-bin/openwebmail/etc/dbm.conf

dbm_ext                 .pag

dbmopen_ext             none

找到上面两行,并修改。

初始化openwebmail

/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init

再次打开浏览器浏览

(以上地址以自行设定的实际地址为准)

二:安装postfix



1.安装软件包
  yum install postfix system-switch-mail
2.切换MTA并启动Postfix
  system-switch-mail-nox
  选择Postfix
3.配置Postfix主配置文件/etc/postfix/main.cf
  指定postfix监听的网络端口为所有
      inet_interfaces = all
  指定运行postfix服务的邮件主机名称(FQDN名)
      myhostname = server1.lab.me
  指定运行Postfix服务的邮件主机的域名
      mydomain = lab.me
  指定由本台邮件主机寄出的每封邮件的邮件头中mail from的地址
      myorigin = $mydomain
  指定可接收邮件的主机名或域名,只有当发来的邮件的收件人地址与该参数值相匹配时,Postfix才会将该邮件接收下来。
      mydestination = $myhostname, localhost.$mydomain, localhost, mail.$mydomain, $mydomain
  设置可转发(Relay)哪些IP网段的邮件
      mynetworks = 127.0.0.0/8, 192.168.10.0/24 
  设置可转发(Relay)哪些网域的邮件
      relay_domains = $mydestination
4.重启Postfix服务
  service postfix restart(reload)
5.测试邮件服务
  telnet(nc)  localhost  25


三:SMTP认证


提供认证的服务
saslauthd 它是一个独立运行的daemon,它是基于系统密码来验证的,可以读取很多种后端的认证数据,包括:getpwent(/etc/passwd), kerberos,pam,rimap(remote IMAP server),shadow,ldap,其中一些是需要root权限的,而saslauthd就是以root身份来运行的,它可以帮助postfix来 验证密码,因为postfix本身在设计的时候就避开了特权身份。saslauthd只支持和PLAIN和LOGIN两种验证机制。
auxprop 它提供了一种独立于系统密码的验证方法,它的含义是Auxiliary Property Plug-ins,它的作用是调用外部程序来验证,它可以读取sasldb2和sql server的验证数据,支持上面提到的各种验证机制。
简单应用
修改/usr/lib/sasl/smtpd.conf文件,告诉postfix使用saslauthd作为后台认证程序: pwcheck_method: saslauthd
修改/etc/sysconfig/saslauthd文件,使saslauthd采用shadow作为验证数据源        MECH=shadow
启动saslauthd:/etc/init.d/saslauthd start
验证saslauthd                                                  /usr/sbin/testsaslauthd -u haha -p'123456'                         0: OK "Success."
编 辑/etc/postfix/main.cf,增加:                            smtpd_sasl_auth_enable = yes                                broken_sasl_auth_clients = yes                                                smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_relay_domains
smtpd_client_restrictions = permit_sasl_authenticated
postfix reload
完成以上设置以后,在客户端发信的时候就需要验证了。

必须开启  saslauthd 服务
 
chkconfig saslauthd on

阅读(1125) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~