编译安装POSTFIX必需知道的几个东西
POSTFIX下载源码安装不是一件容易的事,参数相当的复杂,
首先了解一下编译安装后的程序文件默认路径:
parameter name | typical default |
---|---|
command_directory | /usr/sbin |
config_directory | /etc/postfix |
default_database_type | hash |
daemon_directory | /usr/libexec/postfix |
data_directory | /var/lib/postfix |
html_directory | no |
mail_spool_directory | /var/mail |
mailq_path | /usr/bin/mailq |
manpage_directory | /usr/local/man |
meta_directory | /etc/postfix |
newaliases_path | /usr/bin/newaliases |
queue_directory | /var/spool/postfix |
readme_directory | no |
sendmail_path | /usr/sbin/sendmail |
shlib_directory | /usr/lib/postfix |
下面是本人使用的POSTFIX源码安装脚本:
[code language="shell"]
once=
postfix=2.11.1
if [ $once ];
then
groupadd -g 3000 postfix &&
groupadd -g 3001 postdrop &&
useradd -c "Postfix Daemon User" -d /var/spool/postfix -g postfix \
-s /bin/false -u 3000 postfix &&
chown -v postfix:postfix /var/mail
apt-get build-dep postfix
fi
if [ $postfix ];
then
cd /root/src
rm -rf ./postfix*
wget ftp://ftp.cuhk.edu.hk/pub/packages/mail-server/postfix/official/postfix-$postfix.tar.gz
tar zxf postfix-$postfix.tar.gz
cd postfix-$postfix
make -f Makefile.init makefiles \
CCARGS="-DHAS_MYSQL -I/usr/include/mysql \
-DUSE_TLS -I/usr/include/openssl/ \
-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" \
AUXLIBS="-L/usr/include/mysql/mysql -lmysqlclient -lz -lm \
-lssl -lcrypto -lsasl2"
make
sh postfix-install -non-interactive \
html_directory=/usr/share/doc/postfix-2.11.1/html \
readme_directory=/usr/share/doc/postfix-2.11.1/readme
fi
[/code]
AUXLIBS_MYSQL
2015-10-29 21:03