[rt-users] custom condition not working when checking requestor

2010-05-03 Thread a . smith

Hi,

  can anyone help me with the following custom condition? What Im  
trying to do is configure some customisations to deal with spam mail  
with spoofed sender that matches the actual address we are using for  
the queue. Ie if the quene address is nos...@mydomain.com then we are  
getting spam through with that same address set as the  
requestor/sender which obviously causes a few probs. Id like to  
prevent autoreplies going to these types of tickets and also to auto  
delete them. Currently Im just testing the detection of these, I have  
a custom condition as shown that will send me an email when the  
condition is met. However its not working, can anyone help me out with  
the syntax?


my $transactionType = $self-TransactionObj-Type;

if ($transactionType eq 'Create') {
  $self-TicketObj-RequestorAddresses eq $Queue-CorrespondAddress;
  return 1;
}
return;

Thanks for any help! Andy.




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


Re: [rt-users] custom condition not working when checking requestor

2010-05-03 Thread lobo+rt
() can anyone help me with the following custom condition? What Im  
() trying to do is configure some customisations to deal with spam mail  
() with spoofed sender that matches the actual address we are using for  
() the queue.

Sorry I do not know the RT magic here but even if I knew
I would suggest to ward off the spam at the SMTP level on
your mail gateway before it even reaches RT.

Ciao, Lobo


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


Re: [rt-users] custom condition not working when checking requestor

2010-05-03 Thread Christian Loos
Hi Andy,

try this

my $transactionType = $self-TransactionObj-Type;

if ($transactionType eq 'Create' 
  $self-TicketObj-RequestorAddresses eq $Queue-CorrespondAddress) {
  return 1;
}
return 0;


But keep in mind that RequestorAddresses is maybe a list of addresses
and CorrespondAddress is a single address.

Chris

Am 03.05.2010 14:46, schrieb a.sm...@ukgrid.net:
 Hi,
 
   can anyone help me with the following custom condition? What Im trying
 to do is configure some customisations to deal with spam mail with
 spoofed sender that matches the actual address we are using for the
 queue. Ie if the quene address is nos...@mydomain.com then we are
 getting spam through with that same address set as the requestor/sender
 which obviously causes a few probs. Id like to prevent autoreplies going
 to these types of tickets and also to auto delete them. Currently Im
 just testing the detection of these, I have a custom condition as shown
 that will send me an email when the condition is met. However its not
 working, can anyone help me out with the syntax?
 
 my $transactionType = $self-TransactionObj-Type;
 
 if ($transactionType eq 'Create') {
   $self-TicketObj-RequestorAddresses eq $Queue-CorrespondAddress;
   return 1;
 }
 return;
 
 Thanks for any help! Andy.
 
 
 
 
 Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
 Buy a copy at http://rtbook.bestpractical.com
 


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


Re: [rt-users] custom condition not working when checking requestor

2010-05-03 Thread a . smith
thanks for the insight, we implement 2 different types of filtering on  
our SMTP servers, but as everyone knows no spam filtering is perfect.


Anyone able to comment on the question at hand, regardless of whether  
they think my mail servers are badly configured?


thanks for any ideas, Andy.

Quoting lobo:


Sorry I do not know the RT magic here but even if I knew
I would suggest to ward off the spam at the SMTP level on
your mail gateway before it even reaches RT.





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


[rt-users] Configure emails for SMIME encryption

2010-05-03 Thread Siddharth

Hi,

