`

[转]postfix2.3.3安装

阅读更多
本文转自:http://www.extmail.org/forum/archive/2/0510/563.html 中安装postfix部分。

6、安装Postfix
从下面的URL下载Postfix 2.2.8的源代码:http://www.postfix.org
从下面的URL下载Postfix 2.2.8的VDA补丁程序:http://web.onda.com.br/nadal/
chkconfig --level 2345 sendmail off

增加Postfix运行所需要的用户和组,并建立“/home/mail”目录作为存储邮件的地方:
groupadd postfix
groupadd postdrop
useradd postfix -g postfix -c "Postfix user" -d /nonexistent -s /sbin/nologin
mkdir /home/mail
chown postfix:postfix /home/mail

安装Postfix:
gzip -d postfix-2.2.8-vda.patch.gz
tar zvxf postfix-2.2.8.tar.gz
cd postfix-2.2.8
patch -p1 < ../postfix-2.2.8-vda.patch
make -f Makefile.init makefiles \ OPT='-march=pentium4 -O2 -pipe -fomit-frame-pointer' \
'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -I/usr/include/sasl -DUSE_TLS' \
'AUXLIBS=-L/usr/lib -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2 -lssl -lcrypto'
make
make install
注:“make install”命令后的所有问题都直接敲回车键即可。

mv /etc/aliases /etc/aliases.old
ln -s /etc/postfix/aliases /etc/aliases
echo 'root: admin@example.com'>>/etc/postfix/aliases
/usr/bin/newaliases
注:因为Postfix不允许直接发邮件给root用户,所以你需要为root用户建立一个别名。
建立smtpd用户认证的配置文件:
vi /usr/lib/sasl2/smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list: plain login
authdaemond_path:/var/spool/authdaemon/socket
使用postconf -n简化main.cf,这样的好处是main.cf比较短小,不容易造成同一个配置出现两次的问题:
cd /etc/postfix
postconf -n > main2.cf
mv main.cf main.cf.old
mv main2.cf main.cf
修改Postfix的配置文件,#号之后是说明文字:
vi /etc/postfix/main.cf
myhostname = mail.example.com         # mail.example.com是安装Postfix软件的主机名
mydomain = example.com             # example.com是安装Postfix软件的主机名中的域名部分
myorigin = $mydomain
mydestination =
alias_maps = hash:/etc/aliases
home_mailbox = Maildir/             # 使用Maildir作为邮件的存储格式

# Add following line in file's finality
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base = /home/mail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 102400000
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 502
virtual_uid_maps = static:502
virtual_gid_maps = static:502
virtual_transport = virtual

# Additional for quota support
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
virtual_overquota_bounce = yes
virtual_trash_count=yes
virtual_trash_name=.Trash

broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_non_fqdn_hostname,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient,
  reject_unauth_destination,
  reject_unauth_pipelining,
  reject_invalid_hostname,
  reject_rbl_client opm.blitzed.org,
  reject_rbl_client list.dsbl.org,
  reject_rbl_client bl.spamcop.net,
  reject_rbl_client sbl-xbl.spamhaus.org

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
注:①“virtual_gid_maps”和“virtual_uid_maps”是postfix用户的gid和uid, “virtual_minimum_uid”应当≤“virtual_uid_maps”,“virtual_mailbox_limit”是每个邮箱的 大小。
    ②opm.blitzed.org、list.dsbl.org、bl.spamcop.net、sbl-xbl.spamhaus.org是经常使用的 几个反垃圾邮件列表,如果你使用上面的设置可能无法收到sina、sohu、163等几个国内主要ISP的邮件。你也可以使用中国反垃圾邮件联盟的反垃圾 邮件列表,这样你就能收到国内几个主要ISP的邮件,同时一些垃圾邮件也可能光临你的邮件服务器^_^。
    ③Postfix使用MySQL存储用户信息的配置文件已经包含在extman的发行包中,等安装extman的时候copy到/etc/postfix目录下即可。
设置Postfix开机自动运行,在/etc/rc.local中增加“/usr/sbin/postfix start&”。
注:①系统已经打开了Postfix的TLS支持,如果你需要这项功能可以参考Postfix发行包中的TLS_README文档进行配置。
    ②你可以使用一个叫pflogsumm.pl的perl脚本对postfix的日志进行分析,详细的情况见:http://jimsun.linxnet.com/postfix_contrib.html

安装Postfix2.3.3中支持SASL的编译参数有变动,编译参数更改如下:
make -f Makefile.init makefiles \ OPT='-march=pentium4 -O2 -pipe -fomit-frame-pointer' \
'CCARGS=-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/include/sasl -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_TLS' \
'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2 -lssl -lcrypto'
其中红色部分为新增的编译参数,mysql和sasl路径为本机安装的路径。

官方关于post2.3+版本编译支持SASL的参数变动说明:
[Incompat 20051220] The Postfix-with-Cyrus-SASL build procedure has
changed. You now need to specify -DUSE_CYRUS_SASL in addition to
-DUSE_SASL_AUTH or else you end up without any Cyrus SASL support.
The error messages are:

unsupported SASL server implementation: cyrus
unsupported SASL client implementation: cyrus

分享到:
评论

相关推荐

    postfix-2.3.3-2.i386

    postfix,postfix-2.3.3-2.i386

    postfix-2.3.3-2.1.el5_2.i386.rpm

    postfix邮件服务器 postfix-2.3.3-2.1.el5_2.i386.rpm

    postfix-2.3.3-2.i386.rpm

    postfix-2.3.3-2.i386.rpm

    postfix-pflogsumm-2.3.3-2.1.el5_2.i386.rpm

    linux redhat5_4 postfix postfix-pflogsumm-2.3.3-2.1.el5_2.i386.rpm

    postfix配置[参照].pdf

    在描述中列出了一系列的软件包,包括Postfix 2.3.3版本,以及Cyrus SASL库和MySQL服务器,这些都是为了实现身份验证和数据库支持。此外,还包含Courier-Authlib以提供额外的认证机制,以及maildrop用于邮件分发。...

    linux 下邮件服务器postfix

    rpm -ivh postfix-2.3.3-2.1.el5_2.i386.rpm ``` 安装完成后,Postfix的主要配置文件位于`/etc/postfix/main.cf`。这是一个非常关键的文件,因为它定义了Postfix的行为和设置。例如,为了配置Postfix识别的主机名和...

    2022年优秀-Linux第章邮件服务.pptx

    1. 安装软件包:例如,对于基于RPM的系统,可以使用名为`postfix-2.3.3-2.i386.rpm`的软件包进行安装。 2. 配置文件:Postfix的配置文件通常位于`/etc/postfix`目录下,如`main.cf`是主配置文件,需要根据需求进行...

    sendmail-8.13.1-2.i386一套RPM格式安装包

    1. "postfix-2.3.3-2.i386.rpm":Postfix是一个替代Sendmail的MTA,同样非常流行。这可能是为了提供另一种邮件服务器选择,或者是为了升级或替换现有的Sendmail服务。 2. "dovecot-1.0.7-7.el5.i386.rpm":Dovecot是...

    网络实习报告-服务器配置

    邮件服务器如Exchange或Postfix,处理内部和外部的电子邮件通信。配置过程中需设定邮件域、用户账号、安全设置、垃圾邮件过滤等。 2.4 总结 通过本次实习,不仅掌握了服务器配置的基本流程,还了解了网络设计的原则...

    C标准库函数.CHM

    1.5.1 Postfix 1.5.2 Unary and Prefix 1.5.3 Normal 1.5.4 Boolean 1.5.5 Assignment 1.5.6 Precedence 1.6 Statements 1.6.1 if 1.6.2 switch 1.6.3 while 1.6.4 do 1.6.5 for 1.6.6 goto 1.6.7 ...

    编译原理龙书答案

    2.3.3 Construct a syntax-directed translation scheme that trans­ lates integers into roman numerals answer assistant function: repeat(sign, times) // repeat('a',2) = 'aa' translation schemes: num -&gt;...

Global site tag (gtag.js) - Google Analytics