configuration外发邮件的后缀

我租了一个VPS,一个域名(比方说foo.bar )。
我想使用地址[email protected]发送电子邮件

我已经安装了postfix ,并开始configurationmain.cf文件; 但它不起作用。 在我看来,参数relayhost是错误的configuration。 事实上,我在互联网上看到,我应该把我的ISP的域名。 但是如果我不拥有一个ISP呢? 我可以理解,如果服务器在我家,但它是一个VPS。

你可以find附上我的configuration文件。 有人可以帮我做到这一点吗?

 # See /usr/share/postfix/main.cf.dist for a commented, more complete version # MY SERVER myhostname = server.foo.bar mydomain = foo.bar # Transport mod for outgoing mail default_transport = smtp # Aliases alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases # 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. smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination mydestination = $myhostname, localhost.$mydomain, $mydomain mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 relay_domains = $mydestination relayhost = $mydomain mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all myorigin = $mydomain 

这里是日志文件/var/log/mail.log

 Sep 9 12:12:42 foobar postfix/postfix-script[1635]: refreshing the Postfix mail system Sep 9 12:12:42 foobar postfix/qmgr[1640]: 736F541741: from=<foobar@foobar>, size=336, nrcpt=1 (queue active) Sep 9 12:12:42 foobar postfix/smtp[1642]: warning: relayhost configuration problem Sep 9 12:12:42 foobar postfix/smtp[1642]: 736F541741: to=<[email protected]>, relay=none, delay=374, delays=374/0.04/0.03/0, dsn=4.3.5, status=deferred (mail for foo.bar loops back to myself) 

您的relayhost参数的确似乎configuration错​​误。 更确切地说,它被configuration,它不应该。

当可选传输(5)表中没有条目匹配时,relayhost参数指定发送邮件的默认主机。 当没有给中继主机时,邮件被直接路由到目的地。

在家庭连接时,将其设置到您的ISP的SMTP服务器是有意义的,因为您的ISP可能会限制从您的Internet连接访问端口25。 通过您的提供商中继将摆脱这个问题。

然而,在VPS上,你可以直接访问互联网,希望没有任何过滤。 因此,您可以将其保留为空,并且您的服务器应尝试直接发送给收件人。