PDA

View Full Version : How to install RequestTracker with email facility on Ubuntu 10.04



chrismyers
May 9th, 2010, 10:54 PM
The following demonstrates how to install RequestTracker 3.8.7 with email facility on Ubuntu server 10.04.

RequestTracker really shines when it works with email as it can notify the end user at key stages of a ticket progress. It will even record the thread of a conversation between the RT user & the ticket requester.

Before you start, please create a pop3 email account on your mail server. In this example example IT-Support@yourdomain


Install Ubuntu 10.04 & RT related packages

Boot from the Ubuntu 10.04 CD & follow the installation steps.
When presented with the Software Selection screen, select the following:

Lamp Server
Mail Server
OpenSSH Server

Set the MYSQL root password when prompted (twice).

Set postfix to "Internet site" when prompted.

Set Email to your smtp server when prompted.

Reboot when install finished & login as the username you created.



I suggest logging in remotely via ssh or Putty from now on to make it easy for you to copy & paste in the following commands.


Run the following command to gain root access:


sudo su -

Run the following command to install packages:


apt-get update; apt-get install rt3.8-apache2 rt3.8-clients rt3.8-db-mysql request-tracker3.8 fetchmail

Change "rt.tickets" to "tickets" when prompted.

Respond "Yes" to RT_SiteConfig.pm permissions when prompted.

Respond "Yes" to Configure RT with dbconfig-common when prompted.

Enter the MYSQL root password you used earlier in order to set up the new RT database when prompted.

Set the RT database access password (this password is for RT to connect to MYSQL & is stored in RT_SiteConfig.pm).


Request Tracker config file

Run the following command to back-up the RT config file:


cp /etc/request-tracker3.8/RT_SiteConfig.pm /etc/request-tracker3.8/RT_SiteConfig.pm.old

Run the following command to edit the RT config:


nano /etc/request-tracker3.8/RT_SiteConfig.pm

Comment out the following two lines with a # as shown below:

#Set($CorrespondAddress , 'rt@tickets');
#Set($CommentAddress , 'rt-comment@tickets');

Paste in the following two lines:

Set($MaxAttachmentSize , 10000000);
Set($FriendlyFromLineFormat, "\"%s\" <%s>");

Save the file.


Outbound Email config

Run the command:


nano /etc/postfix/main.cf

Find the line containing "relayhost" & add your smtp mail server

Save the file.

Run the command:


service postfix restart

Test Outbound mail (Postfix) by emailing a file – (This example sends /etc/fstab).


mailx -s "Postfix Test" YourOwnMailbox@domain < /etc/fstab



Use your own email address in the above command


Check your e-mail client to see if this is working.


Apache2 config

Run the command:


nano /etc/apache2/apache2.conf

Append the following at the bottom of the file on a new line:

ServerName tickets

Save the file & run the command:


nano /etc/apache2/sites-available/default

Find the last line "</VirtualHost>" and paste in the following two lines just above it:

Include /etc/request-tracker3.8/apache2-modperl2.conf
RedirectMatch ^/$ /rt

Save the file & run the command:


a2enmod rewrite; service apache2 restart


Configure RT from your web Browser login

Log in to RT - Open your web browser, enter your RT IP address use default root login:

root : password

Navigate to:

Configuration | Global | Group Rights

Find "Everyone" in "System Groups" and grant the following rights:

CommentOnTicket
CreateTicket
ReplyToTicket

Navigate to:

Configuration | Queues | General

Set the "Reply Address" & "Comment Address" to IT-Support@yourdomain

Change “Description” to “IT-Support”



Use a valid email address for your domain.



Inbound e-mail config

Run the command:


nano /etc/default/fetchmail

Modify the last line to read:

START_DAEMON=yes


Run the command to open the editor & create a new blank file:


nano /etc/fetchmailrc

Paste in the following six lines:

set daemon 60
set invisible
set no bouncemail
set no syslog
set logfile /var/log/fetchmail.log
poll YOURMAILSERVER protocol pop3 username "IT-Support" password "secret" mda "/usr/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt/" no keep



Note: the last line (beginning poll) is long & may have wrapped in your display.


Run the command:


touch /var/log/fetchmail.log; chown fetchmail /var/log/fetchmail.log

Reboot.

To watch inbound email status, run the following command:


tail –f /var/log/fetchmail.log

Send an email to the account: IT-Support@yourdomain

Fetchmail should pick up this email within 60 seconds & forward it into RT. RT with then reply to you. You should see the ticket in the web console.



Note: Once you are happy that inbound email is working, comment out the set logfile line in /etc/fetchmailrc with a # & reboot.



Cheers... Please respond to this thread to say if this How To helped you. :P

