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 [