On Fri, 2004-03-19 at 11:08, Robert Kehl wrote:
On Friday, March 19, 2004 3:53 PM
L. Mark Stone wrote:
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;
---
$Debug = 0;
81c81
< if (!eval "require $Opts{'c'};") {
---
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
#
# 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: LMStone@RNoME.com
Web: http://www.RNoME.com