<chapter id="configfile">
<title>Config File</title>
<para>
OTRS has many config options. There are two config files. Kernel/Config.pm and
Kernel/Config/Defaults.pm. 
<para>

<para>
Kernel/Config/Defaults.pm is the default config file which should not be changed. 
You will find all possible config options in this file. Is quite simple to read.
</para>

<para>
Kernel/Config.pm.dist is the example file for Kernel/Config.pm (custom config file) 
which must be copied (cp Kernel/Config.pm.dist Kernel/Config.pm).
</para>

<para>
How it works! The Kernel/Config/Defaults.pm (default config settings) is loaded at 
first, then the Kernel/Config.pm (custom config file). So if you want to change the 
default config settings, copy (copy and paste) the needed options from 
Kernel/Config/Defaults.pm into Kernel/Config.pm and change the values like you want. 
</para>

<para>
Now we will descripe some config features in this chapter (of course not all!).
</para>

<sect1 id="configfile-tickethook">
<title>TicketHook</title>
<para>
Your can configure the value of the TicketHook which is the first part of the subject of each e-mail (e.g. [MyTicket: 007]).
</para>
<example>
<title>Kernel/Config.pm - TicketHook</title>
<programlisting>
[...]
    # TicketHook
    # (To set the Ticket identifier. Some people want to  
    # set this to e. g. 'Call#', 'MyTicket#' or 'Ticket#'.)     
    $Self->{TicketHook} = 'Ticket#',              
[...]
</programlisting>
</example>
<para>
Note: Don't use 'TN', because MS Outlook is replacing "TN: 54968797" with "RE: 54968797" 
and then you will run in trouble. 
</para>
</sect1>

<sect1 id="configfile-fqdn">
<title>FQDN</title>
<para>
The OTRS full qualified domain name. Will be used for email messages id's.
</para>
<example>
<title>Kernel/Config.pm - FQDN</title>
<programlisting>
[...]
    # FQDN
    # (Full qualified domain name of your system.)
    $Self->{FQDN} = 'yourhost.example.com';
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-log">
<title>Log</title>
<para>
The OTRS log method. 
</para>
<example>
<title>Kernel/Config.pm - LogModule</title>
<programlisting>
[...]
    # ----------------------------------------------------#
    # log settings                                        #
    # ----------------------------------------------------#

    # LogModule
    # (log backend module)
    $Self->{LogModule} = 'Kernel::System::Log::SysLog';
#    $Self->{LogModule} = 'Kernel::System::Log::File';

    # param for LogModule Kernel::System::Log::File (required!)
#    $Self->{'LogModule::LogFile'} = '/tmp/otrs.log'; 
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-checkemail">
<title>Check Email Options</title>
<para>
There are two options to check the used emails in the OTRS frontend.
</para>
<para>
<example>
<title>Kernel/Config.pm - CheckEmailAddresses</title>
<programlisting>
[...]
    # CheckEmailAddresses
    # (Check syntax of used email addresses)
    $Self->{CheckEmailAddresses} = 1;
[...]
</programlisting>
</example>
<para>
<example>
<title>Kernel/Config.pm - CheckMXRecord</title>
<programlisting>
[...]
    # CheckMXRecord
    # (Check mx recorde of used email addresses)
    $Self->{CheckMXRecord} = 1;
[...]
</programlisting>
</example>
Disable this if you use OTRS in an network without external DNS lookup.
Or you can't send emails via the agent interface.
</para>
</sect1>

