October 2011 Archives

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;

About this Archive

This page is an archive of entries from October 2011 listed from newest to oldest.

January 2009 is the previous archive.

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