簡體   English   中英

linux postfix配置和主機名FQDN

[英]linux postfix config and hostname FQDN

我正在嘗試使用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以及mailname ...有人可以用theses配置糾正我嗎?

謝謝!

編輯我發現我在dovecot主配置中有一個錯誤,而且還有已經在使用的smtp端口..好吧,我重新啟動了我的服務器,后綴和dovecot都在運行。 我可以將imap服務器綁定到我的Outlook客戶端並接收郵件。 現在,當我嘗試回復電子郵件時,我收到此消息: 554 5.7.1 : Relay access denied

這里也是我的postfix配置:

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

請參閱postfix配置參數以獲取更多幫助。

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的輸出,這將有助於識別問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM