Elgg 1.8.19没有使用Postfix发送验证电子邮件

时间:2014-06-30 23:07:18

标签: php apache email postfix-mta elgg

我在运行Ubuntu 13.10和Postfix 2.10.2的Digital Ocean VPS上使用Elgg 1.8.19开发社交网站。

Elgg不会向用户发送验证电子邮件,无论他们刚刚注册了还是管理员重新发送了验证电子邮件。 以前是否有人遇到此问题并知道解决方案?

我手动确认Postfix正在通过telnet工作到端口25并从那里发送。

telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP Postfix (Ubuntu)
ehlo localhost
250-localhost
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: user@localhost
250 2.1.0 Ok
rcpt to: myaccount@gmail.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
testing email for stackoverflow
.
250 2.0.0 Ok: queued as 795AC120025
quit
221 2.0.0 Bye
Connection closed by foreign host.

我还成功运行了一个PHP脚本来测试mail()函数,其中包含以下内容:

<?php    
$to = "myaccount@gmail.com";
$header = "From: {$to}";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body, $header)) {
    echo("<p>Message successfully sent!</p>");
} else {
    echo("<p>Message delivery failed...</p>");
}
?>

供参考,这是我的Postfix 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.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = jconnect-tb.com, localhost, localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

由于大多数帖子都提及http://docs.elgg.org/wiki/No_emails_%28including_validation_emails%29_are_being_sent,我一整天都在谷歌和Elgg社区讨论区上无济于事。就此而言,它指的是已设置的php.ini配置选项。 有什么想法/解决方案吗?

0 个答案:

没有答案