Re: Check Pop3 or IMAP4



Il giorno Wed, 17 Sep 2008 19:50:04 -0700, "TDM" <rpuffd@xxxxxxxxx> ha scritto:
It sounds like you at least know the POP protocol. If I was tasked with
this, I would use the .Exec method to telnet to the POP server via port
110, then use StdIn and StdOut to process the POP commands and
resulting output. This may not be doable(not sure if that is really a word),
but that is the approach I would take to see if it is possible.

I read somewhere that telnet does not support stdin and stdout. But never tried.
A post in this newsgroup (22 october 2003) used sendkeys to automate telnet.

I used NetCat (NC.exe, a 50 kb file) to send commands to the port 110.
With netcat I build a command to invoke the command and then redirect input and output.
I tried to read the stdin but encountered some errors (if I remember well, read past the
end of file). Maybe I had to wait for a while until the output was created.
I didn't use this script anymore as my provider implemented a spam killer application.

This works only if the server doesn't require the encoding of the password, as the string
provided by the server for the encoding cannot be read dynamically while the connection is
open. It could be done using stdin and stdout.


Title="PopMail - Cenati"
set wshShell = CreateObject("WScript.Shell")
' Crea l'oggetto FileSystemObject
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Const ForWriting = 2

'User="Ci@xxxxxxxxxxxx"
'Password="x"
'Server="pop.y.com"

fso.CreateTextFile "command.txt",true
Set txtStream=fso.OpenTextFile("command.txt",ForWriting)
TxtStream.WriteLine "user " & user
TxtStream.WriteLine "pass " & password
TxtStream.WriteLine "stat"
TxtStream.WriteLine "quit"
txtStream.Close

wshShell.run "%comspec% /C nc.exe " & server & " 110 <command.txt >output.txt",7,true

Set oFile = fso.OpenTextFile("output.txt")
testo = oFile.ReadAll
oFile.Close
msgbox testo

--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
.



Relevant Pages

  • Re: man-in-the-middle translation of input
    ... program that spawns the game, forwards its output to stdout, reads my input ... replaces my input by a series of valid game commands. ... write to stdout, I couldn't find a way to read from stdin, preprocess the ... input and feed it through a pipe to the child. ...
    (comp.unix.programmer)
  • POSIX-ANSI equivalent?
    ... write(1, buffer, len); ... but the program (started by a server) doesn't work. ... stdout. ... practice, it would seem that on readstdin is redirected ...
    (comp.lang.c)
  • interaction with server-side c++ program
    ... with stdin and stdout. ... I want to change it to run from a server, ... whole program to a web scripting language. ...
    (comp.lang.javascript)
  • popen, Pipes with programs that expect user input
    ... I am writing a terminal server client-server application, ... but I encounter a problem with commands ... """Executes a command and returns a tuple (stdin, ... I don't know what to write to STDIN before I see what STDOUT ...
    (comp.lang.python)
  • Re: Getting output from external programs...
    ... from commands import getoutput ... import popen2 ... (stdOut, stdIn) ...
    (comp.lang.python)

Loading