bugzilla2.22.2发送邮件的问题!!
安装bugzilla的环境为:windwos 2003+mysql 4.0.17+IIS+bugzilla 2.22.2
安装完成后,按网上提供的使用第三方smtp发送邮件,
完成后,可以在提交bug和bug跟踪时收到邮件。
但是在首面上注册新用户却是怎么也收不到邮件。
不知道那位大大碰到过此类问题,有没有什么解决办法。
要以发到我的邮箱:kingrobot@foxmail.com
谢谢!!
代码如下:(主要是修改MessageToMTA的内容)
sub MessageToMTA {
my ($msg) = (@_);
return if (Param('mail_delivery_method') eq "none");
my ($header, $body) = $msg =~ /(.*?n)n(.*)/s ? ($1, $2) : ('', $msg);
my $headers;
if (Param('utf8') and (!is_7bit_clean($header) or !is_7bit_clean($body))) {
($headers, $body) = encode_message($msg);
} else {
my @header_lines = split(/n/, $header);
$headers = new Mail::Header @header_lines, Modify => 0;
}
# Use trim to remove any whitespace (incl. newlines)
my $rcpt_to = trim($headers->get('to'));
use Net::SMTP;
my $smtp_server = 'mx.hit.edu.cn';
my $smtp_user = 'hdpan@hit.edu.cn';
my $smtp_pass = 'xxxxxx';
my $encode_smtpuser = trim(encode_base64($smtp_user));
my $encode_smtppass = trim(encode_base64($smtp_pass));
my $smtp = Net::SMTP->new($smtp_server,Timeout => 60) ||
die 'Cannot connect to smtp server';
my $result = $smtp->command('AUTH','LOGIN');
my $answer = $smtp->getline();
# 334 VXNlcm5hbWU6
$result = $smtp->command($encode_smtpuser);
$answer = $smtp->getline();
# 334 UGFzc3dvcmQ6
$result = $smtp->command($encode_smtppass);
$answer = $smtp->getline();
# 235 Authentication successful
# or 535 Authentication failed
if ($answer =~ /535/i)
{print "Sorry,Authentication failed!n";exit;}
$smtp->mail($smtp_user);
$smtp->to($rcpt_to);
$smtp->data();
$smtp->datasend($msg);
$smtp->dataend();
$smtp->quit;
} 自己先顶一下。
再请教二个问题:
一、为什么我在安装bugzilla时,用mysql5时,在填写了smtp服务器地址后,再往下就会出错。
Can't connect to the database.
Error: Access denied for user 'bugs'@'localhost' (using password: YES/NO)都有出现过
Is your database installed and up and running?
Do you have the correct username and password selected in localconfig?
而换成mysql4.0.17后就可以安装成功?
二、Image::Magick这个模块要如何安装? 你的bugzilla可能不支持mysql 5。
http://www.websina.com/cn/bugzilla-install-windows.html kingrobot :
我用的是bugzilla2.22.3版本,收不到邮件...
只将BugMail.pm中的sub MessageToMTA 修改成你上面所述就可以吗?
我修改后提示:
The specified CGI application misbehaved by not returning a complete set of aHTTP headres. The headers it did return are:
String found where operator expexted at Bugzilla/BugMail.pm line 4,near""# License Version 1.1(the ""License""(Missing operator before "License"?)
......
页:
[1]