NAME

       pop3 - Tcl client for POP3 email protocol


SYNOPSIS

       package require pop3 ?1.0?

       ::pop3::open host user Ipassword ?port?

       ::pop3::status chan

       ::pop3::last chan

       ::pop3::retrieve chan startIndex ?endIndex?

       ::pop3::delete chan startIndex ?endIndex?

       ::pop3::list chan ?msg?

       ::pop3::top chan msg n

       ::pop3::close chan

_________________________________________________________________


DESCRIPTION

       The pop3 package provides a simple Tcl-only client library
       for the POP3 email protocol (RFC1939). It works by opening
       the  standard  POP3 socket on the server, transmitting the
       username and password, then providing a Tcl API to  access
       the   POP3  protocol  commands.   All  server  errors  are
       returned as Tcl errors (thrown) which must be caught  with
       the Tcl catch command.


COMMANDS

       ::pop3::open host username password ?port?
              Open a socket connection to the server specified by
              host, transmit the username and password  as  login
              information to the server.  The default port number
              is 110, which can be overridden using the  optional
              port  argument.  The return value is a channel used
              by all of the other ::pop3 functions.

       ::pop3::status chan
              Query the server for the status of the mail  spool.
              The  status  is  returned  as a list containing two
              elements, the first is the number of email messages
              on  the  server  and  the  second  is  the size (in
              octets, 8 byte blocks) of the entire mail spool.

       ::pop3::last chan
              Query the server for the last  email  message  read
              from  the  spool.  This value includes all messages

              account.   This command may not be supported by the
              email server, in which case the server may return 0
              or an error.

       ::pop3::retrieve chan startIndex ?endIndex
              Retrieve  a  range of messages from the server.  If
              the endIndex is not  specified,  only  one  message
              will be retrieved.  The return value is a list con­
              taining each message as a  separate  element.   See
              the startIndex and endIndex descriptions below.

       ::pop3::delete chan startIndex ?endIndex
              Delete a range of messages from the server.  If the
              endIndex is not specified, only one message will be
              deleted.   Note,  the  indices are not reordered on
              the server, so if you delete message  1,  then  the
              first  message  in  the queue is message 2 (message
              index 1 is no longer valid).   See  the  startIndex
              and endIndex descriptions below.

       startIndex
              The  startIndex  may be an index of a specific mes­
              sage starting with the index 1, or it have  any  of
              the following values:

              start  This  is  a logical value for the first mes­
                     sage in the spool, equivalent to  the  value
                     1.

              next   The  message  immediately following the last
                     message read, see ::pop3::last.

              end    The most recent message in  the  spool  (the
                     end  of  the  spool).   This  is  useful  to
                     retrieve only the most recent message.

       endIndex
              The endIndex is an optional parameter and  defaults
              to  the  value -1, which indicates to only retrieve
              the one message specified by startIndex.  If speci­
              fied,  it  may  be  an  index of a specific message
              starting with the index 1, or it have  any  of  the
              following values:

              last   The  message  is  the last message read by a
                     POP3 client, see ::pop3::last.

              end    The most recent message in  the  spool  (the
                     end of the spool).

       ::pop3::list chan ?msg?
              Returns the scan listing of the mailbox. If parame­
              ter msg is given, then the listing  only  for  that


       ::pop3::top chan msg n
              Optional  POP3 command, all servers may not support
              this.  ::pop3::top retrieves headers of a  message,
              specified  by  parameter msg, and number of n lines
              from the message body.

       ::pop3::close chan
              Gracefully close the connect after sending  a  POP3
              QUIT command down the socket.


KEYWORDS

       mail, email, pop, pop3, RFC1939


Man(1) output converted with man2html