4D and Exchange Server with IMAP

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

4D and Exchange Server with IMAP

4D Tech mailing list
Did anyone ever get the IMAP_Login to work with MS Exchange server?

When I connect with IMAP_Login I get either a 10061 or a 10064 (connection time out or reset) but when I connect to the same machine and port with TCP_Open I get a valid connection and a response:

"* OK The Microsoft Exchange IMAP4 service is ready"

It seems the IMAP_Login doesn't work with MS Exchange.

Neil









--

Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

4D Tech mailing list
Hi Neil,

Which port are you connecting to? SSL? Is it set using IT_SetPort?

If you are using and older version of 4DIC, then you may need to make sure the password does not contain any special characters (such as & or *).

-Tim



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

4D Tech mailing list
> Which port are you connecting to? SSL? Is it set using IT_SetPort?

I don't specify the port with IT_SetPort, I let IMAP_Login pick the port depending on the SSL flag. I have confirmed that IMAP_Login is using port 143 for clear connection and 993 for SSL/TLS connections.

When I test with TCP_Open("host";143;$id;0) I get a valid connection with the welcome message
When I test with IMAP_Login("host";"username";"password";$id;0) I get a n error

I'm using the 4DIC that came with 4D v15. I'm assuming it is a newer version... however I just tried with a password that has no special chars and it did not change the behavior.

Neil






--



Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

4D Tech mailing list
Hi Neil,

I just tried this with our corporate exchange server:

C_LONGINT(vImap_ID)
C_TEXT(vHost;vUserName;vUserPassword)
vHost:="exchange.notmyactualserver.com"
vUserName:="[hidden email]"
vUserPassword:="notmyactualpassword"
vImap_ID:=0
IT_SetPort (14;993)
$ErrorNum:=IMAP_Login (vHost;vUserName;vUserPassword;vImap_ID;1)
TRACE

Using either the correct or incorrect password, and specifying the last parameter as 0 ("do not use SSL"), I get 10064 in the $ErrorNum variable after the timeout.

Using the correct password, and specifying the last parameter as 1 ("use SSL"), this works.
^By works, I mean the command completes within 2 seconds, $ErrorNum is 0, and vImap_ID is 1

I used 4D v16.1 (32 bit) on Windows 10 for my test.

Regarding the 10064 timeout error after the timeout:
1) the client side timeout can be set using  IT_SetTimeOut(seconds).
2) the server is likely configured to not respond to invalid login requests, as a security hardening option. This makes it take longer to brute force someone's account.

I hope this helps!

-Tim



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: 4D and Exchange Server with IMAP

4D Tech mailing list
> Using the correct password, and specifying the last parameter as 1 ("use SSL"), this works.
> ^By works, I mean the command completes within 2 seconds, $ErrorNum is 0, and vImap_ID is 1

Thanks, good to know.

I will double check the password, but I’m pretty sure it was OK as I tried a couple of them.


Neil
--
Neil Dennis
4D Developer since 1990

GreaText - Designing Software for the Way You Work
716 East 1850 N
North Ogden, UT 84414

mailto:[hidden email]
http://www.greatext.com/


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

Paul Dennis
In reply to this post by 4D Tech mailing list
Tim,

I cant get this to work either error 10061 or 10064. SMTP works fine. Can you confirm if you are using domain\username or email address to login  as per http://kb.4d.com/assetid=76712  On the exchange (2013) side imap settings are you able to confirm the login options have selected ? I get a connection but then its closed.
Thanks
Paul
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

Paul Dennis
For reference if anyone else is getting 10061 errors the issuse is exchnage. Follow this blog

http://danblee.com/exchange-2013-test-imap-connectivity/

make sure imap.proxy is healthy then connect on port 993 with ssl
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

4D Tech mailing list
In reply to this post by Paul Dennis
Paul

I'm seeing the same thing, I use domain\username as the user name. I have verified at a low level that the IMAP_Login opens a connection to the exchange server (It looks like the client and server are talking). But IMAP_Login returns an error anyway.

I have not found a solution yet.

Neil






--

Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

4D Tech mailing list
Hi,

> I'm seeing the same thing, I use domain\username as the user name.

I used [hidden email] format and it worked for me.

If you are using domain\user then make sure to escape the \ like this:
Domain\\User

Let me know if that helps,

-Tim




**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

Paul Dennis
I am just using username not domain\username but I think this is something to do with exchange setup. What error are you getting ? 10061 is the imap proxy whereas 10064 is auth. Can you telnet to port 993 ?
Reply | Threaded
Open this post in threaded view
|

RE: 4D and Exchange Server with IMAP

4dialog
In reply to this post by 4D Tech mailing list
A shot in the dark - what happends if you change the LOCAL $id to a global var vID?
Hilsen
--------------------------------------
Helge Antonsen
4Dialog as
Tel: +47 64 000 164
Mob: +47 90 15 56 19
Web: www.4dialog.no