Discussion:
[otrs] Junk queue deletion
Stefan Testa
2004-03-10 15:31:21 UTC
Permalink
Hello,

We currently get a lot of spam sent to our OTRS system so I have just
been telling everyone to move it into the "junk" queue. How do I go
about deleting all of this junk?

If there is a better way to go about doing this, please let me know.

Thanks!

Stefan
Robert Kehl
2004-03-10 23:50:59 UTC
Permalink
On Wednesday, March 10, 2004 4:31 PM
Post by Stefan Testa
We currently get a lot of spam sent to our OTRS system so I have just
been telling everyone to move it into the "junk" queue. How do I go
about deleting all of this junk?
The GenericAgent is meant for performing this. See
http://doc.otrs.org/1.2/en/html/generic-agent.html
and
http://doc.otrs.org/1.2/en/html/generic-agent-example.html#AEN1040

GA will get executed via the Cron jobs. See
http://doc.otrs.org/1.2/en/html/cronjob.html
Post by Stefan Testa
If there is a better way to go about doing this, please let me know.
You're on track already.

hth,

Robert Kehl
--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-15 13:37:02 UTC
Permalink
Post by Robert Kehl
On Wednesday, March 10, 2004 4:31 PM
Post by Stefan Testa
We currently get a lot of spam sent to our OTRS system so I have just
been telling everyone to move it into the "junk" queue. How do I go
about deleting all of this junk?
The GenericAgent is meant for performing this. See
http://doc.otrs.org/1.2/en/html/generic-agent.html
and
http://doc.otrs.org/1.2/en/html/generic-agent-example.html#AEN1040
GA will get executed via the Cron jobs. See
http://doc.otrs.org/1.2/en/html/cronjob.html
Robert,

FWIW, these scripts don't work in my setup, whether executed by the cron
job or executed manually.

Is there a table in MySQL that I can go in and just delete the data
directly?

Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-15 17:33:28 UTC
Permalink
On Monday, March 15, 2004 2:37 PM
Post by L. Mark Stone
Post by Robert Kehl
On Wednesday, March 10, 2004 4:31 PM
Post by Stefan Testa
We currently get a lot of spam sent to our OTRS system so I have
just been telling everyone to move it into the "junk" queue. How do
I go about deleting all of this junk?
The GenericAgent is meant for performing this. See
http://doc.otrs.org/1.2/en/html/generic-agent.html
and
http://doc.otrs.org/1.2/en/html/generic-agent-example.html#AEN1040
GA will get executed via the Cron jobs. See
http://doc.otrs.org/1.2/en/html/cronjob.html
FWIW, these scripts don't work in my setup, whether executed by the
cron job or executed manually.
I still believe the GA to be able to do what you want. Is GA not working
at all on your system? Why not, what do your logs say about it?
Post by L. Mark Stone
Is there a table in MySQL that I can go in and just delete the data
directly?
This isn't adviceable, no.

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-16 03:50:16 UTC
Permalink
Post by Robert Kehl
Post by L. Mark Stone
FWIW, these scripts don't work in my setup, whether executed by the
cron job or executed manually.
I still believe the GA to be able to do what you want. Is GA not working
at all on your system? Why not, what do your logs say about it?
Robert,

There are no bad entries in the logs. All of the other cron jobs work
fine, but the Junk queue never gets emptied.

What would you like to see next?

Best regards,
Mark

P.S. How about that quote? ;-)
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-16 09:46:52 UTC
Permalink
On Tuesday, March 16, 2004 4:50 AM
Post by L. Mark Stone
There are no bad entries in the logs. All of the other cron jobs work
fine, but the Junk queue never gets emptied.
What would you like to see next?
The exact entries from GenericAgent.pm and the active crontab, please.
Prefer it well-done, please. Thanks. ;)

