Postfix 无法获取我的域名?

Postfix 无法获取我的域名?

你好,我正在尝试设置 webmin+postfix+dovecot+roundcube,目前我希望事情尽可能简单,所以我使用 linux 用户作为电子邮件帐户。

我可以从同一个域发送/接收,我的意思是[电子邮件保护]可以发送/接收[电子邮件保护] 我使用 Outlook 测试了 smtp/imap,没有问题。如果我从 Gmail 发送邮件,它会被拒绝并出现以下错误:

Technical details of temporary failure:
The recipient server did not accept our requests to connect.

当我使用 roundcube 登录时,右上角显示的电子邮件地址类似于,user1@com并且我从日志中收到此错误消息:

[11-Nov-2012 07:39:03 +0400]: IMAP Error: Login failed for user1 from 187.150.xx.xx. Could not connect to com:143: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/webmail/program/include/rcube_imap.php on line 191 (POST /webmail/?_task=login&_action=login)

它说无法连接到通讯:143

看起来它无法读取域名。

我用了http://mxtoolbox.com/检查 mx 记录,它说可以找到 mail.mydomain.com 的服务器。我不确定问题出在 postfix 还是我的服务器配置上,但我一直在寻找每个配置文件,却找不到答案。任何建议我都会很感激。

这是我的一些配置(我不想让这个问题太长,我可以提供任何其他信息来解决这个问题):

后缀main.cf

#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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
smtpd_sasl_security_options = noanonymous
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

mydomain = mydomain.com
myhostname = mail.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $mydomain, $myhostname
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 = +
virtual_alias_domains = mydomain.com
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permit_sasl_authenticated
myorigin = $mydomain

roundcube 会议

// ---------------------------------- // IMAP // ----------------------------------

$rcmail_config['default_host'] = '%d';
$rcmail_config['default_port'] = 143;
$rcmail_config['imap_auth_type'] = null;
$rcmail_config['imap_delimiter'] = null;
$rcmail_config['imap_ns_personal'] = null;
$rcmail_config['imap_ns_other']    = null;
$rcmail_config['imap_ns_shared']   = null;
$rcmail_config['imap_force_caps'] = false;
$rcmail_config['imap_force_lsub'] = false;
$rcmail_config['imap_force_ns'] = false;
$rcmail_config['imap_timeout'] = 0;
$rcmail_config['imap_auth_cid'] = null;
$rcmail_config['imap_auth_pw'] = null;
$rcmail_config['imap_cache'] = null;
$rcmail_config['messages_cache'] = false;

答案1

圆立方体

Roundcube 错误是由于缺少身份验证方法

$rcmail_config['imap_auth_type'] = LOGIN;

后缀

在你的主配置文件, 消除virtual_alias_domains = mydomain.com。单域配置不需要该配置,而且格式错误。该变量需要映射文件。这里是 Postfix 配置变量信息的完整列表。

主要问题是smtpd_recipient_restrictions丢失的允许修改如下

smtpd_recipient_restrictions =
    permit_mynetworks
    reject_unauth_destination
    permit_sasl_authenticated
    permit

重新启动 postfix 并重新测试外部邮件。如果错误仍然存​​在,请检查以下内容以获取与 gmail 服务器连接相关的任何信息

/var/log/syslog
/var/log/mail.log
/var/log/mail.err

然后在您的问题中添加相关的日志行。

相关内容