Page 1 of 1

anyone has updated POP3 library?

Posted: Wed Aug 08, 2012 5:15 pm
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"))
==!

Re: anyone has updated POP3 library?

Posted: Thu Aug 16, 2012 11:43 am
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

Re: anyone has updated POP3 library?

Posted: Wed Aug 29, 2012 6:49 am
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)
            )
    )
)