kingrobot 2007-8-5 12:10
bugzilla2.22.2发送邮件的问题!!
安装bugzilla的环境为:
windwos 2003+mysql 4.0.17+IIS+bugzilla 2.22.2
安装完成后,按网上提供的使用第三方smtp发送邮件,
完成后,可以在提交bug和bug跟踪时收到邮件。
但是在首面上注册新用户却是怎么也收不到邮件。
不知道那位大大碰到过此类问题,有没有什么解决办法。
要以发到我的邮箱:[email=kingrobot@foxmail.com]kingrobot@foxmail.com[/email]
谢谢!!
代码如下:(主要是修改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;
[b] my $smtp_server = 'mx.hit.edu.cn';
my $smtp_user = 'hdpan@hit.edu.cn';
my $smtp_pass = 'xxxxxx';[/b]
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;
}
kingrobot 2007-8-5 12:41
自己先顶一下。
再请教二个问题:
一、为什么我在安装bugzilla时,用mysql5时,在填写了smtp服务器地址后,再往下就会出错。
Can't connect to the database.
Error: Access denied for user [email=]'bugs'@'localhost'[/email] (using password: [color=red]YES/NO[/color])都有出现过
Is your database installed and up and running?
Do you have the correct username and password selected in localconfig?
而换成mysql4.0.17后就可以安装成功?
二、Image::Magick这个模块要如何安装?
bill_hen 2007-8-5 15:16
你的bugzilla可能不支持mysql 5。
[url]http://www.websina.com/cn/bugzilla-install-windows.html[/url]
junlingliu 2007-8-31 15:32
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"?)
......