mIRC Home    About    Download    Register    News    Help

Print Thread
#226361 28/09/10 06:01 PM
Joined: Sep 2010
Posts: 1
D
Mostly harmless
OP Offline
Mostly harmless
D
Joined: Sep 2010
Posts: 1
Im trying to connect to gmail by pop3...

But socket not reading anything, tried several scripts to read emails and none is working.
but Sockread is working on webpages )port 80)

alias /Email {
.sockclose mail
.timer 1 3 .sockopen mail pop.gmail.com 995
}

ON *:SOCKOPEN:mail: {
.echo Open!
}
ON *:SOCKREAD:mail: {
if ($sockerr) { echo -s Error! | return }
var %mail.data
.sockread %mail.data
.echo -s %mail.data
}
ON *:SOCKCLOSE:mail: {
.echo -s Closed!
}

with echo i only get:
Open!
Closed!

Why sockread not working?

Last edited by DarknessEyes; 28/09/10 06:04 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I've never trying socketing emails, but generally you have to send specific header information when socketing things. This is done in the sockopen event.


Invision Support
#Invision on irc.irchighway.net
Joined: Nov 2009
Posts: 81
V
Babel fish
Offline
Babel fish
V
Joined: Nov 2009
Posts: 81
sockopen -e pop.gmail.com 995 because gmail using SSL, you also must install OpenSSL, check: //echo -a $sslready

Joined: Aug 2010
Posts: 69
N
Babel fish
Offline
Babel fish
N
Joined: Aug 2010
Posts: 69
Well one thing I've noticed is on your on *:SOCKOPEN: event you need to add the proper header information in that event. Your on *:SOCKREAD event will not return anything if you don't input the proper infomation in the on *:SOCKOPEN event.

i.e.

NOTE that <info here> is only a example, and is not a suitable form to enter when using the GET syntax in sockets.

Example of sockwrite GET
Code:
sockwrite -n $sockname GET /search/info=This+is+a+search HTTP/1.1


It helps so set a variable in the calling alias with the GET information and use the variable in the <info here> slot.

Code:
on *:SOCKOPEN:mail: {
  sockwrite -n $sockname GET <info here> HTTP/1.1
  sockwrite -n $sockname Host: pop.gmail.com
  sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname Content-Type: text/html
  sockwrite -n $sockname $crlf 
  echo Open!
}


Or something of that design. You need to figure out how gmail works with the sockets first. But using something similiar to above, your sockread event just might return something.

try:
/help sockets

You also do not need the . prefix in this script. The "." prefix is for halt default text on a command. In a script if you did

Code:
.nick Speedo_Torpedo

;or for another example...:

.fullname King Salami


You would not see the "You are now known as Speedo-Torpedo." no text will pop up. Same with the /fullname command. To execute a command quietly outside of a script use //.command


"There is no theory of evolution, only a list of creatures Chuck Norris allows to live."

Link Copied to Clipboard