<sect1 id="configfile-postmaster"> 
<title>Max. Postmaster email</title> 
<para> 
OTRS is able to send automatically email replies. So it's possibe to create 
an email loop (of course we check bulk headers but other strange systems may not!). 
</para>
<example>
<title>Kernel/Config.pm - PostmasterMaxEmails</title>
<programlisting>
[...]
    # PostmasterMaxEmails
    # (Max post master daemon email to own email-address a day.
    # Loop-Protection!) [default: 40]
    $Self->{PostmasterMaxEmails} = 40;
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-ticketnumberformat">
<title>Ticket number format</title>
<para> 
You can choose between four different OTRS formats. AutoIncrement is default. 
</para>
<example>
<title>Kernel/Config.pm - TicketNumberGenerator</title>
<programlisting>
[...] 
    # TicketNumberGenerator 
    # 
    # Kernel::System::Ticket::Number::AutoIncrement (default) --> auto increment 
    #   ticket numbers "SystemID.Counter" like 1010138 and 1010139.
    #
    # Kernel::System::Ticket::Number::Date --> ticket numbers with date 
    #   "Year.Month.Day.SystemID.Counter" like 200206231010138 and 200206231010139.
    #
    # Kernel::System::Ticket::Number::DateChecksum --> ticket numbers with date and 
    #   check sum the counter will be rotated daily (my favorite) 
    #   "Year.Month.Day.SystemID.Counter.CheckSum" like 2002070110101520 and 2002070110101535.
    #
    # Kernel::System::Ticket::Number::Random -->
    #   random ticket numbers "SystemID.Random" like 100057866352 and 103745394596.

    $Self->{TicketNumberGenerator} = 'Kernel::System::Ticket::Number::AutoIncrement';
[...]
</programlisting>
</example>
<para>
You can also create a new (your own) module. The module needs just two functions  
(the whole abstraction). "CreateTicketNr()" to generate a new ticket number and  
"GetTNByString()" to get a ticket number by string. 
</para>
<para>
A nice example is the <ulink url="http://otrs.org/cgi-bin/cvsweb.cgi/otrs/Kernel/System/Ticket/Number/Random.pm">Kernel::System::Ticket::Number::Random</ulink> module.
</para>
</sect1>


<sect1 id="configfile-dbstuff">
<title>Database settings</title>
<example>
<title>Kernel/Config.pm - Database settings</title>
<programlisting>
[...]
    # 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.)
    $Self->{DatabasePw} = 'some-pass';

    # DatabaseDSN
    # (The database DSN for MySQL ==> more: "man DBD::mysql") 
    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

    # (The database DSN for PostgrSQL ==> more: "man DBD::Pg") 
    #$Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-asp">
<title>ASP (Application Service Provider) options</title>
<para>
Should the agent be able to move tickets into queue which it isn't member of the group
(Helpfully if you use OTRS in ASP (Application Service Provider) mode).
</para>
<example>
<title>Kernel/Config.pm - MoveInToAllQueues</title>
<programlisting>
[...]
    # MoveInToAllQueues
    # (Possible to move in all queue? Not only queue which
    # the own groups) [1|0]
    $Self->{MoveInToAllQueues} = 1;
[...]
</programlisting>
</example>
<para>
Should the agent be able to change the ticket owner to everyone? 
(Helpfully if you use OTRS in ASP (Application Service Provider) mode).
</para>
<example>
<title>Kernel/Config.pm - ChangeOwnerToEveryone</title>
<programlisting>
[...]
    # ChangeOwnerToEveryone -> useful for ASP
    # (Possible to change owner of ticket ot everyone) [0|1]
    $Self->{ChangeOwnerToEveryone} = 0;
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-customqueue">
<title>Custom Queue</title>
<para>
Some people want to set the "Custom Queue" name (The queue of your favorite queues).
</para>
<example>
<title>Kernel/Config.pm - Custom Queue</title>
<programlisting>
[...]
    # CustomQueue
    # (The name of custom queue.)
    $Self->{CustomQueue} = 'PersonalQueue';
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-notification">
<title>Agent notification</title>
<para>
If there is a new ticket or a follow up for a ticket, OTRS will inform the agent(s).
</para>
<example>
<title>Kernel/Config.pm - Agent notification</title>
<programlisting>
[...]
    # ----------------------------------------------------#
    # notification stuff                                  #
    # ----------------------------------------------------#
    # notification sender
    $Self-&gt;{NotificationSenderName} = 'OTRS Notification Master';
    $Self-&gt;{NotificationSenderEmail} = 'otrs@'.$Self-&gt;{FQDN};

    # new ticket
    $Self-&gt;{NotificationSubjectNewTicket} = 'New ticket notification! (&lt;OTRS_CUSTOMER_SUBJECT[10]&gt;)';
    $Self-&gt;{NotificationBodyNewTicket} = "
