delphi - Pascal Synapse error handling -


i have code written in lazarus/freepascal uses synapse imapsend library unit. attempt login imap server on ssl (imaps) call login fails.

i've tried checking exceptions - none thrown.

wireshark shows nothing beyond tcp three-way handshake appropriate server , port.

here's code

function getimapresponse(host, port, user, pass:string): string; var   response: string = '';   imap: timapsend;   no_unseen: integer; begin   imap := timapsend.create;   try     imap.targethost := host;  //'10.0.0.16';     imap.targetport := port;  //'993';     imap.username := user;    //'red';     imap.password := pass;    //'********';     imap.autotls := false;     imap.fullssl := true;     response := response + 'imap login '+user+'@'+host+':'+port+' ... ';     if imap.login     begin       response := response + 'logged in ok. ';       // how many unseen?       no_unseen := imap.statusfolder('inbox','unseen');       form1.label2.caption := inttostr(no_unseen);       response := 'inbox contains ' +  inttostr(no_unseen) + ' unseen messages. ';     end     else     begin       response := response + 'imap login failed. ';     end;   except     on e: exception     begin       response := response + 'exception: ' + e.message;       showmessage(response);     end;   end;   {       imap.free;     response := response + 'finally. ';   end;   }   result := response; end;                

here's string result of function

imap login red@10.0.0.16:993 ... imap login failed.  

question: there way see details of imapsend thinks happened?


update 1

as shown in simawb's answer plus comments arioch 'the

  mysynadebug := tsynadebug.create;   imap.sock.onstatus := @mysynadebug.hookstatus;   imap.sock.onmonitor := @mysynadebug.hookmonitor;  

produced projectname.slog file containing

20130722-103643.605 0011f230hr_socketclose:  20130722-103643.609 0011f230hr_resolvingbegin: 10.0.0.16:993 20130722-103643.620 0011f230hr_resolvingend: 10.0.0.16:993 20130722-103643.623 0011f230hr_socketcreate: ipv4 20130722-103643.628 0011f230hr_connect: 10.0.0.16:993 20130722-103643.631 0011f230hr_error: 10091,ssl/tls support not compiled! 

so moving forward :-)

i have libssl32.dll , libeay32.dll in project folder check have right versions , have done right things chicken entrails.


update 2:

i using 64-bit version of lazarus. openssl dlls 32-bit dlls synapse's ssl_openssl unit loads dynamically. installed 32-bit version of lazarus/fpc , imap/ssl client program compiles , works expected.

it seems current 64-bit lazarus/fpc binary distribution (v1.0.10/2.6.2) cannot cross-compile i386 (which think might have helped).

did try synadbg unit of synapse?

imap := timapsend.create; imap.sock.onstatus := tsynadebug.hookstatus; imap.sock.onmonitor := tsynadebug.hookmonitor; 

then application create log file extension '.slog'. may can find more details in log file.


Comments