Ubuntu 上的 Postfix 不会发送电子邮件“没有这样的文件或目录‘/etc/postfix/cacert.pem’”

elc*_*nrs 3 email php smtp postfix smtp-auth

我正在尝试postfix在 Ubuntu 13.04 上进行设置,但到目前为止还没有运气。我在 ServerFault 上找到了一些不起作用的答案。重装了好几次都没用 这是我第一次处理它,我遵循了本教程教程。我试过这个答案,没有。这是我得到的telnet localhost 25ehlo localhost

250-elclanrs.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
Run Code Online (Sandbox Code Playgroud)

正如你所看到的,里面没有AUTH...

这是我的main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks = 127.0.0.0/8 192.168.1.0/24 [::1]/128 [fe80::]/64
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
Run Code Online (Sandbox Code Playgroud)

然后我有这个sasl_passwd

[smtp.gmail.com]:587 elclanrs@gmail.com:mypass
Run Code Online (Sandbox Code Playgroud)

我还配置了php.ini

sendmail_path = "/usr/sbin/sendmail -t -i"
Run Code Online (Sandbox Code Playgroud)

没有任何效果,电子邮件不是从 PHP 发送的。如何使它工作?

AnF*_*nFi 9

(基于评论中提供的日志条目)

Apr  9 18:25:41 elclanrs postfix/smtp[13034]: cannot load Certificate Authority data: disabling TLS support
Apr  9 18:25:41 elclanrs postfix/smtp[13034]: warning: TLS library problem: 13034:error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen('/etc/postfix/cacert.pem','r'):
[...]
Apr  9 18:25:42 elclanrs postfix/smtp[13034]: 249AD3FFAE: to=<elclanrs@elclanrs.spacirdesigns.com>, relay=smtp.gmail.com[173.194.68.109]:587, delay=0.29, delays=0.03/0/0.21/0.04, dsn=5.7.0, status=bounced (host smtp.gmail.com[173.194.68.109] said: 530 5.7.0 Must issue a STARTTLS command first. ku2sm27631513qeb.4 - gsmtp (in reply to MAIL FROM command))
Run Code Online (Sandbox Code Playgroud)
  1. 修复您的smtp_tls_CAfile
    Check Postfix:将 Gmail 配置为中继 (Ubuntu)
    它建议smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

  2. Gmail 仅通过加密连接(在 STARTTL 之后或通过 SMTPS)提供 SMTP AUTH。

  3. 提供 CA 数据的 Debian 包被命名为 ca-certificates