GIT – This article explains how to use GMAIL SMTP(TLS AUTH) to send alerts.

Bugzilla supports following methods to send mail alerts :

  • sendmail
  • SMTP

For SMTP method BugZilla uses Email::Send::SMTP  Perl module. GMAIL SMTP uses TLS ( Transport Layer ) as authentication method, so Email::Send::SMTP can not be used for the same.

We need to use another perl module Email::Send::SMTP::TLS .
First step would be to  Email::Send::SMTP::TLS from CPAN. use following steps to do so :

using CPAN shell

Lanch CPAN shell as follows

perl -MCPAN -e shell

and then on CPAN Shell execute following command

cpan> install Email::Send::SMTP::TLS

cpan shell might ask you to install additional modules, install them.

compiling from source
Download source from HERE  and execute following commands

tar zxvf Email-Send-SMTP-TLS-0.03.tar.gz
cd Email-Send-SMTP-TLS-0.03
make install

Once Email:Send::SMTP::TLS is installed, BugZilla should have SMTP::TLS method to send alerts. This can be verified by logging in as admin to BugZilla and going to Administration -> Parameters-> Email

Now we need tweak BugZilla code. carefully execute following instructions and don’t forget to backup files before you modify.
Go to your BugZilla installation directory and execute following command

cd Bugzilla

Open file.

Add following line after last ‘use’ statment

use Email::Send::SMTP::TLS;

Search for following code

sub MessageToMTA {

add following line after it

my ($smtp_server,$smtp_port);

search for following if block

if ($method eq “SMTP”) {

and change it to

if ($method eq “SMTP” || $method eq “SMTP::TLS”) {
($smtp_server,$smtp_port) = split /:/,Bugzilla->params->{“smtpserver”};
        push @args,
            Host => $smtp_server,
            User => Bugzilla->params->{“smtp_username”},
             => Bugzilla->params->{“smtp_”},
            Hello => $hostname,
            Debug => Bugzilla->params->{‘smtp_debug’};
        push @args, Port => $smtp_port if($smtp_port);

Now we need to do settings in bugzilla parameters.
Login as administrator to Bugzilla and go to Administration -> Parameters -> Email and do following settings

  1. Select SMTP::TLS as mail_delivery_method
  2. Enter your gmail address in mailfrom
  3.  Enter in smtpserver
  4.  Enter [email protected] in smtp_username
  5. Enter gmail password in smtp_password
  6. Click on save changes

Xem bài viết Hướng dẫn cài Bugzilla

Print Friendly, PDF & Email



Bài viết liên quan