【问题标题】:linux postfix config and hostname FQDNlinux 后缀配置和主机名 FQDN
【发布时间】:2013-08-21 07:51:45
【问题描述】:

我正在尝试使用来自 https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql#sph_prerequisites 的教程设置一个带有 postfix 和 dovecot 的邮件服务器

我遵循了每一个步骤,并在防火墙中打开了每个邮件端口,但是当我尝试将我的电子邮件客户端设置为与 IMAP 或 POP3 连接时,它就是无法建立连接。

看来我可以使用我的私人邮箱向我的域发送电子邮件。反正我的日志 /var/log/mail.log 是空的。

我猜这与设置主机名 (FQDN) 和后缀配置有关。但我对主机名和 FQDN 有点困惑。 在我的 linode 的 DNS 管理器中,我添加了我的域,在这个例子中是:mydomain.com

在 mydomain.com 里面我有这个:

MX record 
mail.mydomain.com

A/AAAA Records
           120.120.120.120
www        120.120.120.120
mail       120.120.120.120
donald     120.120.120.120

donald 是我在教程中遵循的 FQDN

现在在我的 linux 服务器中,我有一些东西:

/etc/hosts
127.0.0.1       localhost
127.0.1.1       ubuntu
120.120.120.120 donald.mydomain.com        donald

/etc/mailname
donald.mydomain.com

后缀配置

/etc/postfix/main.cf
....
myhostname = mail.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
....

如您所见,我认为这是在此配置中出了点问题。我不明白什么是 myhostname 和 mydestination 以及邮件名......有人可以用这些配置纠正我吗?

谢谢!

编辑 我发现我在 dovecot 主配置中有一个错误,而且那个 smtp 端口已经在使用中。好吧,我重新启动了我的服务器,postfix 和 dovecot 都在运行。我可以将 imap 服务器绑定到我的 Outlook 客户端并接收邮件。现在,当我尝试回复电子邮件时,我收到了这条消息:554 5.7.1 : Relay access denied

这也是我的后缀配置:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = localhost
myhostname = mail.mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_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/ssl/certs/dovecot.pem
smtpd_tls_key_file = /etc/ssl/private/dovecot.pem
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp

【问题讨论】:

    标签: linux dns postfix-mta administration hostname


    【解决方案1】:

    更多帮助请参考postfix configuration parameters

    myorigin = mydomain.com 
    # The domain name to append when the UNIX user sends out a mail. (For eg. If UNIX user john sends mail, then john@mydomain.com will be the sender address
    myhostname = mail.mydomain.com
    # The unique FQDN of your mail server. When talking to other SMTP servers, it identifies itself as mail.mydomain.com
    mydestination = mydomain.com mail.mydomain.com
    # You are instructing postfix to receive mails for the domains mydomain.com mail.mydomain.com, whose valid recipients can be specified using local_recipient_maps
    

    您能否编辑您的问题并粘贴postconf -n 的输出,这将有助于识别问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-11
      • 2018-09-14
      • 1970-01-01
      • 1970-01-01
      • 2020-01-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多