posrfix 收不到郵件??(已解決)
這是我的配置文件:
# postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_name = Postfix - by sc.com
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 14336000
mydomain = sc.com
myhostname = mail.sc.com
mynetworks = 192.168.10.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name
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
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:1000
virtual_mailbox_base = /home/domains/
virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 20971520
virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
virtual_transport = maildrop
virtual_uid_maps = static:1000
# cat /etc/postfix/master.cf
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=vuser argv=/usr/local/maildrop/bin/maildrop -w 90 d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
收不到郵件,日誌也沒有任何顯示!!
[ 本帖最後由 songpure520 於 2007-11-8 13:53 編輯 ]
《解決方案》
理論上, 有virtual_mailbox_domains和virtual_mailbox_maps就基本能收了, 我看你都有, 所以先試驗一下
先telnet 到自己伺服器的25埠看看有沒有反應
如果有,貼/var/log/maillog上來看看
[ 本帖最後由 富貴貓 於 2007-11-7 23:30 編輯 ]
《解決方案》
# telnet mail.sc.com 25
Trying 192.168.10.168...
Connected to mail.sc.com (192.168.10.168).
Escape character is '^]'.
220 mail.sc.com ESMTP Postfix - by sc.com
ehlo mail.sc.com
250-mail.sc.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:<sc@sc.com>
250 2.1.0 Ok
rcpt to:<www@www.co
501 5.1.3 Bad recipient address syntax
<
502 5.5.2 Error: command not recognized
rcpt to:<www@sc.com>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
djifo
djfio
djsif
.
250 2.0.0 Ok: queued as 61CE3C60110
quit
221 2.0.0 Bye
Connection closed by foreign host.
# tail /var/log/maillog
Nov 8 10:09:11 mail postfix/smtpd: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Nov 8 10:09:11 mail postfix/smtpd: connect from mail.sc.com
Nov 8 10:09:21 mail postfix/smtpd: disconnect from mail.sc.com
Nov 8 10:09:22 mail postfix/smtpd: connect from mail.sc.com
Nov 8 10:10:05 mail postfix/smtpd: 61CE3C60110: client=mail.sc.com
Nov 8 10:10:10 mail postfix/cleanup: 61CE3C60110: message-id=<20071108021005.61CE3C60110@mail.sc.com>
Nov 8 10:10:10 mail postfix/qmgr: 61CE3C60110: from=<sc@sc.com>, size=351, nrcpt=1 (queue active)
Nov 8 10:10:10 mail maildrop: Temporary authentication failure.
Nov 8 10:10:10 mail postfix/pipe: 61CE3C60110: to=<www@sc.com>, relay=maildrop, delay=29, delays=29/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: ERR: authdaemon: s_connect() failed: Permission denied maildrop: Temporary authentication failure. )
Nov 8 10:10:11 mail postfix/smtpd: disconnect from mail.sc.com
根據日誌來看是maildrop的錯誤,我的postfix和maildrop是用RPM安裝的,另外我把/etc/postfix/master.cf里改成
maildrop unix - n n - - pipe
#flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
flags=DRhu user=vuser argv=maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}
如果我編譯安裝maildrop,把/etc/postfix/master.cf修改成
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
那麼telnet 25 日誌就會出現如此錯誤:
Nov 8 10:30:54 mail postfix/smtpd: connect from mail.sc.com
Nov 8 10:31:17 mail postfix/smtpd: 7AB7EC60114: client=mail.sc.com
Nov 8 10:31:21 mail postfix/cleanup: 7AB7EC60114: message-id=<20071108023117.7AB7EC60114@mail.sc.com>
Nov 8 10:31:21 mail postfix/qmgr: 7AB7EC60114: from=<sc@sc.com>, size=351, nrcpt=1 (queue active)
Nov 8 10:31:22 mail maildrop: Unable to open filter file, errno=2.
Nov 8 10:31:22 mail postfix/pipe: 7AB7EC60114: to=<www@sc.com>, relay=maildrop, delay=14, delays=14/0/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: /usr/local/maildrop/bin/maildrop: Unable to open filter file, errno=2. )
Nov 8 10:31:23 mail postfix/smtpd: disconnect from mail.sc.com
但是我不知道maildrop到底是哪裡錯了???
[ 本帖最後由 songpure520 於 2007-11-8 10:35 編輯 ]
《解決方案》
問題終於解決,原因在於courier-authlib 如果編譯的話必須要加入--with-mailuser,--with-mailgroup,這兩項,如果是用RPM安裝的話,就必須敲這條命令chmod 755 /var/spool/authdaemon/ 如果該目錄許可權不正確修改,maildrop及postfix等將無法正確獲取用戶的信息及密碼認證,當然maildrop的安裝方式不同,/etc/postfix/master.cf的 maildrop的配置也不同