I want to have SMIME feature for emails to my running version of RT  
(RT 3.8.4). I manually installed the RT-Crypt-SMIME module available  
at CPAN. As mentioned in the read-me file of RT-Crypt-SMIME module I  
modified my RT_Siteconfig.pm as follows:


 1  use RT::Crypt::SMIME;
 2 Set($OpenSSLPath, ('/usr/bin/openssl'); # or wherever  
openssl lives
 3  Set($SMIMEKeys, ‚('/ngs/app/rt3/etc'); # This directory  
should contain RT's private keys and certificates in address.pem files
 4  Set($SMIMEPasswords, { address = ('squeamish  
ossifrage'); # The private passphrases for RT's private keys

 5  @MailPlugins = (qw(Auth::MailFrom Auth::SMIME));

When I saved and restarted the apache server, the server failed to  
restart. However when i marked line no. 4 as comment, the server  
started successfully.


I wanted to know how to obtain passphrase for RT private keys. Further  
what is the process of creating address.pem files.


Thanks,

Siddharth


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


[rt-users] Send email from template

2010-05-03 Thread Givano
Hi,

I'm trying to send an email from template, initiated by rt-crontool as
described in wiki, the only trick is that dependent on custom field it
should be sent to other persons group. Here my template, somehow it always
send to user1 and user 2.


Subject: new ticket, 30 minutes unowned!
RT-Send-Cc: { my $values = $Ticket-CustomFieldValues('CIT_Category');
  my $OUTPUT;
  my $CFValue;
  while ( my $value = $values-Next ) {
$CFValue = $value-Content;
if ($CFValue == 'IT Facilites') { $OUTPUT = 'us...@dom.com,
us...@dom.com' }
elsif ($CFValue == 'Linux/Network') { $OUTPUT =  'us...@dom.com,
us...@dom.com' }
elsif ($CFValue == 'Phone') { $OUTPUT =  'us...@dom.com, us...@dom.com'
}
elsif ($CFValue == 'Windows') { $OUTPUT =  'us...@dom.com, us...@dom.com'
}
  }
  $OUTPUT;
}

The ticket {$Ticket-id} stayed unowned for 30 minutes.

Please do a categorisation, assign optionally an owner!
##

Any idea what I'm doing wrong, maybe there is some, more elegant method to
do a custom field based escalation, here is how I'am starting the
rt-crontool:

rt-crontool --search RT::Search::FromSQL --search-arg id = 23331 --action
RT::Action::RecordComment --template 'UnownedNotifyWatcherLevel1'

Thanks in advance,

Ivan Samarin

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

[rt-users] change FORWARD template to support html format

2010-05-03 Thread Payam Poursaied
I tried to modify FORWARD global template so support html. I added
Content-Type: text/html at the first line of that template, but it seems
that header of the email become inconsistent which cause mail client (i.e.
outlook) do not show the attached forward messages.
I checked the source of incoming email with plain and html template and It
seems that adding content-type: text/html causes  Content-type:
multipart/mixed; boundary= to be put in a wrong place. (I'm not MIME expert
so I don't have clear view on this, just I guessed)

Regards


smime.p7s
Description: S/MIME cryptographic signature

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

Re: [rt-users] merge users(?)

2010-05-03 Thread Kenneth Crocker
Bogey,

Sure. Keep in mind that if this is something you want to happen in ALL
Queues, Then you don't need thisw scrip. RT offers this as a Global option.
Anyway, here is the one for On Create from emails:

#Custom Action cleanup Code:
# Set up variables for parsing CC's

my $trans = $self-TransactionObj;
my $ticket = $self-TicketObj;
my $user = RT::User-new($RT::SystemUser);
my $addr;
my $header;
my $ccname;
my $cc;

# Parse the email CC's into ticket CC Watchers

foreach $header ($trans-Attachments-First-GetHeader(Cc))
{
 foreach $cc ( split /\,/, $header )
 {
  ($addr) = $cc =~ /([\w-]...@[\w-]+?\.[\w]+)/;
  $ccname = substr($addr, 0,length($addr)-8);
  $addr = $user-CanonicalizeEmailAddress($ccname);
  $ticket-AddWatcher( Type = 'Cc', Email = $ccname );
 }
}

return 1;

For the On Correspondence one, you merely add an unless after the $addr
code:

  unless ($ticket-IsWatcher(Type = 'Cc', EmailAddress = $addr))
  {
   $ticket-AddWatcher( Type = 'Cc', Email = $ccname );
  }

So anyway, you can put this code into any Queue you want this to happen in,
but again, if you want all Queue to have this, then its better to turn on
that option in you config settings.

Kenn
LBNL

On Sun, May 2, 2010 at 9:34 AM, HS bogey...@yahoo.com wrote:

 Hi Ken,
 could you provide this scrip, please? Would like to give it a try.

 Thanks!

 best

 --- Kenneth Crocker *kfcroc...@lbl.gov* schrieb am *Fr, 30.4.2010:
 *

 *
 Von: Kenneth Crocker kfcroc...@lbl.gov
 Betreff: Re: [rt-users] merge users(?)
 An: who else bogey...@yahoo.com
 CC: rt-users@lists.bestpractical.com
 Datum: Freitag, 30. April, 2010 18:34 Uhr

 *
 *Bogey,

 Did you consider just making the extra Users Cc's on the Ticket? Then all
 you would have to do is make sure there was a notification scrip for Cc's on
 whatever. We have a scrip that will Add a Ticket CC for all Cc's on an
 email when a ticket is created or on correspondence. That way, you don't
 have to have a CF and monitor/maintain it. I think it simpler.

 Kenn
 LBNL

 *
 *On Fri, Apr 30, 2010 at 9:27 AM, who else 
 bogey...@yahoo.comhttp://mc/compose?to=bogey...@yahoo.com
  wrote:
 *

 *
 Someone, please?

 TIA

 w_e
 *
 *
 who else wrote:
 
  Well,
  it seems it works.
 
  BUT:
 
  I worked it out this way:
 
 There is a scrip that can do this:
 
 http://wiki.bestpractical.com/view/AddRequestor
 
 You create a custom user field called othermail and populate it with the
 people you want to get the email. All, the other IBMers will be added as
 requestors whenever one of them requests. We've done this for some
 supervisors who want to keep an eye on all calls made by their staff.
 
  Unfortunately this only works for ONE additional othermail but not two.
 It
  only accepts the first emailadress. Anybody out here, to point me in the
  right direction please, am not a programmer, so i'd appreciate your
 help.
 
  Thank you very much.
 
  w_e
 
  PS: Besides this it works like a charm ;-)
 

 --
 *
 *View this message in context:
 http://old.nabble.com/merge-users%28-%29-tp28151060p28414178.html
 *
 *Sent from the Request Tracker - User mailing list archive at Nabble.com.


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

 *
 *




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

Re: [rt-users] custom condition not working when checking requestor SOLVED

2010-05-03 Thread a . smith

Hi,

  thanks for the help Chris, Ive got this working now. The working code is:

my $transactionType = $self-TransactionObj-Type;
my $ticketRequestor = lc($self-TicketObj-RequestorAddresses);

if ($transactionType eq 'Create' 
  $ticketRequestor ne $self-TicketObj-QueueObj-CorrespondAddress()) {
  return 1;
}
return 0;


Previously Id lifted some code from an example and was using  
$Queue-CorrespondAddress which isnt valid unless you´ve already  
defined my Queue somewhere. So Ive updated to use the full syntax as  
per above.
I got a bit confused between the return codes, initially thinking 0  
was a clean exit (ie good) and not true as it acutally means.

Anyway all good now!

thanks Andy.




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


Re: [rt-users] Send email from template

2010-05-03 Thread Givano
Thank you Jeff, works perfect, I forgot that == is used only for numbers,
not strings...

Ivan

2010/5/3 Jeff Voskamp javos...@uwaterloo.ca

 On 05/03/2010 11:49 AM, Givano wrote:

 Hi,

 I'm trying to send an email from template, initiated by rt-crontool as
 described in wiki, the only trick is that dependent on custom field it
 should be sent to other persons group. Here my template, somehow it always
 send to user1 and user 2.

 
 Subject: new ticket, 30 minutes unowned!
 RT-Send-Cc: { my $values = $Ticket-CustomFieldValues('CIT_Category');
  my $OUTPUT;
  my $CFValue;
  while ( my $value = $values-Next ) {
$CFValue = $value-Content;
if ($CFValue == 'IT Facilites') { $OUTPUT = 'us...@dom.com mailto:
 us...@dom.com, us...@dom.com mailto:us...@dom.com' }
elsif ($CFValue == 'Linux/Network') { $OUTPUT =  'us...@dom.commailto:
 us...@dom.com, us...@dom.com mailto:us...@dom.com' }
elsif ($CFValue == 'Phone') { $OUTPUT =  'us...@dom.com mailto:
 us...@dom.com, us...@dom.com mailto:us...@dom.com' }
elsif ($CFValue == 'Windows') { $OUTPUT =  'us...@dom.com mailto:
 us...@dom.com, us...@dom.com mailto:us...@dom.com' }

  }
  $OUTPUT;
 }

 The ticket {$Ticket-id} stayed unowned for 30 minutes.

 Please do a categorisation, assign optionally an owner!
 ##

 Try using 'eq' instead of '==' - you want to compare the values of the
 string, not if it's set.
 You might also want to use '.=' instead of '=' for $OUTPUT if you are
 handling multiple values for CIT_Category, but watch out for missing commas.

 Jeff


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

Re: [rt-users] Send email from template

2010-05-03 Thread Kenneth Crocker
Givano,

I have a scrip that sets the owner based on the value in a Custom Field.
Look at it and modify it to meet your needs:

# Custom Action preparation code

my $trans = $self-TransactionObj;
my $ticket = $self-TicketObj;

#
# set new ticket owner id value
#
#42 -  Bob
#   148 - Carol
#  5125 - Ted
#  9324 - Alice
#

my %orgs = qw(
   Budget 148
   Controller  5125
   Facilities  42
   Field-OPS5125
   Property   9324
   SPO148
   Travel   5125
   Other   42
  );

my $cf = new RT::CustomField($RT::SystemUser);
$cf-LoadByName(Queue = $ticket-QueueObj-id,Name = CFO-Org);

# check for valid CF-Org value first,
# then set new Ticket Owner ID

if ($cf-id)
{
 my $cfvalue = $ticket-FirstCustomFieldValue('CFO-Org');
 my $ownerid = $orgs{$cfvalue};
 $ticket-SetOwner($ownerid);
}

return 1;

You could easily replace the owner Ids with your email address and instead
of setting the ownerid, set the To address or whatever.

Anyway, hope this helps. It sure works for us.

Kenn
LBNL

On Mon, May 3, 2010 at 8:49 AM, Givano giv...@gmail.com wrote:

 Hi,

 I'm trying to send an email from template, initiated by rt-crontool as
 described in wiki, the only trick is that dependent on custom field it
 should be sent to other persons group. Here my template, somehow it always
 send to user1 and user 2.

 
 Subject: new ticket, 30 minutes unowned!
 RT-Send-Cc: { my $values = $Ticket-CustomFieldValues('CIT_Category');
   my $OUTPUT;
   my $CFValue;
   while ( my $value = $values-Next ) {
 $CFValue = $value-Content;
 if ($CFValue == 'IT Facilites') { $OUTPUT = 'us...@dom.com,
 us...@dom.com' }
 elsif ($CFValue == 'Linux/Network') { $OUTPUT =  'us...@dom.com,
 us...@dom.com' }
 elsif ($CFValue == 'Phone') { $OUTPUT =  'us...@dom.com, us...@dom.com'
 }
 elsif ($CFValue == 'Windows') { $OUTPUT =  'us...@dom.com,
 us...@dom.com' }
   }
   $OUTPUT;
 }

 The ticket {$Ticket-id} stayed unowned for 30 minutes.

 Please do a categorisation, assign optionally an owner!
 ##

 Any idea what I'm doing wrong, maybe there is some, more elegant method to
 do a custom field based escalation, here is how I'am starting the
 rt-crontool:

 rt-crontool --search RT::Search::FromSQL --search-arg id = 23331 --action
 RT::Action::RecordComment --template 'UnownedNotifyWatcherLevel1'

 Thanks in advance,

 Ivan Samarin



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


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

[rt-users] Setting up spamassassin

2010-05-03 Thread Chris Hall
How does one go about setting up spamassassin with RT?  I've downloaded it
via apt-get, just not sure what the next step would be.

Trying to stop all the fre.e v1agerra tickets... gr

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

Re: [rt-users] Too many tickets in queue?

2010-05-03 Thread Torsten Brumm
Hi Emmanuel,
i think jesse is talking about our installation ;-)

To your Questions:

that's really big!

 Hmm, it's growing each day


 I'm curious is it possible to know which version of RT, which kind of
 httpd/db/cgi-perl handler, how many servers?


It is still an very old Version 3.6.5 but in progress of migration to
3.8.7(8)  within the next weeks.

We're using Apache 2.x on RedHat Enterprise Linux with FastCGI and FCGID
(different Webserver with different Setups, too many problems with FastCGI
and some major Problems with FCGID)

Frontends Webservers are some huge Webservers with lots of ram loadbalanced,
will be replaced end of this month by several VM's around the world (if
jesse can help us ;-) !) and a 64 Processor SUN with tons of RAM at the
backend.

Some words to the Backend. We use an addon from BPS to store attachments not
inside the DB anymore, we store everything inside a f***ing fast NetApp
connected by 4 x 1GB ETH to the Servers. DB is also stored inside the NetApp
on several hundred disks.

tob


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




-- 
MFG

Torsten Brumm

http://www.brumm.me
http://www.elektrofeld.de

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

Re: [rt-users] Setting up spamassassin

2010-05-03 Thread Jerrad Pierce
Read the friendly wiki

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