Re: [rt-users] Shredder API questions

2006-12-30 Thread Mathew Snyder
Mathew Snyder wrote:
> I'm rewriting a script that will eliminate all spam users accrued over the
> course of a day.  Presently, it is using the least efficient way of executing
> the wipeout by performing a system call to rtx-shredder.  I would prefer to 
> run
> the wipeout by way of the Shredder API.  I'm guessing along the lines of this:
> 
> # load plugin by preformatted string
> my $pluginString = "'Users=status,any;email,$email;replace_relations,Nobody'";
> my $plugin = new RTx::Shredder::Plugin;
> my( $status, $msg ) = $plugin->LoadByString( $pluginString );
> unless( $status ) {
> print STDERR "Couldn’t load plugin: $msg\n";
> exit(1);
> }
> }
> 
> Another question is in regards to the sql dump.  I've looked at rtx-shredder 
> and
> have seen referrence to the SetFile method but haven't seen anything about the
> DumpSQl method that is mentioned in Shredder.pm.  Is this automatically
> accounted for when if I use my ($fname, $fh) = $shredder-SetFile;?
> 
> The portion of my script this relates to is below.
> 
> 
> foreach my $email (sort(@emails)){
> print $email . "\n";
> }
> 
> print "\nDelete the email addresses from the RT database [y/N]: ";
> chomp($ans = );
> 
> if ($ans =~ m/^(y|yes)$/i){
> my $email;
> foreach $email (@emails){
> #   system "/usr/local/rt-3.6.1/local/sbin/rtx-shredder --force --plugin \
> 'Users=status,any;email,$email;replace_relations,Nobody'";
> # load plugin by preformatted string
> my $pluginString = \
> "'Users=status,any;email,$email;replace_relations,Nobody'";
> my $plugin = new RTx::Shredder::Plugin;
> my( $status, $msg ) = $plugin->LoadByString( $pluginString );
> unless( $status ) {
> print STDERR "Couldn’t load plugin: $msg\n";
> exit(1);
> }
> }
> }
> else{
> exit;
> }
> 
> 
> One problem I can already see with the above snippet is that Shredder is 
> called
> seperately for each email address.  How do I set this up to run as one
> continuous execution for the entire array of addresses?
> 
> Any and all help will be greatly appreciated.
> 
> Mathew

Can no one help with this?

Mathew
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


RE: [rt-users] RT 3.6.1 stops sending out emails

2006-12-30 Thread Harald Kapper
Date: Wed, 6 Dec 2006 13:38:54 -0600
From: "Les Driggers" <[EMAIL PROTECTED]>
Subject: RE: [rt-users] RT 3.6.1 stops sending out emails
To: 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf 
> > Of Harald Kapper
> > Sent: Wednesday, December 06, 2006 8:58 AM
> > To: rt-users@lists.bestpractical.com
> > Subject: [rt-users] RT 3.6.1 stops sending out emails
> > 
> > Hi
> > he've a perfectly working RT 3.6.1 (on debian etch).
> > 
> > Only problem is that sometimes RT simply stops to send out 
> > emails (comments,
> > replys) to just anyone - as if it lost it's email-interface 
> > somehow, also no correspondences are then tracked in the 
> > ticket (which is quite right, but basically not the wanted 
> > functionality).
> > 
> > Restarting the apache2 it's running in helps.
> > 
> > But having to worry about outgoing-correspondence is really 
> a pain...
> > 
> > Anyone any ideas on this one?
> > 
> > Thank you in advance
> > Harald Kapper 
> 
> 
> I am having this issue as well.
> 
> rt-3.6.1
> Apache-2.0.52
> Sendmail-8.13.1
> CentOS-4.4
> 
> I think my issue is related to a custom scrip I wrote to send
> alerts to my cell phone when a ticket is created during the weekend.
> It is based on a similar example in the RT Essentials book.
> 
> I have deleted that scrip, so now I just have to wait and see if that 
> fixed the problem. I'll post an update when I know more.


hi
after changing to the apache2-mpm-prefork model this issue seems to go away
on debian, also thankfully the debian request-tracker3.6 maintainer also has
fixed the Requestor.Email-searchproblem the not-patched 3.6.1 release had.

regards
harald kapper


smime.p7s
Description: S/MIME cryptographic signature
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

[rt-users] Limiting ParseNewMessageForTicketCcs

2006-12-30 Thread Richard J Palmer
We use ParseNewMessageForTicketCcs  on our system mainly beause a few of
our support requests come in with a couple of related cc's in the same
company and all is well.

However every so often (yesterday was a good nexample ...) We get spam
into the system that has over 100 CCs which we obviously don't want to
add.

What I'd ideally like to do is limit the process to only add cc's if
there are say 5 or 10 maximum cc fields (the ultimate would be to set a
customisable limit.

How I have looked at the code, and in theory it seems quite easy to do
*BUT* I don't have the confidence to do this without breaking things ;)

Could anyone provide s snippint of code to edit Email.pm as need be ?

Thanks!
-- 
Richard Palmer
Merula Limited
http://www.merula.net

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com