Regards

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-16 16:36:48 UTC
Permalink
Post by Robert Kehl
On Tuesday, March 16, 2004 4:50 AM
Post by L. Mark Stone
There are no bad entries in the logs. All of the other cron jobs work
fine, but the Junk queue never gets emptied.
What would you like to see next?
The exact entries from GenericAgent.pm and the active crontab, please.
Prefer it well-done, please. Thanks. ;)
OK, here's the log file excerpt and the pm file:
Mar 16 09:40:00 inside /USR/SBIN/CRON[21923]: (otrs) CMD
($HOME/bin/PostMasterPOP3.pl >> /dev/null)
Mar 16 09:40:00 inside /USR/SBIN/CRON[21925]: (otrs) CMD
($HOME/bin/GenericAgent.pl >> /dev/null)
Mar 16 09:40:28 inside OTRS-CGI-10[5100]:
[Notice][Kernel::System::Auth::DB::Auth] User: lmstone logged in
(REMOTE_ADDR: 192.168.15.225).
Mar 16 09:50:00 inside /USR/SBIN/CRON[22669]: (otrs) CMD
($HOME/bin/PostMasterPOP3.pl >> /dev/null)
Mar 16 09:59:00 inside /USR/SBIN/CRON[23278]: (root) CMD ( rm -f
/var/spool/cron/lastrun/cron.hourly)
Mar 16 10:00:00 inside /USR/SBIN/CRON[23317]: (otrs) CMD
($HOME/bin/PostMasterPOP3.pl >> /dev/null)
Mar 16 10:00:00 inside /USR/SBIN/CRON[23319]: (otrs) CMD
($HOME/bin/GenericAgent.pl >> /dev/null)
Mar 16 10:05:08 inside nagios: Auto-save of retention data completed
successfully.
Mar 16 10:10:00 inside /USR/SBIN/CRON[24047]: (otrs) CMD
($HOME/bin/PostMasterPOP3.pl >> /dev/null)
Mar 16 10:20:00 inside /USR/SBIN/CRON[24781]: (otrs) CMD
($HOME/bin/GenericAgent.pl >> /dev/null)
Mar 16 10:20:00 inside /USR/SBIN/CRON[24779]: (otrs) CMD
($HOME/bin/PostMasterPOP3.pl >> /dev/null)
Mar 16 10:30:00 inside /USR/SBIN/CRON[25488]: (otrs) CMD
($HOME/bin/PostMasterPOP3.pl >> /dev/null)

# --
# Kernel/Config/GenericAgent.pm - config file of generic agent
# Copyright (C) 2002-2004 Martin Edenhofer <martin+***@otrs.org>
# --
# $Id: GenericAgent.pm.dist,v 1.7 2004/02/12 00:55:01 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --

package Kernel::Config::GenericAgent;

use strict;
use vars qw($VERSION @ISA @EXPORT %Jobs);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(%Jobs);

$VERSION = '$Revision: 1.7 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;

#
-----------------------------------------------------------------------
# config options
#
-----------------------------------------------------------------------
%Jobs = (
# --
# [name of job] -> send escalation notifications
# --
# 'send escalation notifications' => {
# Escalation => 1,
# # new ticket properties
# New => {
# Module =>
'Kernel::System::GenericAgent::NotifyAgentGroupOfCustomQueue',
# },
# },
# insert your jobs (see Kernel/Config/GenericAgent.pm.examples)
'delete' => {
# get all tickets with this properties
Queue => 'Junk',
States => ['new', 'open', 'closed'],
Locks => ['unlock'],
# new ticket properties (no option is required, use just the
options
# witch should be changed!)
New => {
# DELETE!
Delete => 1,
},
},
);
#
-----------------------------------------------------------------------
# end of config options
#
-----------------------------------------------------------------------
1;
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-16 17:07:26 UTC
Permalink
On Tuesday, March 16, 2004 5:36 PM
Post by L. Mark Stone
# Kernel/Config/GenericAgent.pm - config file of generic agent
# $Id: GenericAgent.pm.dist,v 1.7 2004/02/12 00:55:01 martin Exp $
Assuming you sent GenericAgent.pm, not possibly GenericAgent.pm.dist,
you're doing too much. This is enough (as job!):

'delete' => { Queue => 'Junk',
Locks => ['unlock'],
New => { Delete => 1 },
},

I left away the states definition which could have prevented GA from
doing what you want.

Again, check if you really modified GenericAgent.pm.

hth,

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-17 14:46:07 UTC
Permalink
Post by Robert Kehl
On Tuesday, March 16, 2004 5:36 PM
Post by L. Mark Stone
# Kernel/Config/GenericAgent.pm - config file of generic agent
# $Id: GenericAgent.pm.dist,v 1.7 2004/02/12 00:55:01 martin Exp $
Assuming you sent GenericAgent.pm, not possibly GenericAgent.pm.dist,
'delete' => { Queue => 'Junk',
Locks => ['unlock'],
New => { Delete => 1 },
},
I left away the states definition which could have prevented GA from
doing what you want.
Again, check if you really modified GenericAgent.pm.
Hi Robert,

