[SOLVED] How to set customer info when sending email

Moderator: crythias

Locked
JDOS
Znuny newbie
Posts: 15
Joined: 15 Sep 2010, 14:28
Znuny Version: 2.4.7
Location: The Netherlands

[SOLVED] How to set customer info when sending email

Post by JDOS »

Hello OTRS-admins,

This is my configuration: OTRS 2.4.7 running on openSuSE 11.2 and using AD Windows 2003 as a LDAP backend.

When a customer creates a ticket using the default customer webinterface everything works as expected and user information is automatically generated / retrieved (Firstname, lastname, etc.) and stored with the new ticket. When an agent opens the ticket all the user information is displayed. However, when a customer sends an email to support@company.com this information is unavailable. Is it possible to retrieve this from AD and store this with the newly created ticket in the OTRS-db?

Thanks,
JDOS

BTW OTRS is really nice stuff; thanks for the good work!
Last edited by JDOS on 20 Sep 2010, 11:07, edited 2 times in total.
OTRS 2.4.9 on openSuSE 11.2 with MySQL database connected to an Active Directory for Agents and Customers.
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: How to set customer info when sending email

Post by ferrosti »

No, this is not possible by default.
I have written an import program, which imports all users from AD and writes them into the local database. This way it works well.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
JDOS
Znuny newbie
Posts: 15
Joined: 15 Sep 2010, 14:28
Znuny Version: 2.4.7
Location: The Netherlands

Re: How to set customer info when sending email

Post by JDOS »

Thanks ferrosti for your reply. If this is not possible, so be it. But maybe this is an option: When a ticket is created by a customer using the webinterface the field From of that ticket is displayed as Firstname Lastname <emailaddress>, when the ticket is created by sending an email it's displayed as "emailaddress" <emailaddress>. How to change "emailaddress" info Firstname Lastname?

JDOS
OTRS 2.4.9 on openSuSE 11.2 with MySQL database connected to an Active Directory for Agents and Customers.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to set customer info when sending email

Post by crythias »

why aren't you using the active directory as a[n additional] customer database?
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
JDOS
Znuny newbie
Posts: 15
Joined: 15 Sep 2010, 14:28
Znuny Version: 2.4.7
Location: The Netherlands

Re: How to set customer info when sending email

Post by JDOS »

I think this is exactly what I did ...
OTRS 2.4.9 on openSuSE 11.2 with MySQL database connected to an Active Directory for Agents and Customers.
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: How to set customer info when sending email

Post by ferrosti »

Just a guess
Could it be that your customer identifier is not based on the mailaddress in this case, but on the login name?
For me it seems that some identifiers go wrong, like matching mailaddress with SAMAccountName or something.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
JDOS
Znuny newbie
Posts: 15
Joined: 15 Sep 2010, 14:28
Znuny Version: 2.4.7
Location: The Netherlands

Re: How to set customer info when sending email

Post by JDOS »

Hi ferrosti,

This is my Config.pm; should I make adjustments in the Map=> area?

Code: Select all

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: Config.pm.dist,v 1.21 2009/02/16 12:01:43 tr 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.
# --
#  Note:
#
#  -->> OTRS does have a lot of config settings. For more settings
#       (Notifications, Ticket::ViewAccelerator, Ticket::NumberGenerator,
#       LDAP, PostMaster, Session, Preferences, ...) see
#       Kernel/Config/Defaults.pm and copy your wanted lines into "this"
#       config file. This file will not be changed on update!
#
# --

package Kernel::Config;

