大网数据广告活动
服务器运维问答

Mail delivered but not seen in client

· 52CE 我爱测

I have the following mail server setup (dovecot --version = 2.2.13 , postfix version=2.11.3-1), the user aliases are stored in mariadb and the authentication is against an active directory server. Everything seems to be fine (ali…

问题原文

原帖链接 · Ants0 · CC BY-SA 3.0

I have the following mail server setup (dovecot --version = 2.2.13 , postfix version=2.11.3-1), the user aliases are stored in mariadb and the authentication is against an active directory server. Everything seems to be fine (alias lookup, NTLM authentication, etc ..) but not the delivery. The mail seems to be delivered correctly inside the mailbox but it doesn't come on any clients.

==> /var/log/mail.log <==
Jan  9 11:18:51 smail spamd[18014]: spamd: result: . 0 -   ALL_TRUSTED,HTML_MESSAGE scantime=0.1,size=4279,user=debian-spamd,uid=113,required_score=5.0,rhost=localhost,raddr=::1,rport=57414,mid=<001a01d26a50$fc7ffd60$f57ff820$@mail.bfm>,autolearn=ham autolearn_force=no

 ==> /var/log/mail.info <==
 Jan  9 11:18:51 smail spamd[18014]: spamd: result: . 0 - ALL_TRUSTED,HTML_MESSAGE scantime=0.1,size=4279,user=debian-spamd,uid=113,required_score=5.0,rhost=localhost,raddr=::1,rport=57414,mid=<001a01d26a50$fc7ffd60$f57ff820$@mail.bfm>,autolearn=ham autolearn_force=no

 ==> /var/log/mail.log <==
 Jan  9 11:18:51 smail spamd[18013]: prefork: child states: II

 ==> /var/log/mail.info <==
 Jan  9 11:18:51 smail spamd[18013]: prefork: child states: II

 ==> /var/log/mail.log <==
 Jan  9 11:18:51 smail postfix/pipe[1960]: 910D221F870: to=<[email omitted]>, relay=spamassassin, delay=0.32, delays=0.08/0/0/0.24, dsn=2.0.0, status=sent (delivered via spamassassin service)

Jan 9 11:18:51 smail postfix/qmgr[1864]: 910D221F870: removed Jan 9 11:18:51 smail postfix/pickup[1863]: DE51C21F8AC: uid=113 from=

 ==> /var/log/mail.info <==
 Jan  9 11:18:51 smail postfix/pipe[1960]: 910D221F870: to=<[email omitted]>, relay=spamassassin, delay=0.32, delays=0.08/0/0/0.24, dsn=2.0.0, status=sent (delivered via spamassassin service)

Jan 9 11:18:51 smail postfix/qmgr[1864]: 910D221F870: removed Jan 9 11:18:51 smail postfix/pickup[1863]: DE51C21F8AC: uid=113 from=

 ==> /var/log/mail.log <==
 Jan  9 11:18:51 smail postfix/cleanup[1958]: DE51C21F8AC: message- id=<001a01d26a50$fc7ffd60$f57ff820$@mail.bfm>

 ==> /var/log/mail.info <==
 Jan  9 11:18:51 smail postfix/cleanup[1958]: DE51C21F8AC: message-id=<001a01d26a50$fc7ffd60$f57ff820$@mail.bfm>

 ==> /var/log/mail.log <==
 Jan  9 11:18:51 smail postfix/qmgr[1864]: DE51C21F8AC: from=<[email omitted]>, size=4738, nrcpt=1 (queue active)

 ==> /var/log/mail.info <==
 Jan  9 11:18:51 smail postfix/qmgr[1864]: DE51C21F8AC: from=<[email omitted]>, size=4738, nrcpt=1 (queue active)

  ==> /var/log/mail.log <==
  Jan  9 11:18:52 smail postfix/local[1964]: DE51C21F8AC: to=<[email omitted]>, relay=local, delay=0.24, delays=0.15/0/0/0.08, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")

  ==> /var/log/mail.info <==
  Jan  9 11:18:52 smail postfix/local[1964]: DE51C21F8AC: to=<[email omitted]>, relay=local, delay=0.24, delays=0.15/0/0/0.08, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSIO

I checked both the mail locations in postfix and dovecot and they seems to match:

**postconf -n**
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname, localhost.$mydomain, localhost
myhostname = smail.localdomain.lan
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_sasl_authenticated,        permit_mynetworks, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/mail/
virtual_mailbox_domains = $mydomain
virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
virtual_minimum_uid = 5000
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_uid_maps = static:5000

and dovecot -n

# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.6 ext4
auth_mechanisms = plain ntlm login
auth_use_winbind = yes
mail_location = maildir:/var/mail/%u
mail_privileged_group = vmail
namespace inbox {
inbox = yes
location = 
 mailbox Drafts {
    special_use = \Drafts
 }
 mailbox Junk {
 special_use = \Junk
 }
 mailbox Sent {
 special_use = \Sent
 }
 mailbox "Sent Messages" {
 special_use = \Sent
 }
 mailbox Trash {
 special_use = \Trash
  }
 prefix = 
  }
  passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
  }
  passdb {
   args = /etc/dovecot/dovecot-sql.conf.ext
   driver = sql
   }
   protocols = imap lmtp
   service auth-worker {
    user = vmail
   }
   service auth {
   unix_listener /var/spool/postfix/private/auth {
   group = postfix
   mode = 0666
   user = postfix
   }
   unix_listener auth-userdb {
   mode = 0666
    user = vmail
    }
   user = root
   }
    service imap-login {
    inet_listener imap {
    port = 0
   }
   }
   service lmtp {
   unix_listener /var/spool/postfix/private/dovecot-lmtp {
   group = postfix
   mode = 0666
   user = postfix
    }
    }
   ssl = required
   ssl_cert = </etc/dovecot/dovecot.pem
   ssl_key = </etc/dovecot/private/dovecot.pem
   userdb {
   args = uid=5000 gid=5000 home=/var/mail/%u
   driver = static
   }

If any one could give a hint, I would really be grateful ... Thank you

已采纳解答

原帖链接 · Ants0 · CC BY-SA 3.0

I made fool of myself by posting this ... still learning :D ... This has been fixed, there were may issues with the above config: the dynamic uid/gid provided by AD screwed everything (had to statically define vmail as the one that should be used to access the Maildir dir), Dovecot mail location and postfix didn't match (had to fix that up) ... thank you

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。