Page 1 of 3
Failed to connect to Exchange
Posted: 03 Feb 2015, 09:31
by horizn
Hi,
I am trying to configure EmailReporting plugin, but plugin is not able to log in to MS Exchange server:
Code: Select all
# /usr/bin/php /var/www/mantis/plugins/EmailReporting/scripts/bug_report_mail.php
Start checking all mailboxes: Tuesday 3rd of February 2015 09:21:50
Mailbox: Helpdesk
Message: Failed to connect to the mail server
Done checking all mailboxes
no matter which type of authentication has been chosen.
I think the problem is because our Exchange configuration. The only supported authentication type are Password, NTLM/SPA and GSSAPI.
I tried all available authentication types on EmailReporting plugin config but with no result.
Re: Failed to connect to Exchange
Posted: 03 Feb 2015, 17:04
by SL-Gundam
Then enable plaintext authentication
Also what version are you running of EmailReporting? Recently there have been modifications in IMAP for exchange. Before that IMAP for exchange servers was not functional
Authentication failure would not fail the connection in most situations, you should have had a login failure
Re: Failed to connect to Exchange
Posted: 04 Feb 2015, 09:05
by horizn
recent downloaded from GIT yesterday. I've tried PLAIN as well, however I'll try to check Exchange logs.
Re: Failed to connect to Exchange
Posted: 04 Feb 2015, 13:00
by SL-Gundam
i mend enable plaintext authentication on exchange.
I suggest testing the pop3 using telnet
http://support.microsoft.com/kb/187785
http://www.yuki-onna.co.uk/email/pop.html
Are you sure a firewall isn't blocking your connection?
Re: Failed to connect to Exchange
Posted: 05 Feb 2015, 13:39
by horizn
Hi,
We don't have POP support, only IMAP. However I've checked IMAP logs on CAS server and I found only:
Code: Select all
2015-02-05T13:34:44.779Z,0000000000000007,0,10.171.3.23:993,10.171.22.10:41420,,-2147483648,0,53,OpenSession,,
2015-02-05T13:34:44.795Z,0000000000000007,1,10.171.3.23:993,10.171.22.10:41420,,0,0,0,CloseSession,,
no matter what kind of authentication is used. I've tried domain\username, username@domain, username, etc. as login.
Re: Failed to connect to Exchange
Posted: 05 Feb 2015, 17:08
by SL-Gundam
Check the authentication settings on the IMAP service in exchange
It should be setup like this so that we can check things easier:
If needed we can enable secure logon later but first we need to get EmailReporting to work
Re: Failed to connect to Exchange
Posted: 10 Feb 2015, 14:04
by horizn
I've checked it on external mail server based on DoveCot/Exim, and it is not working with IMAP but it is working with POP3:
Code: Select all
Feb 10 14:57:21 lan dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=mantis_ip, lip=server_ip, TLS, session=<yK4LRLwOiwA+6Jw8>
Feb 10 14:58:47 lan dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=mantis_ip, lip=server_ip, TLS, session=<17MkSbwOlgA+6Jw8>
Feb 10 15:00:22 lan dovecot: pop3-login: Login: user=<mantis@domain>, method=PLAIN, rip=mantis_ip, lip=server_ip, mpid=8433, TLS, session=<oKzMTrwOCgA+6Jw8>
Feb 10 15:00:22 lan dovecot: pop3(mantis@domain): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
and how it looks when Thunderbird is used as a client:
Code: Select all
Feb 10 15:10:11 lan dovecot: imap-login: Login: user=<mantis@domain>, method=PLAIN, rip=mantis_ip, lip=server_ip, mpid=8518, TLS, session=<kuHrcbwO2gA+6Jw8>
Feb 10 15:10:12 lan dovecot: imap(mantis@domain): Disconnected: Logged out in=8 out=395
definitely is not a server problem.
Re: Failed to connect to Exchange
Posted: 10 Feb 2015, 16:32
by SL-Gundam
If you want to make sure it is not the server try using telnet towards the server. If that works without issues then EmailReporting should work as well. If EmailReporting does not work and telnet does then there is a problem with EmailReporting
POP3 - telnet
http://support.microsoft.com/kb/187785
http://www.yuki-onna.co.uk/email/pop.html
IMAP - telnet
http://support.microsoft.com/kb/189326
http://www.yuki-onna.co.uk/email/imap.html
telnet with IMAP might be a bit finicky.
While your trying that, please provide me with the mailbox configuration (ports, encryption stuff like that)
Re: Failed to connect to Exchange
Posted: 11 Feb 2015, 09:29
by horizn
So I've tried IMAP (no encryption) via telnet:
Code: Select all
* OK The Microsoft Exchange IMAP4 service is ready.
A login helpdesk@domain password
A OK LOGIN completed.
B select INBOX
* 1 EXISTS
* 0 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Perman
ent flags
* OK [UNSEEN 1] Is the first unseen message
* OK [UIDVALIDITY 344678] UIDVALIDITY value
* OK [UIDNEXT 5] The next unique identifier value
B OK [READ-WRITE] SELECT completed.
and using bug_report_mail.php (without encryption):
Code: Select all
php /var/www/mantis/plugins/EmailReporting/scripts/bug_report_mail.php
Start checking all mailboxes: Wednesday 11th of February 2015 09:26:49
Mailbox: Helpdesk
Location: Attempt login
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]
Done checking all mailboxes
Our exchange imap server is server.domain.com
our active directory domain is: domain
I can login to OWA using:
username@domain.com or domain\username and password.
brgds,
kamil
Re: Failed to connect to Exchange
Posted: 11 Feb 2015, 15:14
by SL-Gundam
Which version of Exchange are you using?
Could you provide the complete setup of the mailbox in EmailReporting? (debug dump or screenshot)
Do you have an installation of local pear packages? EmailReporting provides its own but local pear packages take precedence over the ones provided with EmailReporting
Re: Failed to connect to Exchange
Posted: 11 Feb 2015, 17:01
by horizn
SL-Gundam wrote:Which version of Exchange are you using?
Could you provide the complete setup of the mailbox in EmailReporting? (debug dump or screenshot)
Do you have an installation of local pear packages? EmailReporting provides its own but local pear packages take precedence over the ones provided with EmailReporting
Didn't know that. How can I check is it ok or not?
screenshot:

Re: Failed to connect to Exchange
Posted: 11 Feb 2015, 18:54
by SL-Gundam
alright what version of exchange do you have?
You would know if you had a local pear repository installed
Re: Failed to connect to Exchange
Posted: 13 Feb 2015, 09:51
by horizn
Exchange 2010. pear list:
Code: Select all
# pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Benchmark 1.2.8 stable
Console_Getopt 1.2.3 stable
Mail 1.2.0 stable
Mail_Mime 1.8.1 stable
Mail_mimeDecode 1.5.5 stable
Net_SMTP 1.6.0 stable
PEAR 1.9.1 stable
Structures_Graph 1.0.3 stable
XML_Util 1.2.1 stable
Re: Failed to connect to Exchange
Posted: 13 Feb 2015, 16:58
by SL-Gundam
I think everything should have worked. But it doesn't so... i'm stumped
The telnet tests you did towards imap, were they from the webserver where EmailReporting is running? or from another machine?
Have you tested the mailbox through the running of bug_report_mail.php and through using the mailbox test feature?
Re: Failed to connect to Exchange
Posted: 14 Feb 2015, 21:10
by SL-Gundam
If so, i am curious what the cause of the issue was