我尝试使用Postfix,Dovecot和LDAP在Ubuntu上设置邮件服务器。 到目前为止,我可以使用Postfix发送和接收邮件,并可以通过telnet(端口143)与LDAP用户连接到Dovecot。
作为下一步,我希望将Dovecotconfiguration为我的LDA,如R.Hildebrandt和PB Koetter在Postfix中所build议的那样。 但是直到现在,Postfix都试图使用本地的deamon把邮件发送给本地的收件人。
到目前为止,我configuration了以下(实际的域被replace为example.com ):
在/etc/dovecot/conf.d/15-lda.conf中激活dovecot传递:
protocol lda { postmaster_address = [email protected] } service auth { unix_listener auth-master { mode = 0600 user = vmail } }
在/etc/postfix/master.cf中安装dovecot:
dovecot unix - nn - - pipe flags=ODRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -e -f ${sender} -d ${recipient}
在/etc/postfix/main.cf中configuration虚拟传输:
virtual_transport = dovecot dovecot_destination_recipient_limit = 1
当我发出命令echo foo | /usr/sbin/sendmail -f [email protected] [email protected] echo foo | /usr/sbin/sendmail -f [email protected] [email protected]我收到以下日志输出:
postfix/qmgr[25582]: 2AA0060E36: from=<[email protected]>, size=272, nrcpt=1 (queue active) postfix/local[26102]: 2AA0060E36: to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "ttester")
用户ttester存在于LDAP树中,可以通过Dovecotfind。 例如,如果我手动发送deliver命令邮件发送。 但是,只有在不指定域的情况下:
/usr/lib/dovecot/deliver -e -f [email protected] -d ttester
总结这个问题,我怀疑由于某些原因,Postfix并没有将传递委托给Dovecot。 任何帮助,高度赞赏。
提前致谢!
这是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 = $mydomain, $myhostname, localhost, localhost.$mydomain myhostname = mail.example.com mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_data_restrictions = reject_multi_recipient_bounce smtpd_helo_required = yes smtpd_recipient_restrictions = reject_non_fqdn_recipient reject_non_fqdn_sender reject_unknown_recipient_domain reject_unknown_sender_domain permit_mynetworks reject_sender_login_mismatch reject_unauth_destination check_recipient_access hash:/etc/postfix/roleaccount_exceptions reject_multi_recipient_bounce reject_non_fqdn_helo_hostname reject_invalid_helo_hostname check_helo_access pcre:/etc/postfix/helo_checks check_sender_mx_access cidr:/etc/postfix/bogus_mx permit smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_transport = dovecot
Postfix将使用地址类来确定哪个域类及其传送邮件。
根据你的postconf输出, $domain / example.com被列在mydestination ,所以它将使用本地地址类,并使用$local_transport参数(运行postconf local_transport )来发送邮件。
这就是为什么virtual_transport被postfix忽略的原因。 build议的解决scheme是从mydestination中移除$ mydomain,并将其放在virtual_mailbox_domains 。