[CLOSE] OTRS error with script created

Moderator: crythias

Locked
klausneil
Znuny superhero
Posts: 682
Joined: 29 May 2012, 22:47
Znuny Version: 6.0.24
Real Name: Klaus Salazar
Location: Perú

[CLOSE] OTRS error with script created

Post by klausneil »

Greetings this day I have not seen that emails were coming, I created a rule to avoid getting 5 emails same for this follow the link viewtopic.php?f=61&t%20=%2018186, this rule now generated with version 3.1.10 and updating to version 3.1.11 I started producing these problems:

Sat Dec 8 16:44:02 2012 error OTRS-otrs.PostMaster.pl-10 Can't process mail, see log sub system! at /opt/otrs//bin/otrs.PostMaster.pl line 116.
Sat Dec 8 16:44:02 2012 error OTRS-otrs.PostMaster.pl-10 Module Kernel/System/PostMaster/Filter/RejectDoubledContent.pm not found!
Sat Dec 8 16:44:02 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Stopped filter processing because of used 'StopAfterMatch' (Message-ID: <W984933762123381354998517@webmail102>)
Sat Dec 8 16:44:02 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Set param 'X-OTRS-Type' to 'Soporte Técnico' (Message-ID: <W984933762123381354998517@webmail102>)
Sat Dec 8 16:44:02 2012 error OTRS-otrs.PostMaster.pl-10 Can't process mail, see log sub system! at /opt/otrs//bin/otrs.PostMaster.pl line 116.
Sat Dec 8 16:44:02 2012 error OTRS-otrs.PostMaster.pl-10 Module Kernel/System/PostMaster/Filter/RejectDoubledContent.pm not found!
Sat Dec 8 16:44:02 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Stopped filter processing because of used 'StopAfterMatch' (Message-ID: <1891479894-1354997135-cardhu_decombobulator_blackberry.rim.net-642104809-@b1.c8.bise6.blackberry>)
Sat Dec 8 16:44:02 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Set param 'X-OTRS-Type' to 'Soporte Técnico' (Message-ID: <1891479894-1354997135-cardhu_decombobulator_blackberry.rim.net-642104809-@b1.c8.bise6.blackberry>)


and emails do not reach so I had to remove the script and comment lines added in otrs.conf restart apache and emails began to arrive, can someone tell me how to do to make this rule work?
Last edited by klausneil on 11 Dec 2012, 17:02, edited 3 times in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: OTRS error with script created

Post by crythias »

klausneil wrote:Module Kernel/System/PostMaster/Filter/RejectDoubledContent.pm not found!
You created this file. Why would it no longer exist?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
klausneil
Znuny superhero
Posts: 682
Joined: 29 May 2012, 22:47
Znuny Version: 6.0.24
Real Name: Klaus Salazar
Location: Perú

Re: OTRS error with script created

Post by klausneil »

Hi, yes i follow the steps that is in the link, there gave me the code to insert it into the file /opt/otrs/Kernel/System/PostMaster/Filter/RejectDoubledContent.pm

# Kernel/System/PostMaster/Filter/RejectDoubledContent.pm - sub part of PostMaster.pm
# Copyright (C) 2012 Perl-Services.de
# --
# $Id: NewTicketReject.pm,v 1.20 2012/11/20 15:52:12 mh Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package Kernel::System::PostMaster::Filter::RejectDoubledContent;

use strict;
use warnings;

use Kernel::System::Ticket;
use Kernel::System::Email;

use vars qw($VERSION);
$VERSION = qw($Revision: 1.20 $) [1];

sub new {
my ( $Type, %Param ) = @_;

# allocate new hash for object
my $Self = {};
bless( $Self, $Type );

$Self->{Debug} = $Param{Debug} || 0;

# get needed objects
for (qw(ConfigObject LogObject DBObject MainObject)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}

$Self->{TicketObject} = Kernel::System::Ticket->new(%Param);
$Self->{EmailObject} = Kernel::System::Email->new(%Param);

return $Self;
}

