Request Tracker

From Alpine Linux
Revision as of 19:52, 22 June 2011 by Jbilyk (talk | contribs) (updates)

Note: This document has been tested on Alpine Linux 2.2.2, but contains some packages which are currently in the [edge/testing repository].
Note: Use a computer with at least 512MB of RAM.

RT with basic email support

This guide will get a basic rt4 setup working that will allow inbound emails to create/update issues, and assumes that you have a working postfix setup already.

  • add edge/main repository to /etc/apk/repositories

printf "http://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories apk update

  • apk add lighttpd fcgi postgresql rt4 php php-cli postfix postfix-pcre msmtp

  • Edit /etc/lighttpd/lighttpd.conf and enable fastcgi
  • /etc/init.d/postgresql setup

  • /etc/init.d/postgresql start

  • su - postgres -c "createuser -P"

Enter name of role to add: rt_user
Enter password for new role: rtpass
Enter it again: rtpass
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) y
  • cp /etc/rt4/RT_Config.pm /etc/rt4/RT_SiteConfig.pm

  • chmod 644 /etc/rt4/RT_SiteConfig.pm

  • /etc/rt4/RT_SiteConfig.pm:
Set($rtname, 'support');
Set($Organization, 'example.com');
Set($WebDomain, 'fqdn.in.example.com');
Set($OwnerEmail, 'RTAdmin@example.com');
Set($LogoLinkURL, 'http://www.example.com/');
Set($LogoAltText, 'Example.com Support');
# Set($LogoURL, );

Set($DatabaseType, 'Pg');
Set($DatabaseUser, 'rt_user');
Set($DatabasePassword, 'rtpass');
Set($DatabaseName, 'support_rt');

Set($LogToSyslog, 'warning');

Set($MailCommand, 'sendmailpipe');
Set($ParseNewMessageForTicketCCs, 1);
Set($UseTransactionBatch, 1);
Set($CorrespondAddress, 'support@example.com');
Set($CommentAddress, 'support@example.com');
Set($RecordOutgoingEmail, 0);
Set($SetOutgoingMailFrom, 1);
Set($FriendlyFromLineFormat, '"%s" <%s>');
  • /usr/sbin/rt-setup-database --action init

  • rt-server

  • Test and make sure that you can access rt using the built-in webserver first.
    • Tools -> Config -> Users -> Create
    • Username: Support-lists, Email: support-lists@example.com, etc -> Create
    • Tools -> Config -> Groups -> Create
    • Name: Support Users, etc -> Create
    • Tools -> Configuration -> Queues -> Create... Give it a name like 'support', and set support-list@example.com to be both reply and comment addresses. Remember the name 'support' which you'll use in the next sections (including the email address)
  • Add to /etc/postfix/main.cf:
transport_maps = regexp:/etc/postfix/rt4-transport
  • Create /etc/postfix/rt4-transport:
support@x.example.com        rt4:support
/^(support-list).*$/                mlmmj:support-list
  • Add to /etc/postfix/master.cf:
rt4    unix  -       n       n       -       -       pipe flags=DORhu user=lighttpd argv=/usr/bin/rt-mailgate --queue $nexthop --action correspond --url http://fqdn.in.example.com/
mlmmj  unix  -       n       n       -       -       pipe flags=DORhu user=mlmmj argv=/usr/bin/mlmmj-recieve -F -L /var/spool/mlmmj/$nexthop
  • Allow users to create tickets by email by checking all General Rights for group Everyone in Tools -> Configuration -> Global -> Group Rights
  • Stop rt-server
  • /etc/lightttpd/lighttpd.conf:
include "rt4.conf"
  • /etc/lighttpd/rt4.conf:
server.modules += ("mod_fastcgi")

$HTTP["host"] == "fqdn.in.example.com" {
        server.document-root = "/usr/share/rt4/html"
        index.file-names = ( "index.html" ) 

        fastcgi.server = ( "/" =>
             ((
                "bin-path"      => "/usr/sbin/rt-server.fcgi",
                "socket"        => "/var/run/lighttpd/rt4.socket",
                "check-local"   => "disable",
                "fix-root-scriptname" => "enable"
              )),
          )
}
  • /etc/init.d/lighttpd start

  • apk add mlmmj
  • adduser mlmmj
  • mkdir /var/spool/mlmmj
  • mlmmj-make-ml.sh -L support-list
  • Login to http://fqdn.in.example.com (your RT server)
    • Add AdminCC for Support Users to support queue
    • New template called 'Support Users Correspondence' (anyone you add to Support Users group will have their outbound email rewritten to 'Support Team' instead of their realname
{ 
  my $output = undef;
  my $groups = $Transaction->CreatorObj->OwnGroups();
  while( my $group = $groups->Next ) {
    my $queue = $Ticket->QueueObj;
    my $realname = $queue->Description;
    my $email = $queue->CorrespondAddress || RT->Config->Get('CorrespondAddress');
    $output = 'From: "' . $realname . '" <' . $email . '>' if $group->Name eq 'Support Team';
  }
  $output;
}
RT-Attach-Message: yes 

{$Transaction->Content()}
  • Test that inbound and outbound emails, creating tickets by email and replying to ticket emails works as expected.