服务器搭建手册之FREEBSDUNIX邮件服务器建设(六)

二、配置邮件服务器.

本节主要讲述各种服务的参数配置。

A、配置rc.conf,编辑/etc/rc.conf

下面是前面所装软件都加入启动选项的rc.conf配置

courier_authdaemond_enable=”YES”

 

courier_imap_pop3d_enable=”YES”

 

courier_imap_imapd_enable=”YES”

 

sendmail_enable=”YES”

 

sendmail_flags=”-bd”

 

sendmail_pidfile=”/var/spool/postfix/pid/master.pid”

 

sendmail_procname=”/usr/local/libexec/postfix/master”

 

sendmail_outbound_enable=”NO”

 

sendmail_submit_enable=”NO”

 

sendmail_msp_queue_enable=”NO”

 

b、配置postfix 和 cyrus-sasl

1、修改/usr/local/etc/postfix/main.cf,在文件最后加入以下内容.
# vi /usr/local/etc/postfix/main.cf

smtpd_helo_required = yes

 

strict_rfc821_envelopes = yes

 

smtpd_etrn_restrictions = permit_mynetworks, reject

 

#=====================BASE=====================

 

myhostname = ns1.ding9.com

 

mydomain = ding9.com

 

mydestination = $myhostname

 

local_recipient_maps =

 

command_directory = /usr/local/sbin

 

local_transport = virtual

 

#=====================MySQL=====================

 

virtual_alias_maps = mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf

 

virtual_gid_maps = static:125

 

virtual_mailbox_base = /

 

virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf

 

virtual_mailbox_limit = 51200000

 

virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf

 

virtual_minimum_uid = 125

 

virtual_transport = virtual

 

virtual_uid_maps = static:125

#=====================Quota=====================

 

virtual_create_maildirsize = yes

 

virtual_mailbox_extended = yes

 

virtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_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

 

#====================SASL=====================

 

smtpd_sasl_auth_enable = yes

 

smtpd_sasl_security_options = noanonymous

 

broken_sasl_auth_clients = yes

 

smtpd_delay_reject=yes

 

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,permit_auth_destination,reject

 

smtpd_client_restrictions = permit_sasl_authenticated

 

注:mail.toping.net 在这里是指unix服务器的hostname ,这个可以根据unix的实际的hostname来作相应修改,这里暂时以mail.toping.net 这个hostname来说明。

 

2、确认/usr/local/etc/postfix/master.cf的配置有如下内容:

virtual unix – n n – – virtual

3、编辑/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
# vi /usr/local/etc/postfix/mysql_virtual_alias_maps.cf

加入以下内容:

user = postfix

 

password = postfix

 

hosts = localhost

 

dbname = postfix

 

query = SELECT alias FROM userinfo WHERE address=’%s’ AND active = 1

以下文章点击率最高

Loading…


发表评论

邮箱地址不会被公开。 必填项已用*标注