Ric*_*yna 6 email postfix dovecot
过去几周我一直在使用 postfix、dovecot 和 mysql 配置我的邮件服务器。我有一个虚拟域和几个虚拟邮箱。使用 squirrelmail 我已经能够登录我的帐户并发送电子邮件(例如,我可以发送到 googlemail 就好了),但是我无法接收任何电子邮件——既不能从外部世界也不能从我自己的网络内接收。
我能够在端口 25 上使用 localhost、我的私人 ip 和我的公共 ip 进行 telnet 没有任何问题(我已经从服务器本身和我网络上的另一台计算机上尝试过)。
这是我从我的 googlemail 帐户向我的邮件服务器发送电子邮件时在我的日志中得到的信息:
邮件日志
4 月 14 日 07:36:06 server1 postfix/qmgr[1721]:BE01B520538:from=,>size=733,nrcpt=1(队列活动)
4 月 14 日 07:36:06 server1 postfix/pipe[3371]: 78BC0520510: to=, >relay=dovecot, delay=45421, delays=45421/0/0/0.13, dsn=4.3.0, status=deferred (tempor >失败。命令输出:无法打开日志文件/var/log/mail-dovecot.log:权限被拒绝)
4 月 14 日 07:36:06 server1 postfix/pipe[3391]:8261B520534:to=,>relay=dovecot,延迟=38036,延迟=38036/0.06/0/0.12,dsn=4.3.0,状态=延迟暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:36:06 server1 postfix/pipe[3378]:63927520532:to=,>relay=dovecot,延迟=38105,延迟=38105/0.02/0/0.17,dsn=4.3.0,状态=延迟暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:36:06 server1 postfix/pipe[3375]: 07F65520522: to=, >relay=dovecot, delay=39467, delays=39467/0.01/0/0.17, dsn=4.3.0, status=defer暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:36:06 server1 postfix/pipe[3381]: EEDE9520527: to=, >relay=dovecot, delay=38361, delays=38360/0.04/0/0.15, dsn=4.3.0, status=deferred >(暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:36:06 server1 postfix/pipe[3379]:67DFF520517:to=,>relay=dovecot,delay=40475,delays=40475/0.03/0/0.16,dsn=4.3.0,status=deferred暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:36:06 server1 postfix/pipe[3387]: 3C7A052052E: to=, >relay=dovecot, delay=38259, delays=38259/0.05/0/0.13, dsn=4.3.0, status=deferred暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:36:06 server1 postfix/pipe[3394]: BE01B520538: to=, >relay=dovecot, delay=37682, delays=37682/0.07/0/0.11, dsn=4.3.0, status=deferred暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:36:07 server1 postfix/pipe[3384]: 3C7A052052E: to=, >relay=dovecot, delay=38261, delays=38259/0.04/0/1.3, dsn=4.3.0, status=deferred暂时失败。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied )
4 月 14 日 07:39:23 server1 postfix/anvil[3368]:统计:4 月 14 日 07:35:32(smtp:209.85.213.169)的最大连接速率 1/60s
4 月 14 日 07:39:23 server1 postfix/anvil[3368]:统计信息:4 月 14 日 07:35:32(smtp:209.85.213.169)的最大连接数为 1
4 月 14 日 07:39:23 server1 postfix/anvil[3368]:统计信息:4 月 14 日 07:35:32 的最大缓存大小为 1
4 月 14 日 07:41:06 server1 postfix/qmgr[1721]: ED6005203B7: from=, size=1463, nrcpt=1 (queue active)
4 月 14 日 07:41:06 server1 postfix/pipe[4594]:ED6005203B7:to=,relay=dovecot,delay=334,delays=334/0.01/0/0.13,dsn=4.3.0,status=deferred(临时故障) . 命令输出:Can't open log file /var/log/mail-dovecot.log: Permission denied )
4 月 14 日 07:51:06 server1 postfix/qmgr[1721]: ED6005203B7: from=, size=1463, nrcpt=1 (queue active)
4 月 14 日 07:51:06 server1 postfix/pipe[4604]:ED6005203B7:to=,relay=dovecot,delay=933,delays=933/0.02/0/0.12,dsn=4.3.0,status=deferred(临时故障) . 命令输出:Can't open log file /var/log/mail-dovecot.log: Permission denied )
mail-dovecot-log(我为调试设置的日志):
4 月 14 日 07:28:26 auth:信息:mysql(127.0.0.1):连接到数据库 postfixadmin
4 月 14 日 07:28:26 身份验证:调试:sql(some.user1@mydomain.com,127.0.0.1):查询:SELECT >password FROM 邮箱 WHERE username = 'some.user1@mydomain.com'
4 月 14 日 07:28:26 身份验证:调试:客户端输出:OK 1 user=some.user1@mydomain.com
4 月 14 日 07:28:26 身份验证:调试:掌握:请求 1809973249 3356 1 7cfb822db820fc5da67d0776b107cb3f
4 月 14 日 07:28:26 身份验证:调试:sql(some.user1@mydomain.com,127.0.0.1):选择 '/home/vmail/mydomain.com/some.user1' 作为 home,5000 AS uid,5000 AS gid FROM 邮箱 WHERE username = 'some.user1@mydomain.com'
4 月 14 日 07:28:26 身份验证:调试:主输出:用户 1809973249 some.user1@mydomain.com home=/home/vmail/mydomain.com/some.user1 uid=5000 gid=5000
4 月 14 日 07:28:26 imap-login:信息:登录:user=,method=PLAIN,>rip=127.0.0.1,lip=127.0.0.1,mpid=3360,安全
4 月 14 日 07:28:26 imap(some.user1@mydomain.com):调试:有效 uid=5000,gid=5000,home=/home/vmail/mydomain.com/some.user1
4 月 14 日 07:28:26 imap(some.user1@mydomain.com):调试:maildir++:root=/home/vmail/mydomain.com/some.user1/Maildir,index=/home/vmail/mydomain.com/ some.user1/Maildir/indexes, control=, inbox=/home/vmail/mydomain.com/some.user1/Maildir
4 月 14 日 07:48:31 imap(some.user1@mydomain.com):信息:断开连接:注销字节=85/681
从上面的输出中,我很确定我的问题都源于(临时故障。命令输出:无法打开日志文件 /var/log/mail-dovecot.log: >Permission denied ),但我不知道为什么我收到那个错误。我拥有该日志集的权限,就像其他邮件日志一样:
root@server1:~# ls -l /var/log/mail*
-rw-r----- 1 syslog adm 196653 2012-04-14 07:58 /var/log/mail-dovecot.log
-rw-r----- 1 syslog adm 62778 2012-04-13 21:04 /var/log/mail.err
-rw-r----- 1 syslog adm 497767 2012-04-14 08:01 /var/log/mail.log
Run Code Online (Sandbox Code Playgroud)
有谁知道我可能做错了什么?
这是我的 main.cf 和 master.cf 文件: main.cf:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = server1.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
# Virtual Configs
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
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
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
virtual_transport=dovecot
dovecot_destination_recipient_limit = 1
Run Code Online (Sandbox Code Playgroud)
大师.cf:
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
#smtp inet n - - - 1 postscreen
#smtpd pass - - - - - smtpd
#dnsblog unix - - - - 0 dnsblog
#tlsproxy unix - - - - 0 tlsproxy
#submission inet n - - - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 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=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus unix - n n - - pipe
# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/cyrus/bin/deliver -e -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=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
Run Code Online (Sandbox Code Playgroud)
Postfix 将运行/usr/lib/dovecot/deliver
以传递邮件,但似乎deliver
失败了,因为它无法写入/var/log/mail-dovecot.log
. 我不确定它以什么用户身份运行,但我猜postfix
,所以尝试让用户可以mail-dovecot.log
写postfix
。
归档时间: |
|
查看次数: |
13087 次 |
最近记录: |