Hi, i have just finish the hard work to adding ssl support!!!
this is what i have make:
-
of corse remove indy and install indy v10.1.5 (not simple for me but ok).
http://www.vcorp.it/downloads/indy10.1.5_d7.exe
-
chek the source and add the right new variable for save / load from ini the new value added. in (UConfig.pas and UData.pas).
########UConfig changes##################
TPopAccount = Record
server: String;
user: String;
pword: String;
port_ssl: String; <----------
end;
function TConfig.loadCCFG: Boolean;
var
initfile: textfile;
x, y: Integer;
configline: String;
configArray: Array[1..101] of String; <------
begin
pop[1].server := copy(configArray[95], 1, pos('?0', configArray[95])-1);
pop[1].user := copy(configArray[96], 1, pos('?0', configArray[96])-1);
pop[1].pword := copy(configArray[97], 1, pos('?0', configArray[97])-1);
pop[1].port_ssl := copy(configArray[101], 1, pos('?0', configArray[101])-1); <-----
etc...
// Pop accounts
for x := 0 to 9 do
begin
sPOPAccount := Format('%.2u', [x], localeFormat);
pop[x].server := initFile.ReadString('POP Accounts', 'Server' + sPOPAccount, '');
pop[x].user := initFile.ReadString('POP Accounts', 'User' + sPOPAccount, '');
pop[x].pword := initFile.ReadString('POP Accounts', 'Password' + sPOPAccount, '');
pop[x].port_ssl := initFile.ReadString('POP Accounts', 'Port_ssl' + sPOPAccount, '');
end; <------
// Pop accounts
for x := 0 to 9 do
begin
sPOPAccount := Format('%.2u', [x], localeFormat);
initFile.WriteString('POP Accounts', 'Server' + sPOPAccount, pop[x].server);
initFile.WriteString('POP Accounts', 'User' + sPOPAccount, '"' + pop[x].user + '"');
initFile.WriteString('POP Accounts', 'Password' + sPOPAccount, '"' + pop[x].pword + '"');
initFile.WriteString('POP Accounts', 'Port_ssl' + sPOPAccount, pop[x].port_ssl);
end; <-----
########END UConfig changes##################
-
increment form 100 to 101 in "UConfig.pas" configarray and add new entry fo ssl
-
add Edit20.tex and ssl label in "USetup.pas/form"
-
add 2 dll for indy10 ver in the same place of exe project:
ssleay32.dll
libeay32.dll
http://www.vcorp.it/downloads/indy_OpenSSL096m.zip
P.S.
with indy10 some little changes for incompatibility are necesary!!!
i have added in uses the ssl component in UData.pas
######UDATA CHANGES########
IdBaseComponent,
IdComponent, IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase,
IdMessageClient, IdPOP3, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack,
IdSSL, IdSSLOpenSSL
// Runs in data thread controllo email
procedure TData.emailUpdate;
var
mailz: Array[0..9] of Integer;
z, y, x: Integer;
screenline: String;
pop3: TIdPOP3;
//aggiunto per controllo ssl INDY v10.1.5
SSLHandler: TIdSSLIOHandlerSocketOpenSSL; <--------
msg: TIdMessage;
myGotEmail: Boolean;
messages: Integer;
begin
.....
if config.pop[y].server <> '' then
begin
pop3 := TIdPOP3.Create(nil);
// controllo ssl by vcorp aggiunto il 25/02/2006
SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
SSLHandler.MaxLineAction := maException;
SSLHandler.Host := config.pop[y].server;
SSLHandler.ConnectTimeout := 30000;
SSLHandler.SSLOptions.Method := sslvSSLv2;
SSLHandler.SSLOptions.Mode := sslmUnassigned;
SSLHandler.SSLOptions.VerifyMode := [];
SSLHandler.SSLOptions.VerifyDepth := 0;
msg := TIdMessage.Create(nil);
pop3.host := config.pop[y].server;
// pop3.MaxLineAction := maSplit;
pop3.ReadTimeout := 15000; //15 seconds
pop3.username := config.pop[y].user;
pop3.Password := config.pop[y].pword;
// controllo ssl by vcorp aggiunto il 25/02/2006
if config.pop[y].port_ssl <> ''
then begin
pop3.IOHandler := SSLHandler;
pop3.UseTLS := utUseImplicitTLS;
pop3.Port := StrToInt(config.pop[y].port_ssl);
SSLHandler.Port := StrToInt(config.pop[y].port_ssl);
SSLHandler.Host := config.pop[y].server;
SSLHandler.Destination := SSLHandler.Host+':'+IntToStr(SSLHandler.Port);
// SSLHandler.StartSSL;
end else
begin
pop3.IOHandler := nil;
pop3.UseTLS := utNoTLSSupport;
pop3.Port := 110;
end;
....
i have change this
// pop3.Connect(30000); // 30 seconds
with this
pop3.ConnectTimeout := 30000;
....
finally
httpCs.Enter();
pop3Copy := nil;
httpCs.Leave();
pop3.Disconnect;
pop3.Free;
SSLHandler.Free; <---------
msg.Free;
end;
--------------------
and just for test when the KS0073 code are ready
make some change in "USetup"
Wow now i can see how mail i have for each account!!!
SORRY FOR MY BAD ENGLISH