OTRS POP3S/SMTPS Configuration

Moderator: crythias

Locked
bradykdavidson
Znuny newbie
Posts: 11
Joined: 29 Oct 2010, 15:20
Znuny Version: 3.0.22
Real Name: Brady Davidson
Location: Texas

OTRS POP3S/SMTPS Configuration

Post by bradykdavidson »

Our email server requires SSL and is using port 993 for the Incoming Mail Server and port 465 Outgoing Mail Server. After we changed to SSL I was easily able to get inbound email working by changing the port number from 389 to 993 in my Config.pm. But, I am completely lost on where to configure the outgoing email port. I was using the default Sendmail before we made the change to SSL. If I navigate to Admin => SysConfig => Framework::Core::Sendmail I am able to modify the Sendmail port. This still doesn't resolve the problem of outgoing emails not being sent. I can send to other email addresses like user@gmail.com. But, since this is use for support within our agency this is of no use if we will be replying to @example.com email address 99.9% of the time.

I have also tried to configure POP3S and SMTPS with no resolution. If I attempt to use either POP3S or SMTPS when I send an email I receive the error below:

Code: Select all

Error: Can't connect to example.com

ERROR: OTRS-CGI-10 Perl: 5.8.8 OS: linux Time: Tue Dec 18 10:32:37 2012 Message: Can't connect to example.com: ! Traceback (24181): Module: Kernel::System::Email::SMTPS::Send (v1.2) Line: 92 Module: Kernel::System::Email::Send (v1.64.2.4) Line: 695 Module: Kernel::System::Ticket::Article::ArticleSend (v1.232.2.5) Line: 2037 Module: Kernel::Modules::AgentTicketCompose::Run (v1.81.2.13) Line: 452 Module: Kernel::System::Web::InterfaceAgent::Run (v1.43.2.4) Line: 830 Module: /opt/otrs/bin/cgi-bin/index.pl (v1.88) Line: 48
Any help would be greatly appreciated. I would upgrade to a newer version of OTRS but we have had issues that I haven't had the time to resolve.

Environment is:
OTRS 2.4.10 running on CentOS 5.6 with LDAP for users.

Config.pm is below:

Code: Select all

package Kernel::Config;

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

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    # Authentication Settings				   #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    # $Self->{'AuthModule'} = 'Kernel::System::Auth::DB';

# AD authentication
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = 'ldap.example.com';
    $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=example,DC=com';
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=OTRS User,OU=users,DC=example,DC=com';
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'password';