I did indeed modify GenericAgent.pm many OTRS versions ago, in
accordance with the documentation. :-) Indeed, the current
documentation shows the script I was using almost exactly (one of the
ticket states was eliminated).

Using your script up above, I notice that it is missing the comma after
the "1" in the { Delete => 1 }, line. I took out the comma.

But, unfortunately, I still have plenty of tickets in my Junk queue.
So, I tried running GenericAgent.pl manually. It responded:

Can't load agent job file 'Kernel::Config::GenericAgent':

That doesn't sound good!

Now what?

Thanks,
Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-17 19:43:23 UTC
Permalink
On Wednesday, March 17, 2004 3:46 PM
Post by L. Mark Stone
Using your script up above, I notice that it is missing the comma
after the "1" in the { Delete => 1 }, line. I took out the comma.
It doesn't matter if it's there or not.
Post by L. Mark Stone
But, unfortunately, I still have plenty of tickets in my Junk queue.
That doesn't sound good!
Look if the permissions on the file Kernel/Config/GenericAgent.pm are
correct (644 =>0.0). It looks as if GA cannot find it or cannot read it.

hth,

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-17 20:11:18 UTC
Permalink
Post by Robert Kehl
On Wednesday, March 17, 2004 3:46 PM
Post by L. Mark Stone
But, unfortunately, I still have plenty of tickets in my Junk queue.
That doesn't sound good!
Look if the permissions on the file Kernel/Config/GenericAgent.pm are
correct (644 =>0.0). It looks as if GA cannot find it or cannot read it.
Sorry Robert, I know how to do a chmod to get the rwx bits set, but
which account should be the owner? otrs?

Thanks,
Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-17 21:04:20 UTC
Permalink
On Wednesday, March 17, 2004 9:11 PM
Post by L. Mark Stone
Post by Robert Kehl
Look if the permissions on the file Kernel/Config/GenericAgent.pm are
correct (644 =>0.0). It looks as if GA cannot find it or cannot read it.
Sorry Robert, I know how to do a chmod to get the rwx bits set, but
which account should be the owner? otrs?
Funny, I didn't cite a command - the '0.0' was meant to be a more
comprehensive root.root. Sorry for the misunderstanding.

What I'm thinking of is a situation like this:

rw------- mstone mstone Kernel/Config/GenericAgent.pm

If set that way, the otrs user has no chance to get to the file nor its
contents. Just a thought.

Regards,

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-18 11:37:10 UTC
Permalink
Post by Robert Kehl
On Wednesday, March 17, 2004 9:11 PM
Post by L. Mark Stone
Post by Robert Kehl
Look if the permissions on the file Kernel/Config/GenericAgent.pm are
correct (644 =>0.0). It looks as if GA cannot find it or cannot read it.
Sorry Robert, I know how to do a chmod to get the rwx bits set, but
which account should be the owner? otrs?
Funny, I didn't cite a command - the '0.0' was meant to be a more
comprehensive root.root. Sorry for the misunderstanding.
rw------- mstone mstone Kernel/Config/GenericAgent.pm
If set that way, the otrs user has no chance to get to the file nor its
contents. Just a thought.
OK, well, GenericAgent.pm had root root 644 permissions before I did
anything. I tried otrs root 644 too, and that didn't work either.

This is a SuSE 9 system, and I installed OTRS from rpm. I even reran the
SetPermissions script again, to be sure.

The other cron jobs work fine, so it is perplexing that it is just this
one that doesn't run!

What else should I try? What other info would be helpful for you to see?

Thanks!
Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-18 13:13:14 UTC
Permalink
On Thursday, March 18, 2004 12:37 PM
Post by L. Mark Stone
OK, well, GenericAgent.pm had root root 644 permissions before I did
anything. I tried otrs root 644 too, and that didn't work either.
This is a SuSE 9 system, and I installed OTRS from rpm. I even reran
the SetPermissions script again, to be sure.
What else should I try? What other info would be helpful for you to see?
Please give me a list of the file versions of your installation via PM:
# fgrep -r "\$Id:" *

Regards,