Hi,

there is a new ticket!

&lt;snip&gt;
&lt;OTRS_CUSTOMER_EMAIL[6]&gt;
&lt;snip&gt;

http://$Self-&gt;{FQDN}/otrs/index.pl?Action=AgentZoom&amp;TicketID=&lt;OTRS_TICKET_ID&gt;

Your OTRS Notification Master

";

    # follow up
    $Self-&gt;{NotificationSubjectFollowUp} = 'You got follow up! (&lt;OTRS_CUSTOMER_SUBJECT[10]&gt;)';
    $Self-&gt;{NotificationBodyFollowUp} = "
Hi &lt;OTRS_USER_FIRSTNAME&gt;,

you got a follow up!

&lt;snip&gt;
&lt;OTRS_CUSTOMER_EMAIL[6]&gt;
&lt;snip&gt;

http://$Self-&gt;{FQDN}/otrs/index.pl?Action=AgentZoom&amp;TicketID=&lt;OTRS_TICKET_ID&gt;

Your OTRS Notification Master

";
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-session">
<title>Session management</title>
<para>
The OTRS session management. 
</para>
<example>
<title>Kernel/Config.pm - Session management</title>
<programlisting>
[...]
    # ----------------------------------------------------#
    # session settings                                    #
    # ----------------------------------------------------#

    # SessionModule (replace old SessionDriver!!!)
    # (How should be the session-data stored? 
    # Advantage of DB is that you can split the 
    # Frontendserver from the DB-Server. fs is faster.)
    $Self->{SessionModule} = 'Kernel::System::AuthSession::DB';
#    $Self->{SessionModule} = 'Kernel::System::AuthSession::FS';
#    $Self->{SessionModule} = 'Kernel::System::AuthSession::IPC';
    
    # SessionCheckRemoteIP 
    # (If the application is used via a proxy-farm then the 
    # remote ip address is mostly different. In this case,
    # turn of the CheckRemoteID. ) [1|0] 
    $Self->{SessionCheckRemoteIP} = 1;

    # SessionDeleteIfNotRemoteID
    # (Delete session if the session id is used with an 
    # invalied remote IP?) [0|1]
    $Self->{SessionDeleteIfNotRemoteID} = 1;

    # SessionMaxTime
    # (Max valid time of one session id in second (8h = 28800).)
    $Self->{SessionMaxTime} = 28800;

    # SessionDeleteIfTimeToOld
    # (Delete session's witch are requested and to old?) [0|1]
    $Self->{SessionDeleteIfTimeToOld} = 1;

    # SessionUseCookie
    # (Should the session management use html cookies?
    # It's more comfortable to send links -==> if you have a valid 
    # session, you don't have to login again.) [0|1]
    # Note: If the client browser disabled html cookies, the system
    # will work as usual, append SessionID to links!
    $Self->{SessionUseCookie} = 1;
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-login-logout">
<title>URL login and logout settings</title>
<para>
</para>
<example>
<title>Kernel/Config.pm - URL login and logout settings</title>
<programlisting>
[...]
    # ----------------------------------------------------#
    # URL login and logout settings                       #
    # ----------------------------------------------------#

    # LoginURL
    # (If this is anything other than '', then it is assumed to be the
    # URL of an alternate login screen which will be used in place of 
    # the default one.)
    $Self->{LoginURL} = '';
#    $Self->{LoginURL} = 'http://host.example.com/cgi-bin/login.pl';

    # LogoutURL
    # (If this is anything other than '', it is assumed to be the URL
    # of an alternate logout page which users will be sent to when they
    # logout.)
    $Self->{LogoutURL} = '';
