postfix常用錯誤解決方案

FAQ
1. 啓動 postfix 報錯
#/usr/sbin/postfix start
postfix: fatal: /etc/postfix/main.cf, line 34: missing '=' after attribute name: "permit_mynetworks,"
原因 smtpd_recipient_restrictions =後面的選項要連續,不能換行
改成 
smtpd_recipient_restrictions =permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination,permit
2. 不能正常啓動 postfix ,無報錯
查看 tail -f /var/log/maillog
Jun 16 17:57:45 ud20009 postfix/postfix-script[2770]: starting the Postfix mail system
Jun 16 17:57:45 ud20009 postfix/master[2771]: fatal: /etc/postfix/master.cf: line 103: bad transport type: user=vmail:vmail
修改
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

3.fatal: open database /etc/aliases.db: No such file or directory
文件存在,但是格式不對,導致的原因可能是aliases.db文件是由Berkeley DB版本1創建的,
但是你 現在使用的是版本2或者3,或者這個文件是用btree格式建立的,但是postfix能識別的格式是hash,
解決的方法是以root的身份執 行newaliases,這樣就能建立一個postfix能識別的aliases.db文件。
# touch /etc/aliases
# newaliases
4. warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
warning: unsupported SASL server implementation: cyrus
fatal: SASL per-process initialization failed
warning: process /usr/libexec/postfix/smtpd pid 16840 exit status 1
warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
原因2.3版本以後需要加入對CYRUS的認證
解決方法 加入-DUSE_CYRUS_SASL選項,重新編譯。
make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DUSE_CYRUS_SASL -I/usr/local/include/sasl' 'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2'
make && make install

5. postfix啓動報錯
Jun 17 12:09:25 ud20009 postfix/smtpd[11023]: warning: smtpd_sasl_auth_enable is true, but SASL support is not compiled in
Jun 17 12:09:25 ud20009 postfix/smtpd[11023]: connect from unknown[125.34.78.179]
Jun 17 12:09:25 ud20009 postfix/trivial-rewrite[11026]: warning: do not list domain win123.cn in BOTH virtual_mailbox_domains and relay_domains
原因還是在編譯postfix時沒有 加入-DUSE_SASL_AUTH。
正確的是 
make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include \
-DUSE_CYRUS_SASL -DUSE_SASL_AUTH -I/usr/local/include/sasl' \
'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2'
make && make install
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章