我正在尝试设置 Dovecot 和 Postfix 邮件服务器。我对服务器的要求如下:
- 信息地图系统
- SMTP(如果是选项的话,是安全的吗?)
- IMAPS 和 SMTP 都必须需要来自 MySQL 的用户,同一张表。
- 邮件存储在 /home/mail/domain/account 中的 maildir 中
到目前为止我想就是这样了,但是我成功地把某些地方搞乱了。现在我只能接收邮件,我认为这是第一部分。
我在邮件中收到了这个。
Sep 1 22:04:38 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep 1 22:04:38 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: connect from xxx.yyy.dk[xx.xx.200.10]
Sep 1 22:04:38 Debian-60-squeeze-64-minimal dovecot: auth(default): new auth connection: pid=9490
Sep 1 22:04:39 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: 06A5118F4F19: client=xxx.yyy.dk[xx.xx.200.10]
Sep 1 22:04:39 Debian-60-squeeze-64-minimal postfix/cleanup[9493]: 06A5118F4F19: message-id=<[email protected]>
Sep 1 22:04:39 Debian-60-squeeze-64-minimal postfix/qmgr[9342]: 06A5118F4F19: from=<[email protected]>, size=11227, nrcpt=1 (queue active)
Sep 1 22:04:39 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: disconnect from xxx.yyy.dk[xx.xx.200.10]
Sep 1 22:04:39 Debian-60-squeeze-64-minimal postfix/qmgr[9342]: warning: connect to transport private/dovecot: No such file or directory
Sep 1 22:04:39 Debian-60-squeeze-64-minimal postfix/error[9494]: 06A5118F4F19: to=<[email protected]>, relay=none, delay=0.14, delays=0.13/0.01/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)
mail.warn 中的这一行
Sep 1 22:04:38 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
请不要只提供一个教程链接,我花了一整天的时间才弄清楚。谢谢。
我有这个main.cnf
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
#delay_warning_time = 4h
myhostname = xxx.dk
myorigin = xxx.dk
mydestination = localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
# Virtual mailbox settings
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_base = /home/mail
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_minimum_uid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
# SASL Authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
message_size_limit = 30720000
virtual_alias_domains =
smtpd_sasl_authenticated_header = yes
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $send$
我认为这是 master.cf 中的相关行
maildrop unix - n n - - pipe
flags=DRhu user=mail argv=/usr/lib/dovecot/deliver -d ${recipient}
如果我执行 /usr/lib/dovecot/deliver 就会发生这种情况 我认为我可以实现它。
# /usr/lib/dovecot/deliver
Fatal: destination user parameter (-d user) not given
或者
# /usr/lib/dovecot/deliver -d emil
(然后什么也没有发生)。两种情况都没有在 /home/mail 中提供任何文件夹
答案1
NIS 错误无关紧要。您nis
的 中可能有一个条目postfix/dynamicmaps.cfg
,您可以将其删除/注释掉,因为您没有使用 NIS(我希望如此)。
您的邮件出现问题是因为 Postfix 无法连接到您的 Dovecot 服务器。您的 中的相关行是什么postfix/master.cfg
?
答案2
我已经发现本教程我现在正在关注它,它非常好并且描述性很强。