我想在Ubuntu上设置后缀。 我只想允许从本地连接发送电子邮件没有身份validation。 当我尝试发送电子邮件时,出现以下错误:
550 5.1.1 <[email protected]>: Recipient address rejected: gmail.com 554 5.5.1 Error: no valid recipients
无论将地址设置为什么,都会发生此错误。 我一直在testing以下内容:
# telnet localhost 25 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 server.domain.com ESMTP Postfix (Ubuntu) ehlo localhost mail from: root@localhost rcpt to: [email protected] data Subject: My first mail on Postfix Hi, Are you there? regards, Admin . quit250-server.domain.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN 250 2.1.0 Ok 550 5.1.1 <[email protected]>: Recipient address rejected: gmail.com 554 5.5.1 Error: no valid recipients 221 2.7.0 Error: I can break rules, too. Goodbye. Connection closed by foreign host.
我的main.cf文件是这样的:
# Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) 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 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = server.domain.comt alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = server.domain.com, localhost relayhost = mynetworks = 127.0.0.0/8 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = loopback-only default_transport = error relay_transport = error inet_protocols = ipv4
不知道如何继续作为谷歌没有出现任何与我的问题有关的事情。
通常这是一个主机名/ DNS问题。 我假设server.domain.com不是服务器的实际主机名,但要确保它是一个正确的FQDN。 如果它不是一个真正的外部主机名的互联网服务器,使用.local域(我有时在家中使用.internal,以避免与zeroconf冲突)。 检查您的主机文件,/ etc / hostname,/ etc / mailname,以及myhostname,mydestination,myorigin的值。
另外在上面的configuration中有一个myhostname中的拼写错误。