Using GMail as SMTP server from Bugzilla to send email notifications is supported natively
I saw several requests about how to use GMail as server to send bugmails from Bugzilla. I also saw too many (bad) articles about how to hack Bugzilla to make it work. Most were suggesting to install 3rd-party applications and to badly hack the source code, especially when installed on Windows. Forget all that! What you must know is that Bugzilla supports GMail as SMTP server for more than a year (!), and Bugzilla 4.4rc1, which is going to be released next Tuesday, supports it natively!
When running checksetup.pl, make sure that Net::SMTP::SSL is installed:
Checking for Net-SMTP-SSL (v1.01) ok: found v1.01
Then edit the following parameters (under Administration > Parameters > Email):
mail_delivery_method = SMTP mailfrom = your_email_address@gmail.com smtpserver = smtp.gmail.com:465 smtp_username = your_email_address@gmail.com smtp_password = your_gmail_password smtp_ssl = on
Do not forget to save your changes, and that’s all, Bugzilla is now able to use GMail to send bugmails.
If you are running Bugzilla 4.2 or older, then you should apply this patch. That’s the patch which is now part of Bugzilla 4.4, but it also applies cleanly to all supported branches. And the good news is that the upgrade to 4.4 will run smoothly as that’s the exact same code as for 4.4.
Once applied, you can follow the steps above.
I think you could explain how to patch the 4.2.x version for supporting smtp for gmail… Because i don’t know !
However, it’s a good article.
Save the patch on your machine. Name it e.g. gmail-support.diff and run:
patch -p0 -i /path/to/gmail-support.diff
from your bugzilla/ directory. Then run checksetup.pl.
Hi Frédéric, thank you for the post, but I have a little problem when running ‘patch -p0 -i /path/to/gmail-support.diff’
I got this error message:
can’t find file to patch at input line 8
Perhaps you used the wrong -p or –strip option?
The text leading up to this was:
————————–
|Index: Bugzilla/Mailer.pm
|===================================================================
|RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Mailer.pm,v
|retrieving revision 1.34
|diff -3 -p -u -r1.34 Mailer.pm
|— Bugzilla/Mailer.pm 24 Oct 2010 22:31:48 -0000 1.34
|+++ Bugzilla/Mailer.pm 12 Aug 2011 01:13:20 -0000
————————–
I solved the last problem by specifying the file to patch. but after I patched those files, i got this error message when running checksetup
Can’t locate object method "get_param_list" via package "Bugzilla::Config::mta" at C:/Program Files/Bugzilla/bugzilla/editparams.cgi line 64.
I am usting bugzilla 4.2.5
I reinstalled bugzilla, and then ran the patch again, now it is ok.
when I tried to turn on SSL=on and saved changes, I got this error msg:
The new value for smtp_ssl is invalid: SSL support is not available. Run checksetup.pl for more details.
the "checking for Net::SMTP::SSL ok:found v1.01" is shown correctly when running checksetup.bat (I used the win32 installer to install the bugzilla and all other prerequisite software packages incl. mySql, Perl5, etc.)
Better is to ask your questions in the Bugzilla support mailing-list. See http://www.bugzilla.org/support for help. Something is wrong with your installation, and this blog post is not the best place to get help.
I tried to sort the perl module dependencies and the error message was gone, and the apache log could work properly but then the apache log showed that
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client, is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER, together with SSL_ca_file|SSL_ca_path for verification.If you really don’t want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application."
and then I just uninstalled bugzilla, and took the other approach which is to install all individul apps not to use the bugzilla win32 installer, and then it turned out to be the issue with proxy server settings, the URL of the proxy is not the same as the IP address, never thought that could be the problem.