使用SMTP发送StatusNet通知邮件
StatusNet的Mail配置可能导致在虚拟域名下Sendmail无法将邮件送达到Hotmail、163等邮箱问题,这个问题主要是由于各家Email商的过滤机制不同造成的。
于是今天决定用SMTP和Gmail发送邮件(这样肯定能收到),以下方法参考自Daniel Bachhuber的文章《Using Google Apps with StatusNet for email notifications》:
修改StatusNet的根目录下的config.php文件,增加以下内容:
1 2 3 4 5 6 7 8 |
$config['mail']['backend'] = 'smtp'; $config['mail']['params'] = array( 'host' => 'smtp.gmail.com', 'port' => 587, 'auth' => true, 'username' => 'username', 'password' => 'password' ); |
如果是Google Apps的域名用户,只需要将设置中的
1 |
'username' => 'username', |
替换成Google Apps的用户名
1 |
即可通过企业帐号发送通知(一般设置为[email protected])。
其他的电子邮件服务供应商也提供SMTP服务,替换为SMTP服务后,通知出现在垃圾邮件箱的概率有所变小,跟域名的问题的确有关。
评论