您的位置:首页 > 大数据 > 人工智能

Indy 10 POP3 against MS Exchange 2010?

2016-02-06 12:09 302 查看
Q:

My company has changed email server to Exchange 2010 from and older version of Exchange. Now a number of my utility programs no longer work.... They were programmed many years ago using Delphi7 and an
earlier version of Indy (probably Indy 9). Since then they have been running as scheduled tasks on a server in the local network without problem. What they do is that they read messages from an account and process these. They retrieve the messages using POP3
with authentication (user/password). Now after the switch to Exchange 2010 they no longer can log into the POP3 account. And it seems like we have to set our Outlook POP3 mail clients to both use the Secure Password Authentication (whatever this means) and
also use SSL and the nonstandard port 995. What do I need to modifiy/update to get the conection to work again? Specifically concerning the SPA password handling???

A:

Attach a TIdSSLIOHandlerSocketOpenSSL component to the IOHandler property, set the TIdSMTP.Port property to 995, set the TIdSMTP.AuthType property to satSASL, and add a TIdSASLNTLM component (linked to
a TIdUserPassProvider component) to the TIdSMTP.SASLMechanisms collection.

Q:

Thanks, I will try this for the SMTP sending part. But what about POP3 retrieval? I am using TIdPop3 for that (with Indy 9). I once wrote another application for light-weight checking email (my personal
accounts) where I also used TIdPop3. Later (2009) I found that in order to read mail headers from Gmail I had to add SSL support and this required using a couple of external dll:s (libeay32.dll and ssleay32.dll) since the SSL functionality was not built into
Indy at that time. Has this changed so that I can create a self-contained application with SSL capability without having to use these dll:s?? Exchange 2010 is now requiring SSL for POP3

A:

Sorry, my bad. I meant TIdPOP3 instead of TIdSMTP. Everything I said applies to TIdPOP3 and TIdSMTP equally, though

.> I am using TIdPop3 for that (with Indy 9).

Then you are out of luck, because Indy 9 did not support SASL-based authentications. You need to use Indy 10 for that.

> I once wrote another application for light-weight checking email

> (my personal accounts) where I also used TIdPop3.> Later (2009) I found that in order to read mail headers from Gmail

> I had to add SSL support and this required using a couple of external

> dll:s (libeay32.dll and ssleay32.dll) since the SSL functionality was

> not built into Indy at that time.

> Has this changed so that I can create a self-contained application

> with SSL capability without having to use these dll:s??

The OpenSSL-based IOHandler still uses the DLLs. If you want a self-contained executable, then you cannot use OpenSSL. You wil have to write your own (or find a third-party) IOHandler implementation that
is not dependant on external dependancies, or at least uses a cryptography API that is built into the OS. 

Q:

Can I do as follows in the startup of my program: 

IdGetMail := TIdPop3.Create(NIL);

IdGetMail.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create;

Q:

I.e. Can I refrain from creating a variable to hold the handler instance: 

A:

Technically yes, however you usually need to assign values to the IOHandler's properties, so you would need a local variable at least, unless you use a 'with' statement to access the instance without
a variable.

IdGetMail := TIdPop3.Create(NIL);

SslHandler := TIdSSLIOHandlerSocketOpenSSL.Create;

IdGetMail.IOHandler := SslHandler;


Will there be a memory leak if I don't explicitly free the IOHandler????

A:

Yes. You can assign the TIdPOP3 as the Owner in that situation, eg: {code:delphi} IdGetMail.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(IdGetMail); {code}

Update: Will this ensure that the IOHandler gets destroyed when the TIdPop3 opject is? (Setting the owner to the component which property is set): 

IdGetMail := TIdPop3.Create(NIL);

IdGetMail.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(IdGetMail);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: