(RT 1.0.7) Interpreting MIME Subjects


#1

Is there a quick and easy way to parse subjects of the form

= ? i s o - 8 8 5 9 - 1 ? q ? G = E 0 x x y = 2 9 ? =

? (I put in spaces so I’m certain it won’t get parsed ;-))

I just want a readable subject line in the main queue display,
in the top of the one-page-one-ticket display, and if it is
trivially feasible also in the body of the transaction.

I suppose there is some part of the MIME-package that can do
this, and I was certain that I’d heard (seen!) somebody speak of
it here, but I couldn’t find “MIME” and “Subject” in the same
message body since I began reading this list…

Anybody done it already? Any hint on what MIME function to use?

BTW, would there be any ill effects if I suppress the
"(queuename)" that is added to the Subject of sent mail along
with “[RTID #666]”? As far as I can see it’s only there so
people can see what queue they are in, is that so?

#include <std_disclaim.h> Lorens Kockum


#2

I’m looking for a handy command to run from the command line
(i.e. in a script called from a crontab) that will set to "open"
any tickets that are “stalled” but with a “due” date in the
past.

Is there maybe another way? To my understanding,

"open" tickets need staff attention
"stalled" tickets are waiting for non-staff response

I want to be able to set a deadline for non-staff response (when
sending mail, staff member says that if so-and-so hasn’t replied
to the e-mail by, say, Thursday, he’ll want to look at the
ticket again, and until then he doesn’t want to see it).

So I call that setting the ticket status to “stalled” and
setting the due date. I might even make that automatic.

All that’s missing is the update script. Anybody have one?
Anybody WANT one? Why not?

I’m at the stage of

#!/bin/sh
mysql rt <<EOF
update each_req set status=‘open’ where date_due < unix_timestamp() and status=‘stalled’ ;
EOF

That works ok.

But I also want the transaction (Status changed to open by
_rt_system). I’m afraid my SQL hit a limit there (maybe it’s
just years of disuse, but still . . .). Can I do it in one
request? If not, ummm, how? Temporary tables?

#include <std_disclaim.h> Lorens Kockum


#3

I’m looking for a handy command to run from the command line
(i.e. in a script called from a crontab) that will set to "open"
any tickets that are “stalled” but with a “due” date in the
past.

Since nobody’s replied, I might as well . . . I found someone
to refresh my memories of SQL :slight_smile: It’s amazing the number of
SQL tutorials you can find on the web, and even more amazing
the percentage of those that only cover the first two hours
of an SQL class, without ever going any further. Didn’t
remember/realize that the select arguments could be constants,
and didn’t have to be column names.

I’ll be running this every night after the db backup.

#!/bin/sh
mysql rt <<EOF
begin
insert
into transactions
(effective_sn,serial_num,actor,type,trans_data,trans_date)
select
effective_sn,serial_num,’_rt_cron’, ‘status’, ‘open’, unix_timestamp()
from each_req
where date_due < unix_timestamp()
and status='stalled’
and effective_sn = serial_num ;
update each_req
set status='open’
where date_due < unix_timestamp() and status=‘stalled’ ;
commit
EOF

The “effective_sn = serial_num” makes for only one transaction
line in the WUI; I tried to mimick the behaviour I saw
when I opened/stalled tickets from the WUI.

(Did I just invent the acronym WUI?)
#include <std_disclaim.h> Lorens Kockum


#4

Since nobody’s replied, I might as well . . .

Continuing my monologue, I forgot the semi-colons after begin
and commit.

#include <std_disclaim.h> Lorens Kockum

set_due_stalled_to_open.sh (920 Bytes)