OTRS and IMAP with certificate

Moderator: crythias

Post Reply
roko98
OTRS newbie
Posts: 3
Joined: 24 Apr 2012, 20:16
OTRS Version?: 3.1.1

OTRS and IMAP with certificate

Post by roko98 » 24 Apr 2012, 20:21

Hi. I'm very new to OTRS and trying to configure the PostMaster mail account. I have Thunderbird configured using the exact same credentials and works fine. But Thunderbird downloads a certificate from the mail server. I can't find any info about configuring this with perl / OTRS. Any help will be greatly appreciated. Thx.

linux-u5xi:~ # /opt/otrs/bin/otrs.PostMasterMailbox.pl
ERROR: OTRS-otrs.PostMasterMailbox.pl-01 Perl: 5.12.3 OS: linux Time: Tue Apr 24 13:10:09 2012

Message: IMAP: Auth for user XXXX/XXXX failed!

Traceback (4506):
Module: Kernel::System::MailAccount::IMAP::_Fetch (v1.12) Line: 127
Module: Kernel::System::MailAccount::IMAP::Fetch (v1.12) Line: 79
Module: Kernel::System::MailAccount::MailAccountFetch (v1.17) Line: 424
Module: main::Fetch (v1.4) Line: 180
Module: /opt/otrs/bin/otrs.PostMasterMailbox.pl (v1.4) Line: 93

linux-u5xi:~ # /opt/otrs/bin/otrs.CheckModules.pl
o CGI..............................ok (v3.59)
o Crypt::PasswdMD5.................ok (v1.3)
o CSS::Minifier....................ok (v0.01)
o Date::Format.....................Not installed! (Required - use "perl -MCPAN -e shell;" - )
o Date::Pcalc......................ok (v1.2)
o DBI..............................ok (v1.616)
o DBD::mysql.......................ok (v4.018)
o DBD::ODBC........................Not installed! (Optional - Required to connect to a MS-SQL database.)
o DBD::Oracle......................Not installed! (Optional - Required to connect to a Oracle database.)
o DBD::Pg..........................Not installed! (Optional - Required to connect to a PostgreSQL database.)
o Digest::MD5......................ok (v2.39)
o Digest::SHA::PurePerl............ok (v5.70)
o Encode::HanExtra.................ok (v0.23)
o Encode::Locale...................ok (v1.02)
o GD...............................ok (v2.45)
o GD::Text......................ok (v0.86)
o GD::Graph.....................ok (v1.44)
o GD::Graph::lines..............ok (v1.15)
o GD::Text::Align...............ok (v1.18)
o IO::Scalar.......................ok (v2.110)
o IO::Wrap.........................ok (v2.110)
o JavaScript::Minifier.............ok (v1.05)
o JSON.............................ok (v2.53)
o JSON::PP......................ok (v2.27200)
o JSON::XS......................Not installed! (Optional - Install it for faster AJAX/JavaScript handling.)
o Locale::Codes....................ok (v3.18)
o LWP::UserAgent...................ok (v6.03)
o Mail::Internet...................ok (v2.08)
o Mail::POP3Client.................ok (v2.18 )
o IO::Socket::SSL...............ok (v1.38)
o Mail::IMAPClient.................ok (v3.29)
o IO::Socket::SSL...............ok (v1.38)
o MIME::Base64.....................ok (v3.08)
o MIME::Tools......................ok (v5.428)
o ModPerl::Util....................ok (v2.000004)
o Apache::DBI...................ok (v1.11)
o Apache2::Reload...............ok (v0.11)
o Net::DNS.........................ok (v0.66)
o Net::POP3........................ok (v2.29)
o Net::IMAP::Simple................ok (v1.20271)
o Net::IMAP::Simple::SSL........ok (v1.3)
o Net::SMTP........................ok (v2.31)
o Authen::SASL..................ok (v2.15)
o Net::SMTP::SSL................ok (v1.01)
o Net::SMTP::TLS::ButMaintained.ok (v0.18)
o Net::LDAP........................ok (v0.4001)
o PDF::API2........................ok (v0.73)
o Compress::Zlib................ok (v2.024)
o SOAP::Lite.......................ok (v0.714)
o version.......................ok (v0.82)
o Class::Inspector..............ok (v1.25)
o Text::CSV........................ok (v1.21)
o Text::CSV_PP..................ok (v1.29)
o Text::CSV_XS..................ok (v0.73)
o XML::Parser......................ok (v2.40)
o HTTP::Message....................ok (v6.02)
o HTTP::Headers.................ok (v6.00)
o URI..............................ok (v1.59)
o URI::Escape...................ok (v3.31)
o Scalar::Util.....................ok (v1.22)

roko98
OTRS newbie
Posts: 3
Joined: 24 Apr 2012, 20:16
OTRS Version?: 3.1.1

Re: OTRS and IMAP with certificate

Post by roko98 » 24 Apr 2012, 20:35

BTW, this is CAPABILITY info from the server:

* CAPABILITY IMAP4 IMAP4rev1 LOGINDISABLED STARTTLS UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+

jojo
Moderator
Posts: 14522
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: OTRS and IMAP with certificate

Post by jojo » 24 Apr 2012, 21:00

OTRS does not use IMAPTLS, just plain IMAP or IMAPS
"Production": OTRS™ 6, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com :: Share your ideas

roko98
OTRS newbie
Posts: 3
Joined: 24 Apr 2012, 20:16
OTRS Version?: 3.1.1

Re: OTRS and IMAP with certificate

Post by roko98 » 25 Apr 2012, 19:25

This is what I did. I changed account_type to IMAPTLS in the mail_account table and patched /Kernel/System/MailAccount/IMAPTLS.pm this way:

56a57
> Ignoresizeerrors => 1,
135,137c136
< my @Messages = $IMAPObject->messages()
< || die "Could not retrieve messages : $@\n";
< my $NumberOfMessages = scalar @Messages;
---
> my $NumberOfMessages = $IMAPObject->message_count;
150c149,153
< for my $Messageno (@Messages) {
---
> #my @Messages = $IMAPObject->messages()
> my @Messages = $IMAPObject->search('ALL')
> or die "Could not retrieve messages : $@\n";
>
> foreach my $Messageno (@Messages) {
195c198,199
< my $Message = $IMAPObject->message_string($Messageno);
---
> my $Message = $IMAPObject->message_string($Messageno)
> or die "Could not get content for message $Messageno: $@\n";;
246c250
< $IMAPObject->expunge_mailbox($IMAPFolder);
---
> $IMAPObject->expunge($IMAPFolder);

I needed Ignoresizeerrors in true, because our crappy Exchange server. It's working for me now.

Mike_B
Moderator
Posts: 266
Joined: 12 Jan 2010, 18:16
OTRS Version?: CVS HEAD

Re: OTRS and IMAP with certificate

Post by Mike_B » 02 Nov 2012, 17:51

Hi roko98, very nice, thanks for the patch.

I found it because someone pointed at it. In the future, if you would please, please also file this on http://bugs.otrs.org then we can make OTRS better for everyone! I would have liked to know about this patch months ago, so I could've integrated it in the product.

I've now addressed it in upcoming OTRS 3.1.12 and 3.2.0beta2.

Thanks and have a great weekend!
--
Mike
huntingbears.nl - @michielbeijen on Twitter

Post Reply