Postfix是目前流行的一套郵件傳輸代理軟件(MTA),其做者Wietst Venema最初開發這套軟件時就對整體設計、擴展能力、可用性及系統安全等方面進行了充分的考慮。因爲Postfix在穩定、效率、安全和可用性上的優點,使得不少大型的郵件服務提供商都從原有的MTA軟件向Postfix過分,而新僅誕生的郵件產品也大多采用了Postfix。網易、Tom和新浪都將原有的Qmail更換爲Postfix,可見Postfix在大規模郵件系統中有比較廣泛的應用,固然,Postfix也徹底適用設計中小型的郵件系統,由於Postfix在保證了效率、安全、擴展等方面優點的同時,還具備配置簡單的特色。[比較老的數據了]html
又開始搗騰我比較喜歡的郵件系統了,本文爲後面的郵件系統作鋪墊,後面在來關聯文章樹,本文LNMP環境基於LNMP一鍵安裝,請自行經過博客搜索功能搜索該關鍵詞node
基於CentOS6.5,環境minimal,卸載postfixpython
[root@ipython ~]# service postfix stop Shutting down postfix: [ OK ] [root@ipython ~]# rpm -e --nodeps postfix
安裝Postfixmysql
[root@ipython ~]# yum install db4-devel [root@ipython ~]# tar zxf postfix-2.12-20140801.tar.gz [root@ipython ~]# cd postfix-2.12-20140801 ####直接編譯Makefiles#### ###AUX = 擴展功能[就這理解着吧] -lz = 壓縮工具 -lm = 編碼支持 #### ####lssl = openssl加密支持 lcrypto = crypto庫 #### ###若是你參考了本文,請不要看別的文章,而且最好使用我打包好的免安裝LNMP或一鍵安裝LNMP作完一次完整的測試後,再嘗試跟着你本身的感受走哦### ###固然,若是你仍採用了本身的思路並參考了本文,那麼請修改下面的依賴文件的路徑,歡迎提問### [root@ipython postfix-2.12-20140801]# make makefiles CCARGS='-DHAS_MYSQL -I/software/mysql/include/mysql -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DUSE_TLS -I/software/openssl/include' AUXLIBS='-L/software/mysql/lib/mysql/ -lmysqlclient -lz -lm -L/software/openssl/lib/ -lssl -lcrypto' [root@ipython postfix-2.12-20140801]# make ###給權限哦### [root@ipython postfix-2.12-20140801]# chmod a+x postfix-install [root@ipython postfix-2.12-20140801]# ./postfix-install -non-interactive install_root=/ tempdir=/tmp config_directory=/etc/postfix command_directory=/usr/sbin/ daemon_directory=/software/postfix data_directory=/var/lib/postfix html_directory=no mail_owner=postfix mailq_path=/usr/bin/mailq manpage_directory=/usr/local/man newaliases_path=/usr/bin/newaliases queue_directory=/var/spool/postfix readme_directory=no sendmail_path=/usr/sbin/sendmail setgia_group=postdrop
Postfix自動啓動sql
###postfix 啓動腳本能夠參考 blfs-bootscripts 包,依賴redhat-lsb,因爲太大,這裏放棄### ---手動創建--- ---------------------/etc/init.d/postfix--------------------------- #!/bin/bash # # postfix Postfix Mail Transfer Agent # # chkconfig: 2345 80 30 # description: Postfix is a Mail Transport Agent, which is the program \ # that moves mail from one machine to another. # processname: master # pidfile: /var/spool/postfix/pid/master.pid # config: /etc/postfix/main.cf # config: /etc/postfix/master.cf # # Based on startup script from Simon J Mudd <sjmudd@pobox.com> # 25/02/99: Mostly s/sendmail/postfix/g by John A. Martin <jam@jamux.com> # 23/11/00: Changes & suggestions by Ajay Ramaswamy <ajayr@bigfoot.com> # 20/01/01: Changes to fall in line with RedHat 7.0 style # 23/02/01: Fix a few untidy problems with help from Daniel Roesen. ### BEGIN INIT INFO # Provides: postfix MTA # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop postfix # Description: Postfix is a Mail Transport Agent, which is the program that # moves mail from one machine to another. ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network RETVAL=0 prog="postfix" lockfile=/var/lock/subsys/$prog pidfile=/var/spool/postfix/pid/master.pid ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp # Script to update chroot environment CHROOT_UPDATE=/etc/postfix/chroot-update status -p $pidfile -l $(basename $lockfile) -b /usr/libexec/postfix/master master >/dev/null 2>&1 running=$? conf_check() { [ -x /usr/sbin/postfix ] || exit 5 [ -d /etc/postfix ] || exit 6 [ -d /var/spool/postfix ] || exit 5 } make_aliasesdb() { if [ "$(/usr/sbin/postconf -h alias_database)" == "hash:/etc/aliases" ] then # /etc/aliases.db may be used by other MTA, make sure nothing # has touched it since our last newaliases call [