postfix配置詳解

#別名數據庫(postalias/newaliases 命令生成)
alias_database = hash:/etc/postfix/aliases
 
#別名表,列出local mda 所使用的別名數據庫
alias_maps = hash:/etc/postfix/aliases
 
#退回的郵件重新投遞的最長時間
bounce_queue_lifetime = 1d
 
#支持非標準驗證規定的行爲
broken_sasl_auth_clients = yes
 
#postfix命令目錄
command_directory = /usr/sbin
 
#postfix配置文檔目錄
config_directory = /etc/postfix
 
#配置內容過濾 amavis
content_filter = smtp-amavis:[127.0.0.1]:10024
 
#postfix 的各個服務器程序目錄
daemon_directory = /usr/libexec/postfix
#
data_directory = /var/lib/postfix
#
debug_peer_level = 2
 
#重複郵件
enable_original_recipient = no
#
html_directory = /usr/share/doc/postfix-2.6.2-documentation/html
#
mail_name = Postfix – welcome mail.xmall.com
 
#以此參數指定的系統賬戶,作爲隊列文件的擁有者以及postfix daemon 進程的運行身份
mail_owner = postfix
 
#單封郵件大小限制,單位字節
mailbox_size_limit = 150242880
 
#
mailq_path = /usr/bin/mailq.postfi
 
#manpage 目錄
manpage_directory = /usr/share/man
 
#postfix在放棄投遞而返回不可投遞信息前,被延遲郵件再deferred郵件隊列中的生存時間
maximal_queue_lifetime = 1d
 
#限制單封郵件的最大長度,單位字節
message_size_limit = 150242880
 
#設置”本地網域”
mydestination = $mynetworks $myhostname
 
#完整主機名稱(主機名稱+網域名稱)
myhostname = mail.xmall.com
 
#郵件系統的網域名稱
mydomain = xmall.com
 
#附加到只含人名部分的,不完整郵件地址的網域名稱
myorigin
 
#列出可通過本郵件系統寄出郵件的網絡地址或ip地址
mynetworks = 127.0.0.1
 
#兼容sendmail,用於重建別名數據庫的newaliases程序路徑
newaliases_path = /usr/bin/newaliases.postfix
 
#postfix 隊列的主目錄
queue_directory = /var/spool/postfix
 
#
readme_directory = /usr/share/doc/postfix-2.6.2-documentation/readme
#
receive_override_options = no_address_mappings
 
#樣本配置文件目錄
sample_directory = /etc/postfix
 
#供腳本或命令行用來寄送郵件
sendmail_path = /usr/sbin/sendmail.postfix
 
#用來提交郵件或管理隊列的組標識符
setgid_group = postdrop
 
#
show_user_unknown_table_name = no
 
#smtp 問候信息
smtpd_banner = $myhostname ESMTP $mail_name
 
#當客戶端引發錯誤時,postfix 的初始等待時間
smtpd_error_sleep_time = 0s
 
#收件人限制條件
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, check_policy_service inet:127.0.0.1:10030
 
#啓動sasl 驗證
smtpd_sasl_auth_enable = yes
 
#
smtpd_sasl_local_domain = $myhostname
 
#指定密碼驗證機制(除noanonymous) 所有可用機制
smtpd_sasl_security_options = noanonymous
 
#設定寄件地址與sasl登錄身份的對應關係,只能使用本域地址避免使用其他寄件地址!
smtpd_sender_login_maps = mysql:/etc/postfix/mysql_virtual_sender_maps.cf, mysql:/etc/postfix/mysql_virtual_alias_maps.cf
 
#發件人限制條件
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, reject_authenticated_sender_login_mismatch, reject_unauthenticated_sender_login_mismatch
 
#
unknown_local_recipient_reject_code = 550
 
#指向含有“虛擬別名地址”與“實際收件地址”對應關係的查詢表
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
 
#虛擬網域查詢表
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
 
#虛擬郵箱查詢表
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
 
#用於投遞郵件到虛擬郵箱地址的默認傳輸服務(虛擬mda)

virtual_transport = maildrop:

##設置一封郵件允許有多少個收件人,這裏指定一封郵件可以同時發給50個人
smtpd_recipient_limit = 50


##當超過該參數所指定的錯誤次數時,系統強制斷開客戶端,這裏指定爲5次
smtpd_hard_error_limit = 5
 
##smtp服務器的最大併發鏈接數,這裏指定爲300
default_process_limit = 300
 
##控制對同一目標主機的初始化併發連接數目,這裏調整爲10
initial_destination_concurrency = 10
 
##缺省的對同一目標主機的最大併發連接數目,這裏調整爲10
default_destination_concurrency_limit = 10
 
##控制對同一本地收件人的最大同時投遞的郵件數目
local_destination_concurrency_limit = 2

 
五 維護 postfix 的命令
newaliases (重建別名數據庫)
postalias /etc/postfix/aliases (創建或查詢別名數據庫)
postcat (顯示隊列文件內容)
postconf (修改 main.cf 配置文檔 )
postqueue (査看postfix 隊列)
postsuper (管理員管理 postfix 隊列)
postmap (創建查詢表的DB數據庫或查詢查詢表內容)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章