/ 中存储网

Linux fedora系统中如何配置e-mail服务器

2014-09-24 12:30:24 来源:中存储网

一、DNS服务器的配置
1、在正向解析记录中要有mail的A记录或者别名记录
chkconfig --level 35 named on

二、Sendmail服务器的安装
1、安装第4张光盘的sendmail-cf、sendmail-doc
2、cd /etc/mail
备份主配置文件:
cp sendmail.cf sendmail.cf.raw
makemap hash access.db < access
aliases
3、添加完整的域名和别名
vi /etc/hosts
添加 192.168.1.30 mail.sina.com mail
vi /etc/mail/local-host-names
添加 sina.com (添加邮件服务器提供邮件服务的域名)
4、vi +105(116) /etc/mail/sendmail.mc
105行
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
//修改为
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
48+49行(52)
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
//去除行首的注释标记“dnl”,修改为
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

5、service saslauthd start SMTP 邮件认证机制
----Simple Authentication and Security Layer (SASL)
chkconfig --level 35 saslauthd on

6、groupadd mailuser
adduser -g mailuser -s /sbin/nologin mike
passwd mike
7、m4 sendmail.mc > sendmail.cf
8、service sendmail start
chkconfig --level 35 sendmail on

9、安装POP3服务
system-config-packages dovecot
10、vi /etc/dovecot.conf
//将以下配置14行(20)
#protocols = imap imaps
//修改为
protocols = imap imaps pop3 pop3s
(imaps tcp-993 pop3s tcp-995 smtps tcp-465 )
SSL version of your existing POP3 server for port 995 (pop3s)
11、service dovecot restart
chkconfig --level 35 dovecot on(anyy2220)