[rt-users] Searching for the To: field within RT?

Schultz, Eric ESchultz at corp.untd.com
Mon Apr 10 17:05:37 EDT 2006


> -----Original Message-----
> From: Travis Campbell [mailto:travis.campbell at amd.com] 
> Sent: Monday, April 10, 2006 1:18 PM
> To: Schultz, Eric
> Cc: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] Searching for the To: field within RT?
> 
> Schultz, Eric wrote:
> >> Why not have sendmail/postfix log which mails come to 
> those address?
> >>
> 
> > Or have a scrip that changes the subject, sets a custom 
> field, moves it
> > to a "legacy" queue, or emails you when you get an email 
> sent to such an
> > address?
> 
> Because I'm just looking for the tickets.  This particular 
> configuration
> has been in place for six months and I've been asked to find out which
> tickets already match this condition.
> 
> Travis

In that case, you would have to do a SQL query:

SELECT Headers FROM Attachments WHERE Headers LIKE '%To:
<legacyqueuename at yourdomain.com>%';

If you only want this for when a new ticket was created via email
(rather than for responses to those tickets), add: 

AND Headers NOT LIKE '%Thread-Topic: [<yourdomainname.com>%'

Or whatever you have set as $rtname in RT_SiteConfig.pm.  And then have
a Perl script that just greps out the From: line from all of those
headers.


Eric Schultz
United Online



More information about the rt-users mailing list