sub Load {
    my $Self = shift;
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #         Start of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #
    # DatabaseHost
    # (The database host.)
    $Self->{'DatabaseHost'} = 'localhost';
    # Database
    # (The database name.)
    $Self->{'Database'} = 'otrs';
    # DatabaseUser
    # (The database user.)
    $Self->{'DatabaseUser'} = 'otrs';
    # DatabasePw
    # (The password of database user. You also can use bin/CryptPassword.pl
    # for crypted passwords.)
    $Self->{'DatabasePw'} = '********';
    # DatabaseDSN
    # (The database DSN for MySQL ==> more: "man DBD::mysql")
    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

    # (The database DSN for PostgreSQL ==> more: "man DBD::Pg")
    # if you want to use a local socket connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
    # if you want to use a tcpip connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";

    # ---------------------------------------------------- #
    # fs root directory
    # ---------------------------------------------------- #
    $Self->{Home} = '/opt/otrs';

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;

    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #
    # $DIBI$
    $Self->{'SystemID'} = 10;
    $Self->{'SecureMode'} = 1;
    $Self->{'Organization'} = 'Our Organization';
    $Self->{'LogModule::LogFile'} = '/var/log/otrs.log';
    $Self->{'LogModule'} = 'Kernel::System::Log::File';
    $Self->{'FQDN'} = 'otrs.org.local';
    $Self->{'DefaultLanguage'} = 'nl';
    $Self->{'AdminEmail'} = 'support@company.com';
    $Self->{'DefaultCharset'} = 'utf-8';

    # ---------------------------------------------------- #
    # Show customer user info on Compose                   #
    # ---------------------------------------------------- #
    $Self->{'Ticket::Frontend::CustomerInfoCompose'} = 1;
    $Self->{'Ticket::Frontend::CustomerInfoZoom'} = 1;
    $Self->{'Ticket::Frontend::CustomerInfoQueue'} = 0;

    # ---------------------------------------------------- #
    # End Show customer user info on Compose               #
    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # LDAP information & authentication Active Directory   #
    # ---------------------------------------------------- #

    # Enable LDAP authentication for Agents
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = 'ldap';
    $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=org,DC=local';
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=OTRS_Agents,OU=Security Groepen,OU=Groepen,OU=Organization,DC=org,DC=local';
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'ORG\ldapusr';
    $Self->{'AuthModule::LDAP::SearchUserPw'} = '********';
    $Self->{'AuthModule::LDAP::AlwaysFilter'} = '';
    $Self->{'AuthModule::LDAP::Params'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };

    # Sync Agent data with OTRS DB
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'ldap';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'DC=org,DC=local';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'ORG\ldapusr';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = '********';
    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };
    $Self->{'AuthSyncModule::LDAP::Params'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };

    $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN';
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
    'users',
    ];

    $Self->{DatabaseUserTable}       = 'users';
    $Self->{DatabaseUserTableUserID} = 'id';
    $Self->{DatabaseUserTableUserPW} = 'pw';
    $Self->{DatabaseUserTableUser}   = 'login';

    # Enable LDAP authentication for Customers / Users
    $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
    $Self->{'Customer::AuthModule::LDAP::Host'} = 'ldap';
    $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'DC=org,DC=local';
    $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'CN=OTRS_Customers,OU=Security Groepen,OU=Groepen,OU=Organization,DC=org,DC=local';
    $Self->{'Customer::AuthModule::LDAP::AccessAttr'} = 'member';
    $Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'DN';
    $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'ORG\ldapusr';
    $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = '********';
    $Self->{'Customer::AuthModule::LDAP::AlwaysFilter'} = '(objectclass=user)';
    # $Self->{'Customer::AuthModule::LDAP::Params'} = {
    $Self->{'AuthModule::LDAP::Params'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };

# CustomerUser
# (customer user ldap backend and settings)
    $Self->{CustomerUser} = {
        Name => 'LDAP AD Windows 2003',
        Module => 'Kernel::System::CustomerUser::LDAP',
        Params => {
            Host => 'ldap',
            BaseDN => 'OU=Gebruikers,OU=Organization,DC=org,DC=local',
            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 => 'ORG\ldapusr',
            UserPw => '********',
            # 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 => '(objectclass=user)',
            # die if backend can't work, e. g. can't connect to server
            Die => 1,
            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
                port    => 389,
                timeout => 120,
                async   => 0,
                version => 3,
            },
        },
        # customer uniq id
        CustomerKey => 'sAMAccountName',
        # customer #
        CustomerID => 'userPrincipalName',
        CustomerUserListFields => ['displayName', 'userPrincipalName'],
        CustomerUserSearchFields => ['displayName', 'userPrincipalName'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        # CustomerUserSearchListLimit => 250,
        CustomerUserPostMasterSearchFields => ['userPrincipalName'],
        CustomerUserNameFields => ['givenName', 'sn'],
        # show not 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 life in sec. - cache any ldap queris
        CacheTTL => 0,
        Map => [
            # note: Login, Email and CustomerID needed!
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
#            [ 'UserSalutation', 'Title',      'title',           1, 0, 'var', '', 0 ],
            [ 'UserFirstname',  'Firstname',  'givenname',       1, 1, 'var', '', 0 ],
            [ 'UserLastname',   'Lastname',   'sn',              1, 1, 'var', '', 0 ],
            [ 'UserLogin',      'Username',   'sAMAccountName',             1, 1, 'var', '', 0 ],
            [ 'UserEmail',      'Email',      'mail',            1, 1, 'var', '', 0 ],
            [ 'UserCustomerID', 'CustomerID', 'mail',            1, 1, 'var', '', 0 ],
#            [ 'UserCustomerID', 'CustomerID', 'userPrincipalName',            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 ],
        ],
    };

    # ---------------------------------------------------- #
    # End information & authentication Active Directory    #
    # ---------------------------------------------------- #

    # --------------------------------------------------- #
    #                                                     #
    #             Start of config options!!!              #
    #                CustomerPanel stuff                  #
    #                                                     #
    # --------------------------------------------------- #

    # SessionName
    # (Name of the session key. E. g. Session, SessionID, OTRS)
    # $Self->{CustomerPanelSessionName} = 'CSID';

    # CustomerPanelUserID
    # (The customer panel db-uid.) [default: 1]
    # $Self->{CustomerPanelUserID} = 1;

    # CustomerGroupSupport (0 = compat. to OTRS 1.1 or lower)
    # (if this is 1, the you need to set the group <-> customer user
    # relations! http://host/otrs/index.pl?Action=AdminCustomerUserGroup
    # otherway, each user is ro/rw in each group!)
    $Self->{CustomerGroupSupport} = 1;

    # CustomerGroupAlwaysGroups
    # (if CustomerGroupSupport is true and you don't want to manage
    # each customer user for this groups, then put the groups
    # for all customer user in there)
    # $Self->{CustomerGroupAlwaysGroups} = [ 'users', 'info' ];
    $Self->{CustomerGroupAlwaysGroups} = [ 'users', 'faq' ];

    # show online agents
    # $Self->{'CustomerFrontend::NotifyModule'}->{'1-ShowAgentOnline'} = {
    #    Module      => 'Kernel::Output::HTML::NotificationAgentOnline',
    #    ShowEmail   => 1,
    #    IdleMinutes => 60,
    # };

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #           End of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
}

# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #
use strict;
use warnings;

use vars qw(@ISA $VERSION);
use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');

use vars qw(@ISA $VERSION);
$VERSION = qw($Revision: 1.21 $)[1];

# -----------------------------------------------------#

1;
OTRS 2.4.9 on openSuSE 11.2 with MySQL database connected to an Active Directory for Agents and Customers.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to set customer info when sending email

Post by crythias »

I think you might want to parse yours against the wiki http://wiki.otrs.org/index.php?title=Us ... _customers
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
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: How to set customer info when sending email

Post by ferrosti »

IMHO this

Code: Select all

CustomerUserPostMasterSearchFields => ['userPrincipalName']
does not match this

Code: Select all

[ 'UserEmail',      'Email',      'mail',            1, 1, 'var', '', 0 ],
 [ 'UserCustomerID', 'CustomerID', 'mail',            1, 1, 'var', '', 0 ],
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
JDOS
Znuny newbie
Posts: 15
Joined: 15 Sep 2010, 14:28
Znuny Version: 2.4.7
Location: The Netherlands

RE: How to set customer info when sending email

Post by JDOS »

That's it! Thanks a lot guys!
OTRS 2.4.9 on openSuSE 11.2 with MySQL database connected to an Active Directory for Agents and Customers.
Locked