On 2008/08/25 16:08, Jerrad Pierce <[EMAIL PROTECTED]> wrote:
> Alas, no. When I last I asked I was told it was a design feature. But it
> does seem mighty useful,
> as it would allow for OCR and indexing of attachments. I'd planned on
> attempting this once I got the more important parts of our setup functional.

I'm using the following perl script to get a pgp-encrypted attachment
from a ticket to the local disk and decrypt it. If you want to do
OCR, then you probably want other mime-types, but this should give
you some ideas.


#!/usr/bin/perl -w
#
# Otmar Lendl <[EMAIL PROTECTED]>
#
# Get encrypted file from Ticket and decrypt it
#

my $t = shift;

die "Usage: $0 ticketnum" unless ($t =~ /^\d+$/);

my $att = `rt show ticket/$t/attachments`;

foreach (split(/\n/,$att)) {
# 621: parsed_logs.zip.asc (application/pgp-encrypted / 358.4k),
#       print "Got $_\n";
        if (/\s(\d+):\s([\w.]+)\s\(application\/pgp-encrypted/) {
                my $fn = $2;
                my $a = $1;
                if ( -e $fn ) {
                        print STDERR "$fn exists, skipping\n";
                } else {
                        system("rt show ticket/$t/attachments/$a/content > 
$fn");
                        system("gpg $fn");
                }
        }
}


/ol
-- 
-=-  Otmar Lendl  --  [EMAIL PROTECTED]  -=-
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to