CentOS系统安装配置postfix,saslauthd,dovecot
思韵闪耀
2013-03-19
0
检查下sendmail
#rpm -qa | grep sendmail
停止掉
#/etc/init.d/sendmail stop
#chkconfig --level 0123456 sendmail off
#mv /usr/bin/newaliases /usr/bin/newaliases.orig
#mv /usr/bin/mailq /usr/bin/mailq.orig
#mv /usr/sbin/sendmail /usr/sbin/sendmail.orig 安装postfix
#yum -y install postfix
#vim /etc/postfix/main.cf
修改
(企业域名    btroot.org   邮件服务器 mail. btroot.org     Mail服务器名 mail.btroot.org    ip:11.22.33.44)

修改内容如下:

myhostname = mail.btroot.org  

mydomain = btroot.org  

myorigin = $mydomain

inet_interfaces = all

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

 mail.$mydomain, www.$mydomain, ftp.$mydomain

mynetworks_style = subnet

mynetworks = 127.0.0.0/8, localhost, 11.22.33.44

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
安装saslauthd
必须先安装openssl 不然cyrus-sasl会报错 2.1.21的sasl版本,编译容易出错
#yum -y install openssl 关于saslauthd ,可以参考这里. 
http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/cyrus-sasl.html
下载saslauthd
#wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.25.tar.gz
#tar -xzvf cyc...
.#/configure --prefix=/usr
            --sysconfdir=/etc
--with-dbpath=/var/lib/sasl/sasldb2
--with-saslauthd=/var/run/saslauthd --diable-anon --enable-login --enable-ntlm
#make && make install 要修改的smtpd.conf文件在/etc/sasl2/smtpd.conf

做个符号链接 
#ln -s /etc/sasl2/smtpd.conf /usr/lib/sasl2/smtpd.conf
#vim etc/sysconfig/saslauthd
检查MECH=shadow
检查是否启动
#ps aux | grep saslauthd
#chklevel --2345 saslauthd on 
#/etc/init.d/saslauthd start 验证下sasl
#/usr/sbin/testsaslauthd -u root -p '123456' -s smtp
0: OK "Success."

选择mta 会有两个一个sendmail  一个postfix
#alternatives --config mta 
如果有sendmail  不要选它 我们用postfix 输入前面的数字既可
vi /usr/lib/sasl2/smtpd.conf
修改或者添加
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN log_level:3
安装dovecot
#yum -y install dovecot
vi /etc/dovecot.conf
修改或者添加
protocols = imap pop3 pop3s
listen = * # /etc/init.d/postfix start
# /etc/init.d/dovecot start
# /etc/init.d/saslauthd start
设置开机自启
#chkconfig –level 2345 postfix on
#chkconfig –level 2345 dovecot on

#chkconfig –level 2345 saslauthd on


【版权声明】
本站部分内容来源于互联网,本站不拥有所有权,不承担相关法律责任。如果发现本站有侵权的内容,欢迎发送邮件至masing@13sy.com 举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。

相关内容

将IIS设置克隆到新服务器...
将IIS设置克隆到新服务器的最佳方法是使用IIS配置文件。以下是详...
2025-06-06
搭建Git服务器及本机克隆...
Git是什么?Git是目前世界上最先进的分布式版本控制系统。SVN...
2025-03-17
ubuntu环境下搭建gi...
操作环境:服务器:Ubuntu 24.04.2 LTS+git 2...
2025-03-17
Linux系统挂载未分配硬...
先查看未挂载之前的磁盘使用情况发现磁盘使用率已经达到了96%,迫切...
2025-02-22
Linux lsblk 命...
简介Linux 中的 lsblk 命令,全称叫做:list blo...
2025-02-22
linux内核5和6区别
Linux内核5.x和6.x版本之间有显著的区别,这些区别主要体现...
2024-04-29

热门资讯

Roundcube 配置过各提... Fileinfo/mime_content_type configuration: OK Mimet...
搭建PostfixAdmin ... 一、原理及其应用: 笔者之前就职在上海一家信息公司,至力于全面的电子邮件营销解决方案,公司中等规模,...
在wdos系统下搭建postf... 一.简介: 1. wdOS是一个基于CentOS版本精简优化过的Linux服务器系统,大部分保留着c...
RHEL5系统中安装Postf... 前提1:安装RHEL5时把所有的开发工具装上。 原理图 前提2 :开始前请确保您已经配置好指向此邮件...
Linux停止和启动postf... 1.启动Postfix服务 启动Postfix服务的命令为: /etc/init.d/postfix...