[CLOSE] can I reject emails with no subject

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] can I reject emails with no subject

Post by klausneil »

Hi please anybody can help me, the log say this and to the customer reject his mail

Recent Log Entries
TIEMPO PRIORIDAD INSTALACIÓN MENSAJE
Wed Dec 5 09:15:29 2012 notice OTRS-CGI-10 Response::Agent: 0s taken (URL:Action=Admin:otrs)
Wed Dec 5 09:15:20 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 IMAP: Fetched 1 email(s) from muestras@startlabs.com/mail.startlabs.com.
Wed Dec 5 09:15:20 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Ignored Email (From: Klaus Salazar <ksalazar@startlabs.com>, Message-ID: <50BF56B3.50200@startlabs.com>) because the X-OTRS-Ignore is set (X-OTRS-Ignore: yes).
Wed Dec 5 09:15:08 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Send reject mail to 'Klaus Salazar <ksalazar@startlabs.com>'!
Wed Dec 5 09:15:08 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Sent email to 'ksalazar@startlabs.com,otrs@startlabs.com,' from ''.
Wed Dec 5 09:15:04 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Set param 'X-OTRS-Ignore' to 'yes' (Message-ID: <50BF56B3.50200@startlabs.com>)
Wed Dec 5 09:15:04 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Filter: 'Selección de tipos - Muestras' Stopped filter processing because of used 'StopAfterMatch' (Message-ID: <50BF56B3.50200@startlabs.com>)
Wed Dec 5 09:15:04 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Filter: 'Selección de tipos - Muestras' Set param 'X-OTRS-Type' to 'Muestras' (Message-ID: <50BF56B3.50200@startlabs.com>)

worth noting that I'm using a rejection mail for those without subject but only in the tail of samples such rejection occurs
Last edited by klausneil on 12 Dec 2012, 19:33, 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 reject mail of customer

Post by crythias »

turn off the postmaster filter x-otrs-ignore. then figure out what he sent.

Edit: this would be an artifact of your "can I reject emails with no subject" post...
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: can I reject emails with no subject

Post by klausneil »

yes I just did just that and the emails are arriving but I would still like to block emails without subject, but in this queue are arriving mail with attachments with malware samples, as in other queues normal mails arrived this rule
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: can I reject emails with no subject

Post by crythias »

klausneil wrote: I would still like to block emails without subject
then tell your mail handler to do that.
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: can I reject emails with no subject

Post by klausneil »

Yes but I would like that when send to OTRS system, it is responsible for these rejections to see on your record this type of rejection
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: can I reject emails with no subject

Post by crythias »

If what was already given to you doesn't work, you'll need to seek other options. X-OTRS-Ignore doesn't reject. it ignores without reject notice. The reject filter in SysConfig can be modified to help, perhaps.

I don't have a better answer at this time.
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: can I reject emails with no subject

Post by klausneil »

anyway thank you very much and if you let me know any news to be aware
klausneil
Znuny superhero
Posts: 682
Joined: 29 May 2012, 22:47
Znuny Version: 6.0.24
Real Name: Klaus Salazar
Location: Perú

Re: can I reject emails with no subject

Post by klausneil »

Hi have any idea how to do this type of filter?
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: can I reject emails with no subject

Post by reneeb »

This is the time for yet another postmaster filter:

Code: Select all

    # --
    # Kernel/System/PostMaster/Filter/RejectEmptySubject.pm - sub part of PostMaster.pm
    # Copyright (C) 2012 Perl-Services.de
    # --
    # $Id: RejectEmptySubject.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::RejectEmptySubject;

    use strict;
    use warnings;

    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 $_!";
        }

        return $Self;
    }

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

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

        # ignore mail if subject is empty
        my $Subject = $Param{GetParam}->{Subject};
        if ( !defined $Subject || $Subject =~ m{\A\s*\z}xms ) {
            $Param{GetParam}->{'X-OTRS-Ignore'} = 'yes';
        }

        return 1;
    }

    1;
