Active Directory contacts in To field

Moderator: crythias

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

Active Directory contacts in To field

Post by aph »

We use Active Directory as the source for customers in our OTRS installation. When I enter the name of a 'real' customer in To field (for example in ticket forward dialog) the correct e-mail address is fetched. But we also have some e-mail addresses saved in AD in form of contacts. What would I have to do so that these contacts also appear as suggestions in the 'to' field?

In this particular case we have the support address of an external service provider saved as a contact in Active Directory. I would like OTRS to provide this address as suggestion in 'to' field.
Last edited by aph on 02 Feb 2016, 10:10, 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
root
Administrator
Posts: 4011
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Active Directory contacts in To field

Post by root »

I guess you have a filter configure which prevents OTRS from finding theses contacts. I would add a new CustomerUser configuration with an own field mapping.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Active Directory contacts in To field

Post by aph »

Thanks for the reply. I do not filter customer users. I tried adding a new CustomerUser configuration, yet no luck. Your help is appreciated Below is my CustomerUser configuration:

Code: Select all

# CustomerUser
	# (customer user ldap backend and settings)
     $Self->{CustomerUser2} = {
        Name => 'LDAP Backend',
        Module => 'Kernel::System::CustomerUser::LDAP',
		Params => {
		# ldap host
            Host => 'xxxx.xxxx.local',
            # ldap base dn
            BaseDN => 'dc=xxxx,dc=local',
            # search scope (one|sub)
            SSCOPE => 'sub',
            # The following is valid but would only be necessary if the
            # anonymous user does NOT have permission to read from the LDAP tree
            UserDN => 'CN=xxxx,CN=Users,DC=xxxx,DC=local',
            UserPw => 'xxxx',
            # in case you want to add always one filter to each ldap query, use
            # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
#            AlwaysFilter => '',
# if both your frontend and your LDAP are unicode, use this:
            SourceCharset => 'utf-8',
            DestCharset   => 'utf-8',
# if your frontend is unicode and the charset of your
# ldap server is iso-8859-1, use these options.
# SourceCharset => 'iso-8859-1',
# DestCharset => 'utf-8',
# die if backend can't work, e. g. can't connect to server
#            Die => 0,
#            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
#                port    => 389,
#                timeout => 120,
#                async   => 0,
#                version => 3,
		 inet4 => 1,
            },
         },
#        # customer unique id
         CustomerKey => 'userPrincipalName',
#        # customer #
         CustomerID => 'company', #'userPrincipalName', #'company', #'distinguishedName',#
         CustomerUserListFields => ['cn', 'mail'],
	 CustomerUserSearchFields => ['uid', 'cn', 'mail'],
#       CustomerUserSearchPrefix => '',
#       CustomerUserSearchSuffix => '*',
         CustomerUserSearchListLimit => 250,
#       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',      'userPrincipalName',            1, 1, 'var', '', 0 ],
             [ 'UserCustomerID', 'CustomerID', 'company',            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 ],
         ],
    };
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
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Active Directory contacts in To field

Post by EXG133 »

Contacts do not use the same fields as regular users. 'mail' and 'cn' might not be filled or may not contain what you'd expect. The email address is probably in msExchUMDtmfMap, but that's a multi value string so I'm not sure if OTRS will like it.
jjurkus
Znuny newbie
Posts: 54
Joined: 29 Jan 2016, 15:36
Znuny Version: 6.0.17

Re: Active Directory contacts in To field

Post by jjurkus »

aph wrote:Thanks for the reply. I do not filter customer users. I tried adding a new CustomerUser configuration, yet no luck. Your help is appreciated Below is my CustomerUser configuration:

Code: Select all

	 CustomerUserSearchFields => ['uid', 'cn', 'mail'],

             [ 'UserEmail',      'Email',      'userPrincipalName',            1, 1, 'var', '', 0 ],
Ehhh, why don't you use this in those places?

Code: Select all

CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],

[ 'UserEmail',      'Email',        'mail',                 1, 1, 'var', '', 0 ],
If you are interested what fields in AD are filled with what, use something like JXplorer to see all the correct names for the ldap stuff.
OTRS 6.0.x on CentOS 7 with a PostgreSQL database.
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Active Directory contacts in To field

Post by aph »

EXG133 wrote:Contacts do not use the same fields as regular users. 'mail' and 'cn' might not be filled or may not contain what you'd expect. The email address is probably in msExchUMDtmfMap, but that's a multi value string so I'm not sure if OTRS will like it.
The e-mail address is stored in the attribute mail
Unbenannt_212.PNG
jjurkus wrote:
aph wrote:Thanks for the reply. I do not filter customer users. I tried adding a new CustomerUser configuration, yet no luck. Your help is appreciated Below is my CustomerUser configuration:

Code: Select all

	 CustomerUserSearchFields => ['uid', 'cn', 'mail'],

             [ 'UserEmail',      'Email',      'userPrincipalName',            1, 1, 'var', '', 0 ],
Ehhh, why don't you use this in those places?

Code: Select all

CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],

[ 'UserEmail',      'Email',        'mail',                 1, 1, 'var', '', 0 ],
If you are interested what fields in AD are filled with what, use something like JXplorer to see all the correct names for the ldap stuff.
I had used the attribute userPrincipalName as attribute since it is identical to 'mail' on my test system. Making the changes you suggested still doesn't show the desired results
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
Post Reply