Robert Kehl
--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-18 14:02:15 UTC
Permalink
Post by Robert Kehl
On Thursday, March 18, 2004 12:37 PM
Post by L. Mark Stone
OK, well, GenericAgent.pm had root root 644 permissions before I did
anything. I tried otrs root 644 too, and that didn't work either.
This is a SuSE 9 system, and I installed OTRS from rpm. I even reran
the SetPermissions script again, to be sure.
What else should I try? What other info would be helpful for you to see?
# fgrep -r "\$Id:" *
OK, I ran the command and piped the output to a text file, attached. (If
I just pasted the output here, it would word wrap, which I am assuming
would be inconvenient for you). I'm also cc'ing you personally, in case
the listserver bounces the attachment.

Let me know if you need anything else, and thank you for taking the time
to look at this!

Best regards,
Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-18 14:41:12 UTC
Permalink
On Thursday, March 18, 2004 12:37 PM
Post by L. Mark Stone
This is a SuSE 9 system, and I installed OTRS from rpm. I even reran
the SetPermissions script again, to be sure.
Could you cite the exact filename, please?

Regards,

Robert Kehl
--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-18 15:43:19 UTC
Permalink
Robert,

My two responses are below.

Thanks again!
Mark
Post by Robert Kehl
On Thursday, March 18, 2004 12:37 PM
Post by L. Mark Stone
This is a SuSE 9 system, and I installed OTRS from rpm. I even reran
the SetPermissions script again, to be sure.
Could you cite the exact filename, please?
Sure! /opt/otrs/bin/SetPermissions.sh
Post by Robert Kehl
Hi Mark!
Would you be so kind to diff the attached GA.pm against yours?
***@outside:~/Downloads/otrs> diff GenericAgent.pm-Mark
GenericAgent.pm-Robert
30,38c30,32
< # 'send escalation notifications' => {
< # Escalation => 1,
< # # new ticket properties
< # New => {
< # Module =>
'Kernel::System::GenericAgent::NotifyAgentGroupOfCustomQueue',
< # },
< # },
< # insert your jobs (see Kernel/Config/GenericAgent.pm.examples)
< 'delete' => { Queue => 'Junk',
---
Post by Robert Kehl
'delete' => {
Queue => 'Junk',
States => ['new', 'open', 'closed'],
40c34,35
< New => { Delete => 1 },
---
Post by Robert Kehl
New => {
Delete => 1,
41a37
Post by Robert Kehl
},
***@outside:~/Downloads/otrs>
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-18 16:21:45 UTC
Permalink
Please don't reply to me personally and to the list, as the latter gets
lost then for me, so I cannot simply reply but have to fiddle a bit.
Thanks.

On Thursday, March 18, 2004 4:43 PM
Post by L. Mark Stone
Post by Robert Kehl
Post by L. Mark Stone
This is a SuSE 9 system, and I installed OTRS from rpm. I even reran
the SetPermissions script again, to be sure.
Could you cite the exact filename, please?
Sure! /opt/otrs/bin/SetPermissions.sh
I meant the rpm...
Post by L. Mark Stone
Post by Robert Kehl
Would you be so kind to diff the attached GA.pm against yours?
A working OTRS - fine.
A correct GA - even better.
GA not working at all - priceless!

To be sure, the queue to empty is labeled _Junk_, not _junk_? It is not
a subqueue of some other queue, in which case the name were
_otherQueue::Junk_?

hth,

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-18 17:34:48 UTC
Permalink
Post by Robert Kehl
Please don't reply to me personally and to the list, as the latter gets
lost then for me, so I cannot simply reply but have to fiddle a bit.
Thanks.
OK, no problem!
Post by Robert Kehl
On Thursday, March 18, 2004 4:43 PM
Post by L. Mark Stone
Post by Robert Kehl
Post by L. Mark Stone
This is a SuSE 9 system, and I installed OTRS from rpm. I even reran
the SetPermissions script again, to be sure.
Could you cite the exact filename, please?
Sure! /opt/otrs/bin/SetPermissions.sh
I meant the rpm...
Ah! It's the one from the link on your web site. ;-)
ftp://ftp.gwdg.de/pub/misc/otrs/RPMS/suse/9.x/otrs-1.2.2-01.i386.rpm
Post by Robert Kehl
Post by L. Mark Stone
Post by Robert Kehl
Would you be so kind to diff the attached GA.pm against yours?
A working OTRS - fine.
A correct GA - even better.
GA not working at all - priceless!
To be sure, the queue to empty is labeled _Junk_, not _junk_? It is not
a subqueue of some other queue, in which case the name were
_otherQueue::Junk_?
The queue is indeed labeled "Junk", not "junk".

So much for priceless!

Thanks!
Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-19 13:14:26 UTC
Permalink
On Thursday, March 18, 2004 6:34 PM
Post by L. Mark Stone
Post by Robert Kehl
I meant the rpm...
Ah! It's the one from the link on your web site. ;-)
ftp://ftp.gwdg.de/pub/misc/otrs/RPMS/suse/9.x/otrs-1.2.2-01.i386.rpm
You haven't got a faulty RPM or stuff - after reviewing your file
versions I cannot state there's anything wrong. It should work. The only
thing I noticed is, that you've got some old versions of GA lying around
in Config. Clean it up a bit to see if it get's better then.

hth,

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-19 14:05:09 UTC
Permalink
Post by Robert Kehl
On Thursday, March 18, 2004 6:34 PM
Post by L. Mark Stone
Post by Robert Kehl
I meant the rpm...
Ah! It's the one from the link on your web site. ;-)
ftp://ftp.gwdg.de/pub/misc/otrs/RPMS/suse/9.x/otrs-1.2.2-01.i386.rpm
You haven't got a faulty RPM or stuff - after reviewing your file
versions I cannot state there's anything wrong. It should work. The only
thing I noticed is, that you've got some old versions of GA lying around
in Config. Clean it up a bit to see if it get's better then.
Robert,

OK, this is spooky! Last night, long before you sent the above email, I
moved all of the other GA*.pm files out of that directory. I also
dropped you GA.pm file in as the working copy.

Unfortunately, this morning I still have a lot of tickets in my Junk
queue :-(

What do you think about me doing an rpm -Uvh --force?

Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-19 14:23:47 UTC
Permalink
On Friday, March 19, 2004 3:05 PM
Post by L. Mark Stone
OK, this is spooky! Last night, long before you sent the above email,
I moved all of the other GA*.pm files out of that directory. I also
dropped you GA.pm file in as the working copy.
Unfortunately, this morning I still have a lot of tickets in my Junk
queue :-(
What do you think about me doing an rpm -Uvh --force?
As your file versions doesn't seem to be out of sync, I would not
directly expect it to become much better, although a fresh code base
_should_ do it. Well, it should work now...

A last idea: What are the permissions on the _directory_ Kernel/Config?
Should be 755, owned by root.root. If that were 644... Bingo.

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-19 14:53:27 UTC
Permalink
Post by Robert Kehl
On Friday, March 19, 2004 3:05 PM
Post by L. Mark Stone
What do you think about me doing an rpm -Uvh --force?
As your file versions doesn't seem to be out of sync, I would not
directly expect it to become much better, although a fresh code base
_should_ do it. Well, it should work now...
A last idea: What are the permissions on the _directory_ Kernel/Config?
Should be 755, owned by root.root. If that were 644... Bingo.
No joy; the permissions on the _directory_ Config were already set
correctly...

Robert, I'm not a programmer, (although I did study Fortran, Assembler
and Cobol in university...), but can you tell me, in plain language,
what GenericAgent.pl needs to get its work done?

My statistics professor told me "Never confuse correlation with
causation!" and even though the error is about GA.pm, I can't help but
wonder if I shouldn't be looking more towards GA.pl's environment.

Thank you for your persistence and patience with me!

Best regards,
Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Robert Kehl
2004-03-19 16:08:44 UTC
Permalink
On Friday, March 19, 2004 3:53 PM
Post by L. Mark Stone
Robert, I'm not a programmer, (although I did study Fortran, Assembler
and Cobol in university...), but can you tell me, in plain language,
what GenericAgent.pl needs to get its work done?
A readable Kernel/Config/GenericAgent.pm, and the surrounding OTRS env.
Finished.
Post by L. Mark Stone
My statistics professor told me "Never confuse correlation with
causation!" and even though the error is about GA.pm, I can't help but
wonder if I shouldn't be looking more towards GA.pl's environment.
You may well try to copy a recent version of bin/GenericAgent.pl over
your existing version. Did you ever do anything in there? If so, chance
are GenericAgent.pl somehow got rendered unfunctional.
Post by L. Mark Stone
Thank you for your persistence and patience with me!
You're welcome - we will get this done...

Robert Kehl

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
L. Mark Stone
2004-03-19 17:17:26 UTC
Permalink
Post by Robert Kehl
On Friday, March 19, 2004 3:53 PM
Post by L. Mark Stone
Thank you for your persistence and patience with me!
You're welcome - we will get this done...
OK Robert, I've got it working now! Here's how:

First, the GenericAgent.pl file you just sent me had no problem finding
the GenericAgent.pm file. But unfortunately, running GenericAgent.pl
didn't delete anything! It responded with:

delete:

and then I'd get the command prompt back. That seemed odd, because I was
running with the GenericAgent.pm file you had sent me yesterday.

But this was much better than before, so for the moment, here is a diff
of the working GA.pl file you sent me, and the non-working one (at least
for me) that comes with version 1.2.2:

64c64
< $Debug = 0;
---
Post by Robert Kehl
$Debug = 0;
81c81
< if (!eval "require $Opts{'c'};") {
---
Post by Robert Kehl
if (!eval "require ($Opts{'c'});") {
Next, I made a test...

I created a new file called GenericAgentDelete.pm based on the GA.pm you
sent me. The file was intended to search for tickets having a blank
space in the subject line. This file successfully deleted all the
tickets in my Junk queue when I ran:

./GenericAgent.pl -c Kernel::Config::GenericAgentDelete


Here's that file:

# --
# Kernel/Config/GenericAgent.pm - config file of generic agent
# Copyright (C) 2002-2004 Martin Edenhofer <martin+***@otrs.org>
#
# Updated 19 March 2004 by L. Mark Stone.
# Routine deletes tickets with a blank space in the Subject: line.
#
# --
# $Id: GenericAgent.pm.dist,v 1.7 2004/02/12 00:55:01 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --

package Kernel::Config::GenericAgentDelete;

use strict;
use vars qw($VERSION @ISA @EXPORT %Jobs);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(%Jobs);

$VERSION = '$Revision: 1.7 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;

#
-----------------------------------------------------------------------
# config options
#
-----------------------------------------------------------------------
%Jobs = (
# --
# Delete -> Delete All Tickets in Junk Queue
# --
'delete' => {
Queue => 'Junk',
Subject => '% %',
New => {
Delete => 1,
},
},
);
#
-----------------------------------------------------------------------
# end of config options
#
-----------------------------------------------------------------------
1;


Lastly, I edited and renamed the above file to GenericAgent.pm. If you
don't hear any more from me, I now should have automated Junk queue
deletions!

Not sure why the GA.pm you sent me didn't delete anything, and I know
that my script won't delete tickets if there is only one word in the
Subject line (or a blank Subject), but for those few tickets I can
always edit the script on the fly.

Thanks again so much for your patience and persistence! I hope this
thread has been helpful to others who have fast-growing Junk queues.

With best regards, and let me know if you would like any other
information,
Mark
--
______________________________________________________________
L. Mark Stone
President
Reliable Networks of Maine, LLC
477 Congress Street, 5th Floor
Portland, ME 04107

Tel: (207) 772-5678
Cell: (917) 597-2057
Email: ***@RNoME.com
Web: http://www.RNoME.com
Stefan Testa
2004-03-15 21:03:22 UTC
Permalink
Ok. I attempted to adapt the code in the link you directed me to, but am unsuccessful. I'm sure I'm botching something simple, but I just don't see it.

Below is the tail end of my GenericAgent.pl file:

# --
# delete ticket
# --
if ($Jobs{$Job}->{New}->{Delete}) {
print " - delete ticket_id $TicketID\n";
$CommonObject{LogObject}->Log(
Priority => 'notice',
Message => "Delete Ticket [$TicketNumber], TicketID [$TicketID].",
);
$CommonObject{TicketObject}->DeleteTicket(
UserID => $UserIDOfGenericAgent,
TicketID => $TicketID,
);
}
# --
# [name of job] -> close and delete all tickets in queue delete
# --
'junk' => {
# get all tickets with this properties
Queue => 'junk',
States => ['new', 'open'],
Locks => ['unlock'],
# new ticket properties (no option is required, use just the options
# witch should be changed!)
New => {
# DELETE!
Delete => 1,
},
},



}
# --


Is there an obvious error?


I really appreciate all your help!

Stefan

-----Original Message-----
From: Robert Kehl [mailto:***@otrs.de]
Sent: Wednesday, March 10, 2004 6:51 PM
To: User questions and discussions about OTRS.
Subject: Re: [otrs] Junk queue deletion

On Wednesday, March 10, 2004 4:31 PM
Post by Stefan Testa
We currently get a lot of spam sent to our OTRS system so I have just
been telling everyone to move it into the "junk" queue. How do I go
about deleting all of this junk?
The GenericAgent is meant for performing this. See
http://doc.otrs.org/1.2/en/html/generic-agent.html
and
http://doc.otrs.org/1.2/en/html/generic-agent-example.html#AEN1040

GA will get executed via the Cron jobs. See
http://doc.otrs.org/1.2/en/html/cronjob.html
Post by Stefan Testa
If there is a better way to go about doing this, please let me know.
You're on track already.

hth,

Robert Kehl
--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System?
=> http://www.otrs.de/
Markus Ruecker
2004-03-15 22:01:48 UTC
Permalink
Hi Stefan,

I think you have misunderstood something.
You don't have to touch the GenericAgent.pl.
Instead of this, use the file: /opt/otrs/Kernel/Config/GenericAgent.pm
If you don't have this file, just copy GenericAgent.pm.dist

Markus...
Post by Stefan Testa
-----Original Message-----
Behalf Of Stefan Testa
Sent: Monday, March 15, 2004 10:03 PM
To: User questions and discussions about OTRS.
Subject: RE: [otrs] Junk queue deletion
Ok. I attempted to adapt the code in the link you directed me
to, but am unsuccessful. I'm sure I'm botching something
simple, but I just don't see it.
# --
# delete ticket
# --
if ($Jobs{$Job}->{New}->{Delete}) {
print " - delete ticket_id $TicketID\n";
$CommonObject{LogObject}->Log(
Priority => 'notice',
Message => "Delete Ticket [$TicketNumber],
TicketID [$TicketID].",
);
$CommonObject{TicketObject}->DeleteTicket(
UserID => $UserIDOfGenericAgent,
TicketID => $TicketID,
);
}
# --
# [name of job] -> close and delete all tickets in queue delete
# --
'junk' => {
# get all tickets with this properties
Queue => 'junk',
States => ['new', 'open'],
Locks => ['unlock'],
# new ticket properties (no option is required, use
just the options
# witch should be changed!)
New => {
# DELETE!
Delete => 1,
},
},
}
# --
Is there an obvious error?
I really appreciate all your help!
Stefan
-----Original Message-----
Sent: Wednesday, March 10, 2004 6:51 PM
To: User questions and discussions about OTRS.
Subject: Re: [otrs] Junk queue deletion
On Wednesday, March 10, 2004 4:31 PM
Post by Stefan Testa
We currently get a lot of spam sent to our OTRS system so I
have just
Post by Stefan Testa
been telling everyone to move it into the "junk" queue. How do I go
about deleting all of this junk?
The GenericAgent is meant for performing this. See
http://doc.otrs.org/1.2/en/html/generic-agent.html
and http://doc.otrs.org/1.2/en/html/generic-agent-example.html#AEN1040

GA will get executed via the Cron jobs. See
http://doc.otrs.org/1.2/en/html/cronjob.html
Post by Stefan Testa
If there is a better way to go about doing this, please let me know.
You're on track already.

hth,

Robert Kehl
--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System?
=> http://www.otrs.de/

_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System? =http://www.otrs.de/
Stefan Testa
2004-03-15 22:05:01 UTC
Permalink
My god, I'm rather embarrassed now. I'll give a shot.

Thank you very much.

Stefan

-----Original Message-----
From: Markus Ruecker [mailto:***@mr-consult.net]
Sent: Monday, March 15, 2004 5:02 PM
To: 'User questions and discussions about OTRS.'
Subject: RE: [otrs] Junk queue deletion

Hi Stefan,

I think you have misunderstood something.
You don't have to touch the GenericAgent.pl.
Instead of this, use the file: /opt/otrs/Kernel/Config/GenericAgent.pm
If you don't have this file, just copy GenericAgent.pm.dist

Markus...
Post by Stefan Testa
-----Original Message-----
Behalf Of Stefan Testa
Sent: Monday, March 15, 2004 10:03 PM
To: User questions and discussions about OTRS.
Subject: RE: [otrs] Junk queue deletion
Ok. I attempted to adapt the code in the link you directed me
to, but am unsuccessful. I'm sure I'm botching something
simple, but I just don't see it.
# --
# delete ticket
# --
if ($Jobs{$Job}->{New}->{Delete}) {
print " - delete ticket_id $TicketID\n";
$CommonObject{LogObject}->Log(
Priority => 'notice',
Message => "Delete Ticket [$TicketNumber],
TicketID [$TicketID].",
);
$CommonObject{TicketObject}->DeleteTicket(
UserID => $UserIDOfGenericAgent,
TicketID => $TicketID,
);
}
# --
# [name of job] -> close and delete all tickets in queue delete
# --
'junk' => {
# get all tickets with this properties
Queue => 'junk',
States => ['new', 'open'],
Locks => ['unlock'],
# new ticket properties (no option is required, use
just the options
# witch should be changed!)
New => {
# DELETE!
Delete => 1,
},
},
}
# --
Is there an obvious error?
I really appreciate all your help!
Stefan
-----Original Message-----
Sent: Wednesday, March 10, 2004 6:51 PM
To: User questions and discussions about OTRS.
Subject: Re: [otrs] Junk queue deletion
On Wednesday, March 10, 2004 4:31 PM
Post by Stefan Testa
We currently get a lot of spam sent to our OTRS system so I
have just
Post by Stefan Testa
been telling everyone to move it into the "junk" queue. How do I go
about deleting all of this junk?
The GenericAgent is meant for performing this. See
http://doc.otrs.org/1.2/en/html/generic-agent.html
and http://doc.otrs.org/1.2/en/html/generic-agent-example.html#AEN1040

GA will get executed via the Cron jobs. See
http://doc.otrs.org/1.2/en/html/cronjob.html
Post by Stefan Testa
If there is a better way to go about doing this, please let me know.
You're on track already.

hth,

Robert Kehl
--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System?
=> http://www.otrs.de/

_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System? =http://www.otrs.de/



_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System?
=http://www.otrs.de/
Stefan Testa
2004-03-15 22:08:47 UTC
Permalink
Ok. That worked like a charm. I apologize to everyone for my stupid mistake.

Stefan

-----Original Message-----
From: Markus Ruecker [mailto:***@mr-consult.net]
Sent: Monday, March 15, 2004 5:02 PM
To: 'User questions and discussions about OTRS.'
Subject: RE: [otrs] Junk queue deletion

Hi Stefan,

I think you have misunderstood something.
You don't have to touch the GenericAgent.pl.
Instead of this, use the file: /opt/otrs/Kernel/Config/GenericAgent.pm
If you don't have this file, just copy GenericAgent.pm.dist

Markus...
Post by Stefan Testa
-----Original Message-----
Behalf Of Stefan Testa
Sent: Monday, March 15, 2004 10:03 PM
To: User questions and discussions about OTRS.
Subject: RE: [otrs] Junk queue deletion
Ok. I attempted to adapt the code in the link you directed me
to, but am unsuccessful. I'm sure I'm botching something
simple, but I just don't see it.
# --
# delete ticket
# --
if ($Jobs{$Job}->{New}->{Delete}) {
print " - delete ticket_id $TicketID\n";
$CommonObject{LogObject}->Log(
Priority => 'notice',
Message => "Delete Ticket [$TicketNumber],
TicketID [$TicketID].",
);
$CommonObject{TicketObject}->DeleteTicket(
UserID => $UserIDOfGenericAgent,
TicketID => $TicketID,
);
}
# --
# [name of job] -> close and delete all tickets in queue delete
# --
'junk' => {
# get all tickets with this properties
Queue => 'junk',
States => ['new', 'open'],
Locks => ['unlock'],
# new ticket properties (no option is required, use
just the options
# witch should be changed!)
New => {
# DELETE!
Delete => 1,
},
},
}
# --
Is there an obvious error?
I really appreciate all your help!
Stefan
-----Original Message-----
Sent: Wednesday, March 10, 2004 6:51 PM
To: User questions and discussions about OTRS.
Subject: Re: [otrs] Junk queue deletion
On Wednesday, March 10, 2004 4:31 PM
Post by Stefan Testa
We currently get a lot of spam sent to our OTRS system so I
have just
Post by Stefan Testa
been telling everyone to move it into the "junk" queue. How do I go
about deleting all of this junk?
The GenericAgent is meant for performing this. See
http://doc.otrs.org/1.2/en/html/generic-agent.html
and http://doc.otrs.org/1.2/en/html/generic-agent-example.html#AEN1040

GA will get executed via the Cron jobs. See
http://doc.otrs.org/1.2/en/html/cronjob.html
Post by Stefan Testa
If there is a better way to go about doing this, please let me know.
You're on track already.

hth,

Robert Kehl
--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System?
=> http://www.otrs.de/

_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System? =http://www.otrs.de/



_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System?
=http://www.otrs.de/
Continue reading on narkive:
Loading...