Wooglin
July 2nd, 2010, 11:27 PM
Worked excellently. Thanks!

If your mail server happens to not support POP, you can also use an IMAP account.
Simply change the last line in /etc/fetchmailrc from

poll YOURMAILSERVER protocol pop3 username...
to

poll YOURMAILSEERVER protocol imap username...

If, for some reason you wish to keep a copy on the email server remove the "no keep" from the end of that line, and the messages will remain in the email inbox.

TheFuturian
September 1st, 2010, 11:36 PM
Another success here, thank you very much. :D Might have to add a redirect at the root of my site so visitors just go straight to "/rt", but other then that, fantastic!

Edit
The relevant section of /etc/apache2/sites-available/default is:-


Include /etc/request-tracker3.8/apache2-modperl2.conf
RedirectMatch ^/$ /

Within apache2-modperl2.conf is this section:-


# Normally a request for a directory will be rewritten to index.html
# (or similar) by default if that file exists. For some reason this does
# not happen with the handler being set to perl-script. We thus have to
# do it ourselves using mod_rewrite.

RewriteEngine on

# You might need to alter these two lines which refer to /rt to match
# whatever base URL you are using for your rt3 site.

RewriteRule ^/rt$ /rt/
RewriteRule ^/rt/(.*)$ /usr/share/request-tracker3.8/html/$1
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(/usr/share/request-tracker3.8/html.*)/$ $1/index.html

Not quite sure what's going on there to be honest.. Time to Google.

majjj
February 14th, 2011, 03:19 PM
I get this error, can somebody help me?


Setting up request-tracker3.8 (3.8.7-1ubuntu2) ...
**WARNING**
**WARNING** If you are using mod_perl or any form of persistent perl
**WARNING** process such as FastCGI or SpeedyCGI, you will need to
**WARNING** restart your web server and any persistent processes now.
**WARNING**
hostname: Name or service not known
dpkg: error processing request-tracker3.8 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
request-tracker3.8
E: Sub-process /usr/bin/dpkg returned an error code (1)


EDIT: Also tried to reboot, no luck

drcraige
March 24th, 2011, 02:07 PM
Hello, can someone please provide some insight? I am having difficulty setting up & testing, Outbound Email Configuration.

My mail service is pop3 hosted externally by Hostway. I am configuring the relay host as smtp.mydomain.com in /etc/postfix/main.cf

When testing email nothing is being sent out.
Any suggestions as to what I may be missing would be appreciated.

chrismyers
March 24th, 2011, 05:50 PM
Hello, can someone please provide some insight? I am having difficulty setting up & testing, Outbound Email Configuration.

My mail service is pop3 hosted externally by Hostway. I am configuring the relay host as smtp.mydomain.com in /etc/postfix/main.cf

When testing email nothing is being sent out.
Any suggestions as to what I may be missing would be appreciated.

Are you sure you are using the correct outbound address?

Test outbound connectivity from your linux box by using:

telnet YourOutboundMailServer 25

Obviously, you should use your own providers outbound mail relay.

More info on testing:

http://www.activexperts.com/activemail/telnet/

drcraige
March 24th, 2011, 09:23 PM
Thank you for your quick response.
The server at Hostway (smtp.mydomain.com) refuses the Telent connection.
Am I confused as to which mail server you are referring to?
I believe I need to have credentials to relay the mail through Hostway. (Example- username@mydomain.com password ) Where do I configure that information?

Thank you again

chrismyers
March 25th, 2011, 08:11 AM
Thank you for your quick response.
The server at Hostway (smtp.mydomain.com) refuses the Telent connection.
Am I confused as to which mail server you are referring to?
I believe I need to have credentials to relay the mail through Hostway. (Example- username@mydomain.com password ) Where do I configure that information?

Thank you again

This is probably a question for your provider.

I'll give you an example with my provider details:

Inbound: smtp.plus.net

Outbound: relay.plus.net

Cheers.

Sef
March 25th, 2011, 09:41 AM
Moved to T & T.

drcraige
March 28th, 2011, 08:50 PM
I just want to post here for others the site that helped me to get Postfix to send outbound email via my Hostway pop3 account. http://newbiedoc.berlios.de/wiki/Debian_newbie_help_documentation

iamthelinux
September 8th, 2011, 05:33 AM
I followed the instructions given in #1(by chrismayers). I am having a problem when i try to configure rt from web browser. The login screen is showing. But when i login, the browser returns a blank page with the following text
"Can't call method "_Accessible" without a package or object reference at /usr/local/share/perl/5.10.1/DBIx/SearchBuilder/Record.pm line 422."

Thanks in advance for any help.