您好,登錄后才能下訂單哦!
這篇文章主要介紹“CentOS postfix的安裝創建方法”,在日常操作中,相信很多人在CentOS postfix的安裝創建方法問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”CentOS postfix的安裝創建方法”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
A、CentOS postfix下載軟件包
[root@localhost i386]# cd
[root@localhost ~]# wget http://ftp.wl0.org/official/2.5/SRPMS/postfix-2.5.4-2.src.rpm
[root@localhost ~]# rpm -ivh postfix-2.5.4-2.src.rpm
[root@localhost ~]# 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
[root@localhost SPECS]# rpmbuild -bb postfix.spec
[root@localhost RPMS]# cd $RPMS/i386
[root@localhost i386]# rpm -ivh postfix-2.5.4-2.rhel4.i386.rpm
C、CentOS postfix安裝切換mta
[root@localhost i386]# alternatives --config mta (選擇2,postfix)
[root@localhost i386]# rpm -e sendmail
[root@localhost i386]# cd /usr/sbin/
[root@localhost sbin]# mv sendmail sendmail.bak
[root@localhost sbin]# newaliases
[root@localhost sbin]# ln -s sendmail.postfix sendmail
D、CentOS postfix安裝配置
[root@localhost ~]# cd /etc/postfix/
[root@localhost postfix]# mv main.cf main.cf.bak
[root@localhost 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
[root@localhost postfix]# cp /root/extman-0.2.5b1/docs/mysql_virtual_* .
因為CentOS postfix安裝配置文件的用戶、密碼與數據庫時一樣,所以不用修改。
[root@localhost postfix]# service postfix start
到此,關于“CentOS postfix的安裝創建方法”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。