Jump to content
Sign in to follow this  
Fox2

mikeytown2's POP_ssl

Recommended Posts

Fox2

I've got mikeytown's POP_ssl_V2.au3 and also for good measure the email checker mentioned in the thread "check your gmail" and Apzo's POP3 functions.

Kudos for writing these (though it's a while back, they're still good!). But I'm a bit unsure how the first two are intended to work together to do basic pop via ssl.

I have a request, could someone here add a /really/ basic simple example script showing their use.

So for example:

Log onto gmail pop3; loop (collect an email/ConsoleWrite it/delete from server); close connection

I'm trying to work out their use but without an example (even "bare bones" with hard coded account/pw/server/port) it's tricky.

Many thanks

Edited by Fox2

Share this post


Link to post
Share on other sites
Fox2

Ah, seems to be semi-working, I have some kind of SSL lock.

Whats happened...

1st run worked fine

2nd run onwards it seems the process hasn't released all the resources/hooks/whatevers it should have, because Outlook POP3 isn't working, and I'm getting what someone else reported of "only 1/2 the text appearing in the trace window.

Basically works, just got to debug that last part :)

Share this post


Link to post
Share on other sites
dryan

Could you post what you have then? I've been unsuccessful at using those scripts to download mail from gmail.

Edit: POP_ssl_V2.au3 seems to get stuck on Line 119: Sleep(50)

Edited by dryan

Share this post


Link to post
Share on other sites
Fox2

Could you post what you have then? I've been unsuccessful at using those scripts to download mail from gmail.

Edit: POP_ssl_V2.au3 seems to get stuck on Line 119: Sleep(50)

I don't "have" anything.. it worked for me to a point enough to prove the concept but not fully. Testing if I can do more..... may be able to, may not.

Share this post


Link to post
Share on other sites
Fox2

Update - I've managed to get it (somewhat) to work for me... I'm going to try and shuffle around some of mikeytown's code into a format that's more directly usable than the proof of concept.

If I get to the point that gmail etc work reasonably for me, I'll post up the code so others can take it further and maybe merge it into the main POP3 UDF.

Share this post


Link to post
Share on other sites
Fox2

I've got Mikeytown's gmail pop3 working mostly, but also, I have switched from openssl.org to the cygwin version.

Mikeytown's script noted that the first input was not accepted other than from the keyboard. I referred to this post:

#161734

which says this is a bug in that compilation of openssl and if needed use cygwin's compilation of openssl instead. I modified the code on that page to use pop3 instead of smtp, which was surprisingly easy.

How to do it:

You will need the cygwin DLL files which can be downloaded from their website and then unzipped. The above post doesn't tell you completely; this is what I found out:

You want to get hold of the /bin folder from cygwin (containing openssl.exe, cygssl-0.9.8.dll, cygcrypto-0.9.8.dll, c_rehash). You dont need to install them - download and unzip the openssl part of cygwin. You will also need to find somewhere the file cygwin1.dll (google and download) and put that in the same folder if not included (openssl.exe uses this).

Then grab the AutoIt code for cygwin SMTP from the above post, and modify it to start:

$EmailUsername = "myemail" ;if your email is myemail@gmail.com, use "myemail"
$EmailPassword = "mypassword"; enter your password
$SmtpServer = "pop.gmail.com"
$SmtpPort = "995"
; Must use Cygwin OpenSSL in order to implement stdin automation; the Windows build has a bug which makes StdinWrite() fail.
$OpensslPath = '"' & @ScriptDir & '\openssl.exe" s_client -quiet -connect ' & $SmtpServer & ':' & $SmtpPort
$WorkingDir = @ScriptDir

Dim $Conditions[9], $Actions[9]

$Conditions[0] = '+OK'
$Actions[0] = "USER " & $EmailUsername

$Conditions[1] = '+OK'
$Actions[1] = "PASS " & $EmailPassword

$Conditions[2] = '+OK'
$Actions[2] = "STAT"

$Conditions[3] = '+OK'
$Actions[3] = "RETR 1"

$Conditions[4] = '.'
$Actions[4] = "QUIT"

I'm working on it and plan to get it a little better for UDF style usage. For example it does not retrieve the whole message, nor check for buffer being empty before issuing the next command. I'll see what I can do, but figured others might like this alternative code

Edited by Fox2

Share this post


Link to post
Share on other sites
Fox2

YAY -- got round the 64k buffer limit and "string stopped being received 1/2 way" errors. I just managed to collect a 300k email I was testing with.

I do believe we're going to get Gmail POP3 tamed to more than "proof of concept".....

Edited by Fox2

Share this post


Link to post
Share on other sites
Delta

Tried your method and nothing happens. When you show the window openssl just opens up and shows a blank screen.


[size="1"]Please stop confusing "how to" with "how do"[/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×