Tuesday, August 16, 2011

CentOS 5.6 bugzilla email reply-to bugs howto

This is a quick and dirty set of steps to get an internal bugzilla to allow replies from bugzilla emails to be added to a bug. I'm sure there is a more "proper" way, but since the user that runs email is "nobody" for CentOS, I don't see how at this time.

First, I am using the EPEL repository in order to be a newer bugzilla than is provided with stock CentOS 5.6 at this time. In fact, I tend to even use the "testing" repo in order to get what I want. The current version as of this writing is bugzilla-3.2.10-1.el5 if you are interested. The information here is realy just a documentation place for what I have had to do for a while now.

/usr/share/bugzilla/checksetup.pl

Make sure you have all the perl modules to run email_in.pl at least from the command line. If you run this, it should *not* return any error. It should just sit there waiting for input; just +c to terminate.

/usr/share/bugzilla/email_in.pl

Make sure you have a bugzilla alias. Make sure to check a past email to see what the reply-to address is going to be. You can add the alias like the following on the server that has bugzilla running on it.
echo 'bugzilla-daemon:"| cd /usr/share/bugzilla/ ; /usr/share/bugzilla/email_in.pl -vvv > /tmp/email_in.pl.out 2>&1"' >> /etc/aliases newaliases

Here is the shotgun approach I took in order to get replies to function. Keep in mind that this system does *not* have user accounts on it and is internal to a network. I would *NOT* do this for on with user accounts or if it was exposed to the outside world. If you happen to know the proper way to handle this, drop me a note!

find /var/lib/bugzilla/data -type d -exec chmod 755 {} \; find /var/lib/bugzilla/data -type f -exec chmod 744 {} \; find /var/lib/bugzilla/data \( -name "*.pm" -o -name "*.pl" -o -name "*.cgi" \) -exec chmod 755 {} \; find /usr/share/bugzilla/ -type f -exec chmod 744 {} \; find /usr/share/bugzilla/ -type d -exec chmod 755 {} \; find /usr/share/bugzilla/ \( -name "*.pm" -o -name "*.pl" -o -name "*.cgi" \) -exec chmod 755 {} \; chmod 755 /etc/bugzilla/ chmod 744 /etc/bugzilla/localconfig

Please note that *any* time you run "checksetup.pl", you will need to redo the commands above! That perl script will make the bugzilla install more secure again. It is good practice to make sure that you can past most all of the module recommendations it has prior to doing anything else.

When you start wanting to send test messages to bugzilla, make sure to watch the maillog for errors. Those errors *may* also come back as emails if you are lucky.
tail -f /var/log/maillog|grep bug

Also, based on an email_in.pl bugzilla bug I slightly modified the /usr/share/bugzilla/email_in.pl by applying THIS very easy patch to fix this next error.

Use of uninitialized value in concatenation (.) or string at Bugzilla/DB.pm line 106, <STDIN> line 49.
Use of uninitialized value in require at (eval 99) line 2, <STDIN> line 49.
Use of uninitialized value in concatenation (.) or string at Bugzilla/DB.pm line 106, <STDIN> line 49.
Can't call method "isa" without a package or object reference at /usr/share/bugzilla/email_in.pl line 303, <STDIN> line 49.

If the permissions are messed up, you will get errors like:


Use of uninitialized value in concatenation (.) or string at Bugzilla/DB.pm line 106, <STDIN> line 57.
Use of uninitialized value in require at (eval 100) line 2, <STDIN> line 57.
Use of uninitialized value in concatenation (.) or string at Bugzilla/DB.pm line 106, <STDIN> line 57.
'' is not a valid choice for $db_driver in localconfig: Null filename used 

OR

Error reading /var/lib/bugzilla/data/params: Permission denied at Bugzilla/Config.pm line 319.
Compilation failed in require at /usr/share/bugzilla/email_in.pl line 43.
BEGIN failed--compilation aborted at /usr/share/bugzilla/email_in.pl line 43.

OR

Use of uninitialized value in string ne at Bugzilla/Util.pm line 290, <STDIN> line 49.
Use of uninitialized value in string eq at process_bug.cgi line 435, <STDIN> line 49.
of uninitialized value in string eq at Bugzilla/Mailer.pm line 57.
Use of uninitialized value in string eq at Bugzilla/Mailer.pm line 121.
Use of uninitialized value in pattern match (m//) at Bugzilla/Mailer.pm line 141.
Use of uninitialized value in string eq at Bugzilla/Mailer.pm line 152.
Use of uninitialized value in string eq at Bugzilla/Mailer.pm line 160.
error: template error: file error - failed to create compiled templates directory: /var/lib/bugzilla/data/template/template/en/default/global (mkdir /var/lib/bugzilla/data/template: Permission denied 

No comments:

Post a Comment