Mutt and request tracker

| | Comments (0)

Here is a perl script I wrote to take an email from mutt and close it in request tracker:


use warnings;
use strict;

use Mail::Sendmail;

my ($replyto, $replyfrom, $subject, $queue, $rthost, $isaticket);

#it must be from the address RT thinks you have

while (<STDIN>) {
        chomp $_;
        if (/^Reply-To: (.@.)$/) {$replyto=$1;}
        if (/^RT-Ticket:/) {$isaticket="true";}
        if (/^Subject: (.)$/) {$subject=$1;}

if($isaticket) {
        if ($replyto=~/^(.)(-comment){0}@(.*)$/) {
else {
        print "Not a ticket.\n";

my %mail=(
        server => 'localhost',
        from => $replyfrom,
        to => "$queue-comment\@$rthost",
        subject => $subject,
        body => 'Status: resolved',

sendmail(%mail) or die $Mail::Sendmail::error;

Leave a comment

About this Entry

This page contains a single entry by nick published on October 30, 2011 9:24 AM.

IPv6 certification with was the previous entry in this blog.

Find recent content on the main index or look in the archives to find all content.