anyone has updated POP3 library?

Q&A's, tips, howto's
Locked
winger
Posts: 46
Joined: Wed Mar 14, 2012 7:31 am

anyone has updated POP3 library?

Post by winger »

Now it's not work even a simple login test.

Code: Select all

(print (POP3:get-mail-status ""user" "password" "my-isp.com"))
==!
Welcome to a newlisper home:)
http://www.cngrayhat.org

hotcore
Posts: 29
Joined: Fri Aug 26, 2011 1:03 pm

Re: anyone has updated POP3 library?

Post by hotcore »

I don't know anything about that library, but there is a syntax error in your statement: unbalanced double quotes. Maybe that is the problem?
/Arie

winger
Posts: 46
Joined: Wed Mar 14, 2012 7:31 am

Re: anyone has updated POP3 library?

Post by winger »

hotcore wrote:I don't know anything about that library, but there is a syntax error in your statement: unbalanced double quotes. Maybe that is the problem?
/Arie
--!
@hotcore
I just copied the original code on pop3.lsp.
hah.
I found several problems and fix them.
Now they can run at least.

code:
http://code.google.com/p/winger-newlisp ... s/pop3.lsp

and have a bug:

;package return from POP Server.
;00000000: 2B 4F 4B 20 0D 0A +OK ..

but
(net-receive socket status 256 "+OK ")
;(net-receive socket status 256 " ")
The entire function will wait indefinitely if the last stromg parameter to the end with a space.
A temporary solution is :

Code: Select all

:old code
(net-confirm-request)
(net-receive socket status 256)

;change to
(net-confirm-request)
;add follow code
(if (and (net-receive socket status 256) (= " " status))
 (net-receive socket status 256)
 status
)

;With a separate macro
(define-macro (net-receive_blank int_socket sym-buffer max-bytes wait-string)
    (letex (int_socket (eval int_socket)
            sym-buffer  sym-buffer
            max-bytes max-bytes
            )
            (if (and (net-receive int_socket sym-buffer max-bytes) (= " " sym-buffer))
                (net-receive  int_socket sym-buffer  max-bytes)
            )
    )
)
Welcome to a newlisper home:)
http://www.cngrayhat.org

Locked