And this for Config.pm:

Code: Select all

    $Self->{'PostMaster::PreFilterModule'}->{'0002-EmptySubject'} = {
        Module => 'Kernel::System::PostMaster::Filter::RejectEmptySubject',
    };
Edit: again, this code is untested.
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: can I reject emails with no subject

Post by klausneil »

Hi thanks I'll try but i have one question is what is the address for response with mail of reject?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: can I reject emails with no subject

Post by crythias »

reneeb's module doesn't reject. It ignores.
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: can I reject emails with no subject

Post by klausneil »

yes i try and mail no incoming I nearly lost his job :shock: the log say:

Tue Dec 11 10:12:17 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:12:12 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:12:10 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:12:07 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:12:01 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Can't create PID PostMasterMailbox, because it's already running (startlabs.com/27298)!
Tue Dec 11 10:11:01 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Can't create PID PostMasterMailbox, because it's already running (startlabs.com/27298)!
Tue Dec 11 10:10:01 2012 notice OTRS-otrs.GenericAgent.pl-10 Run GenericAgent Job 'Eliminar RAW' from db.
Tue Dec 11 10:10:01 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Can't create PID PostMasterMailbox, because it's already running (startlabs.com/27298)!
Tue Dec 11 10:09:02 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Can't create PID PostMasterMailbox, because it's already running (startlabs.com/27298)!
Tue Dec 11 10:08:29 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:08:29 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:08:27 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:08:17 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:08:17 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:08:14 2012 notice OTRS-CGI-10 User: ksalazar authentication ok (REMOTE_ADDR: 190.222.52.188).
Tue Dec 11 10:08:12 2012 notice OTRS-CGI-10 Removed SessionID 10822f6754a10f25dfef567121cca50ab0.
Tue Dec 11 10:08:01 2012 notice OTRS-otrs.PostMasterMailbox.pl-10 Can't create PID PostMasterMailbox, because it's already running (startlabs.com/27298)!
Tue Dec 11 10:08:01 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:07:48 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:07:48 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:07:46 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:07:42 2012 error OTRS-CGI-10 Need ID!
Tue Dec 11 10:07:42 2012 error OTRS-CGI-10 Need ID!


:lol:
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: can I reject emails with no subject

Post by reneeb »

It can't get any mails because the script can't be started (it's already running). (Do you really run the PostMaster script every minute??)

I don't know where the "Need ID" messages come from. The code I posted doesn't need any IDs...
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: can I reject emails with no subject

Post by klausneil »

if friend Renee is very rare, well will I have to reinstall everything to avoid this, thanks for your help greetings.
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: [CLOSE] can I reject emails with no subject

Post by jojo »

go and buy professional help. The things you try to do will need some more understanding of development and OTRS background. You can not just copy code without understanding what is happening.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
klausneil
Znuny superhero
Posts: 682
Joined: 29 May 2012, 22:47
Znuny Version: 6.0.24
Real Name: Klaus Salazar
Location: Perú

Re: [CLOSE] can I reject emails with no subject

Post by klausneil »

thanks for the sale..
ltype44
Znuny newbie
Posts: 1
Joined: 14 Jan 2013, 12:37
Znuny Version: 2.0.4

Re: [CLOSE] can I reject emails with no subject

Post by ltype44 »

Its easy to overlook professional help, but it is vital if you are stuck. I have used code that l didnt fully understand and it created more problems for me.
Information on the benefits of free weights here. It should be helpful
klausneil
Znuny superhero
Posts: 682
Joined: 29 May 2012, 22:47
Znuny Version: 6.0.24
Real Name: Klaus Salazar
Location: Perú

Re: [CLOSE] can I reject emails with no subject

Post by klausneil »

The ticket is closed and there is no reason for comment, but if you can't help and you think you need commercial support is best leave of comment and let someone who knows comment.
Locked