Dear Monk,

Apologise for the unlcear question and thank you for your time in replying. Here what i am trying to do.

Recently we have started using Resource tracker to sort the incoming emails and assign it to different teams. Say with the key word in the subject we are sorting the emails from general to different queue names.

Now i want to write a script to delete messages in the queue with specific "Key words" or specific email address it came from. So the two variables are array of 'key words' and array of 'to address'.

I am using this below script to categorise them as "messages to be deleted" and manually deleting it.

for example,


<c> my $match = ".*weekly message.*"; my $t_subject = $self->TicketObj->Subject; if ( $t_subject !~ /$match/i ) { return 0; } else { return 1; } my $newqueue = "To be deleted"; my $T_Obj = $self->TicketObj; $RT::Logger->info("Auto assign ticket #". $T_Obj->id ." to queue #". $newqueue ); my ($status, $msg) = $T_Obj->SetQueue($newqueue); unless ($status) { $RT::Logger->warning("unable to set new queue: $msg"); return undef; } return 1; </code>

But would like to code a script that could delete those emails within the key word ranhe automatically..

Thanks


In reply to Re^2: Sorting and deleting spam emails in the RT queue by brainfold
in thread Sorting and deleting spam emails in the RT queue by brainfold

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.