centos mail支持html,CentOS 简易邮件服务器搭建

CentOS简易邮件服务器搭建

CentOS 5.5 64bit下postfix+dovecot+sasl2+webmail,发信认证,邮件帐号使用系统用户名。

简易邮件服务器并不是专业的搭建一台完整的企业邮箱出来,关于mailscanner,spam,fprot都没有装!包括mysql的认证。

环境:

系统CentOS 5.5 64bit

企业域名monoedu.com

邮件服务器mail. monoedu.com

Mail服务器名: mail. monoedu.com

ip:210.14.78.1*

注:DNS必须配置,见其他配置文档

1.Postfix sasl2 dovecot安装

[root@mail ~]# yum install postfix cycus-sasl* dovecot

2.配置

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

修改内容如下:

myhostname = mail.monoedu.com

mydomain = monoedu.com

myorigin = $mydomain

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,

mail.$mydomain,,

mynetworks_style = subnet //指定全网IP,这两个参数设置非常重要(下面)

mynetworks = 127.0.0.0/8, localhost, 210.14.78.0/24 //一般smtp不通都是因为这里没有配置对

relay_domains = $mydestination

home_mailbox = Maildir/ //如果采用系统帐号作为邮件用户名,该目录为帐号下的目录

最后面添加(sasl加密算法支持)

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

broken_sasl_auth_clients = yes

smtpd_recipient_restrictions = permit_sasl_authenticated,reject_unauth_destination,permit_mynetworks

smtpd_client_restrictions = permit_sasl_authenticated

从命令行选择可用的MTA

[root@mail ~]# alternatives --config mta

There are 2 programs which provide 'mta'.

SelectionCommand

-----------------------------------------------

*+ 1/usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number: 1

[root@mail ~]#vi /etc/sysconfig/saslauthd

SOCKETDIR=/var/run/saslauthd

MECH=shadow //采用系统帐号验证

[root@mail ~]# vi /usr/lib/sasl2/smtpd.conf

修改或者添加

pwcheck_method: saslauthd

mech_list: PLAIN LOGIN

log_level:3

[root@mail ~]# vi /etc/dovecot.conf

修改或者添加

protocols = imap pop3 pop3s

listen = *

[root@mail ~]# /etc/init.d/postfix start|stop|restart

[root@mail ~]# /etc/init.d/dovecot start|stop|restart

[root@mail ~]# /etc/init.d/saslauthd start|stop|restart

3.设置开机自启

[root@mail ~]#chkconfig –level 345 postfix on

[root@mail ~]#chkconfig –level 345 dovecot on

[root@mail ~]#chkconfig –level 345 saslauthd on

4.添加帐号

(1)先新建系统帐号

[root@mail ~]# useradd –s/bin/nologin –m test

[root@mail ~]# passwd test //密码test

(2)添加邮箱账号

[root@mail ~]# /usr/sbin/testsaslauthd -u test -p test

上面这步所使用的用户名和密码,系统中必须有该用户和对应的密码,否则会报错

返回:ok,successd,执行成功。

5. foxmail 测试

添加账号:pop3 stmp 都需要设置为域名地址(mail.monoedu.com)

最后就可以通过outlook,foxmail等客户端测试邮件服务器了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值