[SOLVED]Does login have to be an email address?

Moderator: crythias

Post Reply
hmmmm3
Znuny newbie
Posts: 57
Joined: 17 Feb 2012, 07:48
Znuny Version: 3

[SOLVED]Does login have to be an email address?

Post by hmmmm3 »

So I'm not new to otrs, but I recently realized I have a problem.

The customers in my system have logins that are NOT their email address. Im converting over from another help desk system in which the logins are a combination of their name and location. I am using the OTRS database, and NOT an external or LDAP implementation.

When I receive a new ticket email from a customer, it is not automatically assigned to them. The ticket zoom shows the login as the email address, but the other customer info is blank. When I created a customer that used an email for their login, everything worked as expected.

So, what do I need to do for this to work using a login that is NOT the email address? I am NOT using an external database.

Thank you.
Last edited by hmmmm3 on 09 Dec 2013, 18:20, edited 1 time in total.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Does login have to be an email address?

Post by crythias »

it should work as long as the customer's email address matches email field.
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
hmmmm3
Znuny newbie
Posts: 57
Joined: 17 Feb 2012, 07:48
Znuny Version: 3

Re: Does login have to be an email address?

Post by hmmmm3 »

I dont need to change in Config.pm:

CustomerKey => 'login' => to CustomerKey => 'email'.........nothing?

I dont need to modify or create a postmaster filter or alter the headers?
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Does login have to be an email address?

Post by crythias »

If you're interested, look at
Kernel/System/PostMaster/NewTicket.pm

look for "take CustomerID from customer backend lookup or from from field"

thereabouts.

Code: Select all

            my %List = $Self->{CustomerUserObject}->CustomerSearch(
                PostMasterSearch => lc( $GetParam{EmailFrom} ),
            );
CustomerSearch is in Kernel/System/CustomerUser.pm (actually, offloads to CustomerUser/DB.pm or CustomerUser/LDAP.pm based upon backend)
PostmasterSearch:

Code: Select all

    elsif ( $Param{PostMasterSearch} ) {
        if ( $Self->{CustomerUserMap}->{CustomerUserPostMasterSearchFields} ) {
            my $SQLExt = '';
            for my $Field ( @{ $Self->{CustomerUserMap}->{CustomerUserPostMasterSearchFields} } ) { #
                if ($SQLExt) {
                    $SQLExt .= ' OR ';
                }
                my $PostMasterSearch = $Self->{DBObject}->Quote( $Param{PostMasterSearch}, 'Like' );
                if ( $Self->{CaseSensitive} ) {
                    $SQLExt .= " $Field LIKE '$PostMasterSearch' $LikeEscapeString ";
                }
                else {
                    $SQLExt .= " LOWER($Field) LIKE LOWER('$PostMasterSearch') $LikeEscapeString ";
                }
            }
            $SQL .= $SQLExt;
        }
    }
default (in Defaults.pm):

Code: Select all

        CustomerUserPostMasterSearchFields => ['email'],
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
hmmmm3
Znuny newbie
Posts: 57
Joined: 17 Feb 2012, 07:48
Znuny Version: 3

Re: Does login have to be an email address?

Post by hmmmm3 »

Okay, i got it.

This was totally my fault. i had written some custom code that restricted what was returned in the search results, based on the user that was searching. So after I modified the call into Kernel/System/PostMaster/NewTicket.pm ...$Self->{CustomerUserObject}->CustomerSearch(....
and it worked as expected.

Thank you for the insight.
Post Reply