#    $Self->{LogoutURL} = 'http://host.example.com/cgi-bin/login.pl';
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-agentarea">
<title>agent area default settings</title>
<para>
</para>
<example>
<title>Kernel/Config.pm - agent area default settings</title>
<programlisting>
[...]
    # ----------------------------------------------------#
    # agent area default settings                         #
    # ----------------------------------------------------#

    # ViewableTickets
    # (The default viewable tickets a page.)
    $Self->{ViewableTickets} = 25;

    # ViewableTicketLines
    # (Max viewable ticket lines in the QueueView.)
    $Self->{ViewableTicketLines} = 18;

    # ViewableTicketLinesZoom
    # (Max viewable ticket lines in the QueueZoom.)
    $Self->{ViewableTicketLinesZoom} = 6000;

    # MaxLimit
    # (Max viewable tickets a page.)
    $Self->{MaxLimit} = 150;

    # RefreshOptions
    # (Refresh option list for preferences)
    $Self->{RefreshOptions} = {
        '' => 'off',
        2  => ' 2 minutes',
        5  => ' 5 minutes',
        7  => ' 7 minutes',
        10 => '10 minutes',
        15 => '15 minutes',
    };

    # Highligh*
    # (Set the age and the color for highlighting of old queue
    # in the QueueView.)
    # highlight age1 in min
    $Self->{HighlightAge1} = 1440;
    $Self->{HighlightColor1} = 'orange';
    # highlight age2 in min
    $Self->{HighlightAge2} = 2880;
    $Self->{HighlightColor2} = 'red';

    # ----------------------------------------------------#
    # AgentUtil                                           #
    # ----------------------------------------------------#

    # default limit for Tn search
    $Self->{SearchLimitTn} = 20;

    # default limit for Txt search
    $Self->{SearchLimitTxt} = 20;

    # viewable ticket lines by search util 
    $Self->{ViewableTicketLinesBySearch} = 15;

    # ----------------------------------------------------#
    # Ticket stuff                                        #
    # (Viewable tickets in queue view)                    #
    # ----------------------------------------------------#
    # ViewableLocks 
    # default: ["'unlock'", "'tmp_lock'"]
    $Self->{ViewableLocks} = ["'unlock'", "'tmp_lock'"];

    # ViewableStateType 
    # (see http://yourhost/otrs/index.pl?Action=AdminState -> StateType)
    $Self->{ViewableStateType} = ['new', 'open', 'pending'];

    # ViewableSenderTypes 
    #  default:  ["'customer'"]
    $Self->{ViewableSenderTypes} = ["'customer'"];
[...]
</programlisting>
</example>
</sect1>

<sect1 id="configfile-spell">
<title>SpellChecker</title>
<para>
The OTRS is able to use a spell checker like 
<ulink url="http://fmg-www.cs.ucla.edu/fmg-members/geoff/ispell.html">ispell</ulink> 
or <ulink url="http://aspell.sourceforge.net/">aspell</ulink>.
</para>
<para>
<example>
<title>Kernel/Config.pm - SpellChecker</title>
<programlisting>
[...]
    # SpellChecker
    # (If ispell or aspell is available, then we will provide a spelling
    # checker) 
#    $Self->{SpellChecker} = '';
    $Self->{SpellChecker} = '/usr/bin/ispell';
    $Self->{SpellCheckerDictDefault} = 'english';
[...]
</programlisting>
</example>
</para>
<para>
Possible agent dictionaries.
<example>
<title>Kernel/Config.pm - SpellChecker - Agent Preferences</title>
<programlisting>
[...]
    $Self->{PreferencesGroups}->{SpellDict} = {
        Colum => 'Other Options',
        Label => 'Spelling Dictionary',
        Desc => 'Select your default spelling dictionary.',
        Type => 'Generic',
        Data => {
            # installed dict catalog (check your insalled catalogues, 
            # e. g. deutsch -=> german!)
            # dict => frontend
            'english' => 'English',
            'deutsch' => 'Deutsch',
        },
        PrefKey => 'UserSpellDict',
        Activ => 1,
    };
[...]
</programlisting>
</example>
</para>
<para>
Maybe you want that the answer to the customer must be spell checked.
<example>
<title>Kernel/Config.pm - SpellChecker - Must be spell checked</title>
<programlisting>
    # FrontendNeedSpellCheck
    # (compose message must be spell checked)
    $Self->{FrontendNeedSpellCheck} = 0;
</programlisting>
</example>
</para>
</sect1>

</chapter>
