Request-Tracker

From Alpine Linux

Jump to: navigation, search

This guide will get Request Tracker 4 setup working, with support for emails sent to an mlmmj mailing list to be inserted first into the ticket system, then sent on to mlmmj. It is intended for a HelpDesk-type deployment. This howto assumes that you have a working postfix setup already.

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.

Contents

Initial package installation and setup

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

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

Setup RT4 environment

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($SendmailArguments , '-fpostmaster@example.com -oi -t');
Set($ParseNewMessageForTicketCCs, 1);
Set($UseTransactionBatch, 1);
Set($CorrespondAddress, 'support@example.com');
Set($CommentAddress, 'support@example.com');
Set($RecordOutgoingEmail, 0);
Set($ForwardFromUser, 1);
Set($SetOutgoingMailFrom, 1);
Set($FriendlyFromLineFormat, '"%s" <%s>');

Modify Postfix Configuration for RT4 and mlmmj

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
myhostname = mx1.example.com
mydomain = mx1.example.com
relay_domains = example.com
recipient_delimiter = +
transport_maps = hash:/etc/postfix/transport
support@example.com        rt4:support
support-list@example.com   mlmmj:support-list
postmaster@example.com     local:
example.com                error:No such mailbox.

Lighttpd configuration

include "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"
              )),
          )
}

Final RT4 configuration

{ 
  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()} 
{
 my $old_user = $Ticket->CurrentUser;
 $Ticket->CurrentUser( $RT::SystemUser );
 my $batch = $Ticket->TransactionBatch;
 my $comment;
 if( !$batch || !ref($batch) ) {
   $RT::Logger->info("TransactionBatch stage is disabled,
                     fallback to last comment.
                     Turn on TransactionBatch stages for acurate results.");
   my $transactions = $Ticket->Transactions;
   $transactions->Limit( FIELD => 'Type', VALUE => 'Comment' );
   $transactions->OrderByCols( { FIELD => 'Created',
                                 ORDER => 'DESC' },
                                 { FIELD => 'id',
                                   ORDER => 'DESC' } );
   $transactions->RowsPerPage(1);
   $comment = $transactions->First;
 } else {
   $comment = (grep { ($_->Type eq 'Comment')? 1: 0;} @$batch)[0];
 }
 $OUT = " ";
 if ( $comment ) {
   $OUT = "Resolution:\n";
   $OUT .= ("-"x76) ."\n";
   $OUT .= $comment->Content;
 }
 $Ticket->CurrentUser( $old_user );
} 
Personal tools
Namespaces
Variants
Actions
Welcome
Services
Wiki
Toolbox