bugzilla中通过smtp发送gmail

Bugzilla默认的smtp发送不是TLS(Transport Layer Security,传输层安全,端口587),而这正是gmail采用的认证方法。

一、首先通过cpan安装Email::Send::SMTP::TLS

二、修改bugzilla源码。切换到您Bugzilla的安装目录,执行以下命令:
1) cd Bugzilla
2) vim Mailer.pm文件,搜索以下if块:
if ($method eq "SMTP") {
将其更改为:
if ($method eq "SMTP" || $method eq "SMTP::TLS") {
my ($smtp_server,$smtp_port) = split /:/,Bugzilla->params->{"smtpserver"};
push @args,
Host => $smtp_server,
User => Bugzilla->params->{"smtp_username"},
Password => Bugzilla->params->{"smtp_password"},
Hello => $hostname,
Debug => Bugzilla->params->{'smtp_debug'};
push @args, Port => $smtp_port if($smtp_port);
}

三、然后以系统管理员登录Bugzilla,进入Administration -> Parameters -> Email,做以下设置:
选择SMTP::TLS做为mail_delivery_method,smtp server出填写为:smtp.gmail.com:587。

ok

posted @ 2012-12-03 23:55  我的白日梦  阅读(520)  评论(0编辑  收藏  举报