Incorrect value of customerID / CustomerUserID

Moderator: crythias

Locked
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Incorrect value of customerID / CustomerUserID

Post by aph »

My customers are in active directory (AD). When a customer sends an email to the support address, I'm able to see it under new tickets on dashboard (it is pulled from an IMAP inbox). However, the fields customer ID and CustomerUserID display the email address instead of the customerID that is set in config (in my case it is the distinguishedName of the customer).
Am I missing something in Sysconfig or Config which needs to be changed? Below is my CustomerUser from Config:

Code: Select all

# CustomerUser
	# (customer user ldap backend and settings)
     $Self->{CustomerUser2} = {
        Name => 'LDAP Backend2',
        Module => 'Kernel::System::CustomerUser::LDAP',
		Params => {
		# ldap host
            Host => 'xxxx-xxxx.xxxx.xxxx',
            # ldap base dn
            BaseDN => 'dc=xxxx,dc=xxxx',
            # search scope (one|sub)
            SSCOPE => 'sub',
            
            UserDN => 'CN=xxxx',
            UserPw => 'xxxx',
			
			
            SourceCharset => 'utf-8',
            DestCharset   => 'utf-8',
            
            Params => {
                port    => 389,
                timeout => 120,
                async   => 0,
                version => 3,
	            inet4 => 1,
            },
         },
         CustomerKey => 'userPrincipalName',
        CustomerID =>  'distinguishedName',
        CustomerUserListFields => ['cn', 'mail'],
        CustomerUserSearchFields => ['userPrincipalName', 'cn', 'mail'],
	#    CustomerUserSearchPrefix => '',
	#    CustomerUserSearchSuffix => '*',
         CustomerUserSearchListLimit => 5000,
    #    CustomerUserPostMasterSearchFields => ['mail'],
       CustomerUserNameFields => ['givenname', 'sn'],
        # show now own tickets in customer panel, CompanyTickets
	#        CustomerUserExcludePrimaryCustomerID => 0,
        # add a ldap filter for valid users (expert setting)
        # CustomerUserValidFilter => '(!(description=gesperrt))',
        # admin can't change customer preferences
	#        AdminSetPreferences => 0,
        # cache time to live in sec. - cache any ldap queries
	#        CacheTTL => 0,
         Map => [
            # note: Login, Email and CustomerID needed!
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
             [ 'UserTitle',      'Title',      'title',           1, 0, 'var', '', 0 ],
             [ 'UserFirstname',  'Firstname',  'givenname',       1, 1, 'var', '', 0 ],
             [ 'UserLastname',   'Lastname',   'sn',              1, 1, 'var', '', 0 ],
             [ 'UserLogin',      'Username',   'userPrincipalName',             1, 1, 'var', '', 0 ],
             [ 'UserEmail',      'Email',      'mail',            1, 1, 'var', '', 0 ],
             #xax[ 'UserCustomerID', 'CustomerID', 'userPrincipalName',            0, 1, 'var', '', 0 ],
			 [ 'UserCustomerID', 'CustomerID', 'distinguishedName',            0, 1, 'var', '', 0 ],
        #   # [ 'UserCustomerIDs', 'CustomerIDs', 'second_customer_ids', 1, 0, 'var', '', 0 ],
			 [ 'UserPhone',      'Phone',      'telephonenumber', 1, 0, 'var', '', 0 ],
			 [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', '', 0 ],
            [ 'UserComment',    'Comment',    'description',     1, 0, 'var', '', 0 ],
         ],
    };
Appreciate your help!
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Incorrect value of customerID / CustomerUserID

Post by aph »

The following screenshot might help to elaborate.
Unbenannt_70.PNG
The ticket with the title 'test delete' was created in OTRS as an email ticket and contains as customerID the distinguishedName and as customeruserID the userPrincipalName. I can follow this since CustomerID => 'distinguishedName' and CustomerKey => 'userPrincipalName' is configured in the CustomerUser section of the Config.pm

The ticket with the title 'OTRS Mailbox Test', on the other hand, was received via Email and then transferred to OTRS from an IMAP folder. It (incorrectly) carries the email address of the sender as customerID as well as customeruserID. I don't quite understand this. Nowhere have I configured customerID=mail or CustomeruserID=mail.

Can anyone explain where the value comes from? The implication of the error is that a ticket of the same customer user is assigned two different customerIDs depending upon whether the ticket was received as an email or was created by an agent in OTRS.
You do not have the required permissions to view the files attached to this post.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Incorrect value of customerID / CustomerUserID

Post by jojo »

remove the # before

Code: Select all

    #    CustomerUserPostMasterSearchFields => ['mail'],
"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
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Incorrect value of customerID / CustomerUserID

Post by aph »

Uncommenting the line and changing 'mail' to 'distinguishedName' doesn't change the customer ID of the ticket, even of a new ticket that was pulled from IMAP.

It still doesn't explain why customeruserid = email and not userPrincipalName as configured under 'CustomerUser'.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Incorrect value of customerID / CustomerUserID

Post by crythias »

The sender address is the only value to be able to look up a customer from an email. If the sender address doesn't match a valid field (the CustomerUserPostMasterSearchFields) for any customer, it's a new customer.
aph wrote:Uncommenting the line and changing 'mail' to 'distinguishedName' doesn't change the customer ID of the ticket
Of course it doesn't. It's a search field for an incoming ticket. Use GenericAgent to fix the CustomerID
aph wrote:even of a new ticket that was pulled from IMAP.
If PostMaster doesn't know how to find it, it is a new customer.
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
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Incorrect value of customerID / CustomerUserID

Post by aph »

Thanks crythias! It makes sense :) and I get DN in the customerID column as expected.

However, what I didn't get is why customeruserid = email of the customer and not userPrincipalName?
Last edited by aph on 26 Aug 2014, 16:39, edited 1 time in total.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Incorrect value of customerID / CustomerUserID

Post by crythias »

All new customers have CustomerID = 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
Locked