我正在尝试设置 postfix 以便能够发送/接收邮件,我能够接收消息,但是当我发送到 postfix 中设置的域名以外的任何其他域时,出现以下错误:
Jun 12 12:25:03 DEMISED postfix/smtpd[32291]: warning: hostname IN-213-226-141-251.somehost.com does not resolve to address 213.226.141.251: Name or service not known
Jun 12 12:25:03 DEMISED postfix/smtpd[32291]: connect from unknown[213.226.141.251]
Jun 12 12:25:06 DEMISED postfix/smtpd[32291]: NOQUEUE: reject: RCPT from unknown[213.226.141.251]: 554 5.7.1 <*******@gmail.com>: Relay access denied; from=<k@d****.net> to=<*****@gmail.com> proto=ESMTP helo=<[10.49.177.2]>
Jun 12 12:25:07 DEMISED postfix/smtpd[32291]: disconnect from unknown[213.226.141.251]
我的main.conf
:
smtpd_sender_restrictions = reject_unknown_sender_domain
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = yes
smtpd_relay_restrictions = reject_unauth_destination
myhostname = demised.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_alias_maps = hash:/etc/postfix/virtual
mydestination = demised.net, gitlab, localhost.localdomain, , 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
home_mailbox = Maildir/
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m "${EXTENSION}"
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
我希望能够向任何域发送电子邮件,而不仅仅是我的域,我该怎么做?谢谢!
答案1
代替
smtpd_relay_restrictions = reject_unauth_destination
和
smtpd_relay_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject_unauth_destination
顺便说一下,这是一行
并像这样评论
#smtpd_sender_restrictions = reject_unknown_sender_domain
和
在 main.cf 中