WEB开发网
开发学院操作系统CentOS CentOS postfix安装创建rpm与切换mta 阅读

CentOS postfix安装创建rpm与切换mta

 2010-05-27 23:09:21 来源:WEB开发网   
核心提示:漫长岁月经我多年的学习研究CentOS postfix系统,发现你可能会遇到CentOS postfix安装问题,CentOS postfix安装创建rpm与切换mta,这里将介绍CentOS postfix安装问题的解决方法,CentOS Linux和与之对应版本号的RHEL发行版具有软件包级别的二进制兼容性,A、C

漫长岁月经我多年的学习研究CentOS postfix系统,发现你可能会遇到CentOS postfix安装问题,这里将介绍CentOS postfix安装问题的解决方法,CentOS Linux和与之对应版本号的RHEL发行版具有软件包级别的二进制兼容性,即某个RPM软件包如果可以安装运行在RHEL产品中,就可以正常地安装运行在对应版本的CentOS Linux中。讲解CentOS postfix学习安装。

A、CentOS postfix下载软件包
[[email protected] i386]# cd
[[email protected] ~]# wget http://ftp.wl0.org/official/2.5/SRPMS/postfix-2.5.4-2.src.rpm
[[email protected] ~]# rpm -ivh postfix-2.5.4-2.src.rpm
[[email protected] ~]# cd $SPEC
编辑postfix.spec 修改下面的选项
%define distribution rhel-5.0
%define with_mysql_redhat 1
%define with_sasl     2
%define with_vda      1

B、CentOS postfix安装创建rpm
[[email protected] SPECS]# rpmbuild -bb postfix.spec
[[email protected] RPMS]# cd $RPMS/i386
[[email protected] i386]# rpm -ivh postfix-2.5.4-2.rhel4.i386.rpm

C、CentOS postfix安装切换mta
[[email protected] i386]# alternatives --config mta (选择2,postfix)
[[email protected] i386]# rpm -e sendmail
[[email protected] i386]# cd /usr/sbin/
[[email protected] sbin]# mv sendmail sendmail.bak
[[email protected] sbin]# newaliases
[[email protected] sbin]# ln -s sendmail.postfix sendmail

D、CentOS postfix安装配置
[[email protected] ~]# cd /etc/postfix/
[[email protected] postfix]# mv main.cf main.cf.bak
[[email protected] postfix]# vim main.cf
输入下面的内容:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 550
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = /usr/share/doc/postfix-2.5.2-documentation/html
manpage_directory = /usr/share/man
sample_directory = /etc/postfix
readme_directory = /usr/share/doc/postfix-2.5.2-documentation/readme
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
myhostname = mail.yiyou.org
mydomain = yiyou.org
mydestination = $myhostname
smtpd_banner = yiyou.org ESMTP Mail System
message_size_limit = 14680064
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base = /home/data/domains
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cf
virtual_transport = maildrop:
maildrop_destination_recipient_limit = 1

#sasl
smtpd_sasl_auth_enable = yes
smtpd_sasl2_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes

smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname

复制extman/docs 目录的cf 文件到/etc/postfix
[[email protected] postfix]# cp /root/extman-0.2.5b1/docs/mysql_virtual_* .
因为CentOS postfix安装配置文件的用户、密码与数据库时一样,所以不用修改。
[[email protected] postfix]# service postfix start

Tags:CentOS postfix

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接