我用ubuntu安装了postfix和dovecot(1.2.12)。
这是我的main.cf
alias_maps = append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix inet_interfaces = all mailbox_size_limit = 0 mydomain = example.net myhostname = mail.example.net mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 readme_directory = no recipient_delimiter = + relayhost = smtp_use_tls = yes smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/dovecot-auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key smtpd_tls_mandatory_ciphers = high smtpd_tls_mandatory_protocols = SSLv3, TLSv1 smtpd_tls_received_header = yes tls_random_source = dev:/dev/urandom virtual_gid_maps = static:5001 virtual_mailbox_base = /home/postfix/vmail virtual_mailbox_domains = /etc/postfix/virtual_domains virtual_mailbox_maps = hash:/etc/postfix/virtual virtual_uid_maps = static:5001
这是我的dovecot.conf
protocols = imap imaps log_timestamp = "%Y-%m-%d %H:%M:%S " log_path = /var/log/dovecot.log mail_privileged_group = vmail protocol imap { mail_max_userip_connections = 10 } auth default { mechanisms = plain login # imaps/ smtp user database passdb passwd-file { args = /home/postfix/vmail/passwd } # all mail is mapped to this user. userdb static { args = uid=vmail gid=vmail home=/home/postfix/vmail/%d/%n } user = root !include_try /etc/dovecot/auth.d/*.auth } dict { } plugin { } !include_try /etc/dovecot/conf.d/*.conf
(conf.d /和auth.d /是空的)
我没有看到日志上的错误,但与这种configuration,我可以收到电子邮件,但我不能发送电子邮件…我总是有这个错误:
中继访问被拒绝
我试图从我的帐户发送电子邮件到@ gmail.com帐户
有问题? 谢谢!
postfix&dovecot和电子邮件客户端本身在同一台机器上?
如果没有,你需要修改我的networking来包含你的IP范围。
编辑:对不起,没有看到你正在使用SASL。 当您尝试通过telnet发送电子邮件时,您应该testingSASL是否正在工作。 有关于如何做到这一点的文章..