我正在尝试配置postfix以使用外部smtp服务器。 这是我的main.cf文件(这是来自全新安装和一些自定义设置):
#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
myhostname = ubuntuTesting
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = ubuntuTesting, localhost.localdomain, localhost
relayhost = smtp.site.it
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = smtpd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_type = cyrus
smtp_sasl_auth_enable = yes
# optional: necessary if email provider uses load balancing and
# forwards emails to another smtp server
# for delivery (ie: smtp.yahoo.com --> smtp.phx.1.yahoo.com)
smtp_cname_overrides_servername = no
我用smtp,用户名和密码创建了sasl_passwd。当我尝试使用'mail'命令发送电子邮件时,这是日志中的输出
Jun 12 15:13:13 ubuntuTesting postfix/qmgr[2390]: AE6FD1E136B: from=<ubuntu@ubuntuTesting>, size=368, nrcpt=1 (queue active)
Jun 12 15:13:14 ubuntuTesting postfix/smtp[2401]: AE6FD1E136B: enabling PIX workarounds: disable_esmtp delay_dotcrlf for smtp.site.com[xxx.xxx.xx.xx]:25
Jun 12 15:13:14 ubuntuTesting postfix/smtp[2401]: AE6FD1E136B: to=<stefano@site.com>, relay=smtp.site.com[xxx.xxx.xx.xx]:25, delay=0.72, delays=0.04/0.04/0.59/0.05, dsn=4.4.2, status=deferred (lost connection with smtp.site.com[xxx.xxx.xx.xx] while sending MAIL FROM)
Jun 12 15:23:03 ubuntuTesting postfix/smtp[2491]: AE6FD1E136B: enabling PIX workarounds: disable_esmtp delay_dotcrlf for smtp.site.com[xxx.xxx.xx.xx]:25
Jun 12 15:23:03 ubuntuTesting postfix/smtp[2491]: AE6FD1E136B: to=<stefano@site.com>, relay=smtp.site.com[xxx.xxx.xx.xx]:25, delay=590, delays=589/0.01/0.36/0.04, dsn=4.4.2, status=deferred (lost connection with smtp.site.com[xxx.xxx.xx.xx] while sending MAIL FROM)
我认为问题是smtp服务器接受AUTH PLAIN登录类型,但我无法弄清楚如何正确登录。我尝试了很多东西。
我可以将其与我的Google帐户配合使用,但不适用于此帐户。