sub Run {
my ( $Self, %Param ) = @_;

# check needed stuff
for (qw(JobConfig GetParam)) {
if ( !$Param{$_} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
return;
}
}

# Search for tickets with the same subject, sender and body
my %MailParams = %{ $Param{GetParam} || {} };
my @TicketIDs = $Self->{TicketObject}->TicketSearch(
From => $MailParam{From},
Subject => $MailParam{Subject},
Body => $MailParam{Body},
);

# ignore mail if tickets with the same params are found
if ( @TicketIDs ) {
$Param{GetParam}->{'X-OTRS-Ignore'} = 'yes';
}

return 1;
}

1;[/b]

and after I had that add a line in anywhere in the file /opt/otrs/Kernel/Config.pl this is the line

$Self->{'PostMaster::PreFilterModule'}->{'0001-DoubledContent'} = {
Module => 'Kernel::System::PostMaster::Filter::RejectDoubledContent',
};


Once activated appear this error:

Sun Dec 9 14:55:01 2012 error OTRS-otrs.PostMaster.pl-10 Can't process mail, see log sub system! at /opt/otrs//bin/otrs.PostMaster.pl line 116.
Sun Dec 9 14:55:01 2012 error OTRS-otrs.PostMaster.pl-10 Global symbol "%MailParam" requires explicit package name at /opt/otrs/Kernel/System/PostMaster/Filter/RejectDoubledContent.pm line 57.
Sun Dec 9 14:55:01 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Stopped filter processing because of used 'StopAfterMatch' (Message-ID: <SNT002-W182238FD1163E197BFD8B0CC4A0@phx.gbl>)
Sun Dec 9 14:55:01 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Set param 'X-OTRS-Type' to 'Soporte Técnico' (Message-ID: <SNT002-W182238FD1163E197BFD8B0CC4A0@phx.gbl>)
Sun Dec 9 14:54:01 2012 error OTRS-otrs.PostMaster.pl-10 Can't process mail, see log sub system! at /opt/otrs//bin/otrs.PostMaster.pl line 116.
Sun Dec 9 14:54:01 2012 error OTRS-otrs.PostMaster.pl-10 Global symbol "%MailParam" requires explicit package name at /opt/otrs/Kernel/System/PostMaster/Filter/RejectDoubledContent.pm line 57.
Sun Dec 9 14:54:01 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Stopped filter processing because of used 'StopAfterMatch' (Message-ID: <SNT002-W182238FD1163E197BFD8B0CC4A0@phx.gbl>)
Sun Dec 9 14:54:01 2012 notice OTRS-otrs.PostMaster.pl-10 Filter: 'Selección de tipos - Soporte Técnico' Set param 'X-OTRS-Type' to 'Soporte Técnico' (Message-ID: <SNT002-W182238FD1163E197BFD8B0CC4A0@phx.gbl>)
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: OTRS error with script created

Post by reneeb »

Code: Select all

From => $MailParam{From},
Subject => $MailParam{Subject},
Body => $MailParam{Body},
All the "MailParam" should be "MailParams" (note the "s" at the end)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
klausneil
Znuny superhero
Posts: 682
Joined: 29 May 2012, 22:47
Znuny Version: 6.0.24
Real Name: Klaus Salazar
Location: Perú

Re: OTRS error with script created

Post by klausneil »

the message of alert was solved but are still getting duplicate emails, how could I know if this script is running or how to make work properly.
01.png
You do not have the required permissions to view the files attached to this post.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: OTRS error with script created

Post by reneeb »

The error in viewtopic.php?f=81&t=18437&p=72451#p72451 indicates what the problem is...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
klausneil
Znuny superhero
Posts: 682
Joined: 29 May 2012, 22:47
Znuny Version: 6.0.24
Real Name: Klaus Salazar
Location: Perú

Re: OTRS error with script created

Post by klausneil »

ok i'm close this for work in this link.
Locked