# Group based authentication
    $Self->{'AuthModule::LDAP::GroupDN'} = 'cn=otrs,ou=groups,ou=users,dc=example,dc=com';
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
    # $Self->{'AuthModule::LDAP::UserAttr'} = 'UID';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';

  # LDAP user info
    # CustomerUser 
    # (customer user ldap backend and settings)
    $Self->{CustomerUser1} = {
        Name => 'Zimbra',
        Module => 'Kernel::System::CustomerUser::LDAP',
        Params => {
            # ldap host
            Host => 'mail.example.com',
            # ldap base dn
            BaseDN => 'dc=example,dc=com',
            # 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 => '',
            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 => '',
            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
		port => 993,
		version => 3,
            },
        },
        # customer uniq id
        CustomerKey => 'uid',
        # customer #
        CustomerID => 'mail',
        CustomerUserListFields => ['uid', 'cn', 'mail'],
        CustomerUserSearchFields => ['uid', 'cn', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserPostMasterSearchFields => ['mail'],
        CustomerUserNameFields => ['givenname', 'sn'],
        AdminSetPreferences => 0,
        Map => [
            # note: Login, Email and CustomerID needed!
            # var, frontend, storage, shown, required, storage-type
            [ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
            [ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
            [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
            [ 'UserLogin', 'Username', 'uid', 1, 1, 'var' ],
            [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
            [ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var' ],
            [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
            [ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
            [ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
        ],
    };


    # ---------------------------------------------------- #
    # 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} = 'hot';
    # 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;
    $Self->{SecureMode} =1;

    # QueueViewAllPossibleTickets
    # (show all ro and rw queues - not just rw queues)
    $Self->{QueueViewAllPossibleTickets} = 1;     

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

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #
    # $DIBI$
    $Self->{'Organization'} = 'Example Agency';
    $Self->{'FQDN'} = 'support.example.com';
    $Self->{'DefaultLanguage'} = 'en';
    $Self->{'AdminEmail'} = 'support@example.com';

    # ---------------------------------------------------- #
    # notification center
    # ---------------------------------------------------- #

    $Self->{'NotificationSenderName'} = 'OTRS Notification Master';
    $Self->{'NotificationSenderEmail'} = 'support@example.com';

    # ---------------------------------------------------- #
    #$Self->{'SendmailModule::Port'}= '465';

    # ---------------------------------------------------- #
    # Sendmail
    # ---------------------------------------------------- #
    #$Self->{’SendmailModule’} = ’Kernel::System::Email::SMTP’;
    #$Self->{’SendmailModule::Host’} = ’mail.example.com’;
    #$Self->{’SendmailModule::AuthUser’} = ’otrs’;
    #$Self->{’SendmailModule::AuthPassword’} = ’password’;

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #           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;
ORTS Check Modules Below:

Code: Select all

   o CGI............................failed!!! Version 3.15 installed but 3.33 or higher is required!
   o Date::Pcalc....................ok (v1.2)
   o Date::Format...................ok (v2.22)
   o DBI............................ok (v1.52)
   o DBD::mysql.....................ok (v3.0007)
   o Digest::MD5....................ok (v2.36)
   o Crypt::PasswdMD5...............ok (v1.3)
   o LWP::UserAgent.................ok (v2.033)
   o Encode::HanExtra...............Not installed! (Optional - Required to handle mails with several Chinese character sets.)
   o IO::Scalar.....................ok (v2.110)
   o IO::Wrap.......................ok (v2.110)
   o MIME::Base64...................ok (v3.07)
   o Mail::Internet.................ok (v2.04)
   o MIME::Tools....................ok (v5.427)
   o Net::DNS.......................ok (v0.59)
   o Net::POP3......................ok (v2.28)
   o Mail::POP3Client...............ok (v2.18 )
      o IO::Socket::SSL.............ok (v1.01)
   o Net::IMAP::Simple..............ok (v1.17)
      o Net::IMAP::Simple::SSL......ok (v1.3)
   o Net::SMTP......................ok (v2.29)
      o Authen::SASL................ok (v2.12)
      o Net::SMTP::SSL..............ok (v1.01)
   o Net::LDAP......................ok (v0.33)
   o GD.............................Not installed! (Optional - for stats)
      o GD::Text....................Not installed! (Optional - Required for stats.)
      o GD::Graph...................Not installed! (Optional - Required for stats.)
      o GD::Graph::lines............Not installed! (Optional - Required for stats.)
      o GD::Text::Align.............Not installed! (Optional - Required for stats.)
   o PDF::API2......................Not installed! (Optional - Required for PDF output.)
      o Compress::Zlib..............ok (v1.42)
   o SOAP::Lite.....................Not installed! (Optional - Required for the SOAP interface.)
   o XML::Parser....................ok (v2.34)
bradykdavidson
Znuny newbie
Posts: 11
Joined: 29 Oct 2010, 15:20
Znuny Version: 3.0.22
Real Name: Brady Davidson
Location: Texas

Re: OTRS POP3S/SMTPS Configuration

Post by bradykdavidson »

Anyone?? I am able to get this to work correctly on SugarCRM but if I don't pay for their enterprise software I don't get a ticketing system. I even attempted to install the newest version of OTRS and the exact same settings that worked within SugarCRM don't work in OTRS...
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: OTRS POP3S/SMTPS Configuration

Post by crythias »

arg ... 2.4.10? ...trudge ... dig ... http://source.otrs.org
cd Kernel/System
grep -sir "SMTP" *

something in Email/SMTPS.pm? seems promising
bradykdavidson wrote: I am completely lost on where to configure the outgoing email port.


Kernel/System/Email/SMTPS.pm ... $Self->{SMTPPort} = $Self->{ConfigObject}->Get('SendmailModule::Port') || 'smtp(25)';

Config object. Maybe something in Config.pm or Defaults.pm?

Defaults.pm ... search for SendmailModule::Port ..
line 316 # $Self->{'SendmailModule::Port'} = '25';
copy to Config.pm, uncomment and modify.

See if that works.
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
bradykdavidson
Znuny newbie
Posts: 11
Joined: 29 Oct 2010, 15:20
Znuny Version: 3.0.22
Real Name: Brady Davidson
Location: Texas

Re: OTRS POP3S/SMTPS Configuration

Post by bradykdavidson »

crythias Thank you for the information! I will keep that saved in case I have problems in the future. There are several areas where I am a complete newb regarding OTRS. One of them is the Core::Sendmail settings. I hadn't ever had to configure outgoing email settings before within OTRS and I wasn't sure if Core::Sendmail was the correct place to do so.

The issue turned out to be an incorrect outgoing mail server port. All my other devices used 465 for the outgoing mail server. But, for some reason I needed to use port 25 for outgoing on OTRS. I found this by setting up osTicket for testing outgoing email server settings and realizing that it wouldn't successfully verify my outgoing email server port.

These settings will very for all but we are using port 465 and require SSL. But, these settings are the only ones that worked.

SendmailModule: SMTP
SendmailModule::CMD: /usr/sbin/sendmail -i -f
SendmailModule::Host: mail.host.com
SendmailModule::Port: 25

All of the other options I left unchecked.
Locked