source download pop3.lsp
Module: pop3.lsp
POP3 mail retrieval routines
Version: 2.0 - eliminated old net-send syntax
Version: 2.1 - changes for 10.0
Version: 2.3 - three fixes by winger 2012-08-29 (search: winger's fix)
Author: Lutz Mueller et al., 2001, 2002, 2008, 2010, 2012
POP3 mail retrieval routines
Only the module pop3.lsp is required, not other libraries need to be present. Not all mailservers support all functions.
To use the module put a load statement at the top of your file:(load "/usr/share/newlisp/modules/pop3.lsp") ; or shorter (module "pop3")
Function overview
Load down all messages and put them in a directory messages/:(POP3:get-all-mail "user" "password" "pop.my-isp.com" "messages/")Load down only new messages:(POP3:get-new-mail "user" "password" "pop.my-isp.com" "messages/")Delete messages, which have not been read:(POP3:delete-old-mail "user" "password" "pop.my-isp.com")Delete all messages:(POP3:delete-all-mail "user" "password" "pop.my-isp.com")Get a list of status numbers (totalMessages, totalBytes, lastRead):(POP3:get-mail-status "user" "password" "pop.my-isp.com")Get error message for failed all/new/status function:(POP3:get-error-text)All functions return nil on error and POP3:get-error-text can be used to retrieve the error text.
The variable POP3:debug-flag can be set to true to display all of the dialog with the pop2 mail server.§
POP3:get-all-mail
syntax: (POP3:get-all-mail str-user str-password str-server str-dir)
parameter: str-user - The user ID.
parameter: str-password - The password for the user ID.
parameter: str-dir - The local directory for the retrieved mail.
return: On success true else nil.
§
POP3:get-new-mail
syntax: (POP3:get-new-mail str-user str-password str-server str-dir)
parameter: str-user - The user ID.
parameter: str-password - The password for the user ID.
parameter: str-dir - The local directory for the retrieved mail.
return: On success returns true else nil.
On failure use POP3:get-error-text to retrieve the text of the last error which occured.§
POP3:get-mail-status
syntax: (POP3:get-mail-status str-user str-password str-server)
parameter: str-user - The user ID.
parameter: str-password - The password for the user ID.
return: A list of status information.
The list of status information returned contains the following items: (totalMessages, totalBytes, lastRead)§
POP3:delete-old-mail
syntax: (POP3:delete-old-mail str-user str-password str-server)
parameter: str-user - The user ID.
parameter: str-password - The password for the user ID.
return: The number of messages left on the server.
§
POP3:delete-all-mail
syntax: (POP3:delete-all-mail str-user str-password str-server)
parameter: str-user - The user ID.
parameter: str-password - The password for the user ID.
return: The number of the message last read.
§
POP3:get-error-text
syntax: (POP3:get-error-text)
return: The text of the last error occurred.
- ∂ -
generated with newLISP and newLISPdoc