1pop3d(n)                    Tcl POP3 Server Package                   pop3d(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       pop3d - Tcl POP3 server implementation
9

SYNOPSIS

11       package require Tcl  8.3
12
13       package require pop3d  ?1.1.0?
14
15       ::pop3d::new ?serverName?
16
17       serverName option ?arg arg ...?
18
19       serverName up
20
21       serverName down
22
23       serverName destroy ?mode?
24
25       serverName configure
26
27       serverName configure -option
28
29       serverName configure -option value...
30
31       serverName cget -option
32
33       serverName conn list
34
35       serverName conn state id
36
37       authCmd exists name
38
39       authCmd lookup name
40
41       storageCmd dele mbox msgList
42
43       storageCmd lock mbox
44
45       storageCmd unlock mbox
46
47       storageCmd size mbox ?msgId?
48
49       storageCmd stat mbox
50
51       storageCmd get mbox msgId
52
53_________________________________________________________________
54

DESCRIPTION

56       ::pop3d::new ?serverName?
57              This  command  creates  a  new  server object with an associated
58              global Tcl command whose name is serverName.
59
60       The command serverName may be used to invoke various operations on  the
61       server.  It has the following general form:
62
63       serverName option ?arg arg ...?
64              Option and the args determine the exact behavior of the command.
65
66       A  pop3 server can be started on any port the caller has permission for
67       from the operating system. The default port will be 110, which  is  the
68       port defined by the standard specified in RFC 1939 (http://www.rfc-edi
69       tor.org/rfc/rfc1939.txt).  After creating, configuring and  starting  a
70       the  server  object will listen for and accept connections on that port
71       and handle them according to the POP3 protocol.
72
73       Note: The server provided by this module will  handle  only  the  basic
74       protocol  by  itself.  For the higher levels of user authentication and
75       handling of the actual mailbox contents callbacks will be invoked.
76
77       The following commands are possible for server objects:
78
79       serverName up
80              After this call the server will listen for  connections  on  its
81              configured port.
82
83       serverName down
84              After  this call the server will stop listening for connections.
85              This does not affect existing connections.
86
87       serverName destroy ?mode?
88              Destroys the server object. Currently open connections are  han‐
89              dled depending on the chosen mode.  The provided modes are:
90
91              kill   Destroys  the  server  immediately, and forcefully closes
92                     all currently open connections. This is the default mode.
93
94              defer  Stops the server from accepting new connections and  will
95                     actually  destroy it only after the last of the currently
96                     open connections for the server is closed.
97
98       serverName configure
99              Returns a list containing all options and their  current  values
100              in  a  format  suitable  for  use  by the command array set. The
101              options themselves are described in section OPTIONS.
102
103       serverName configure -option
104              Returns the current value of the specified option.  This  is  an
105              alias  for the method cget. The options themselves are described
106              in section OPTIONS.
107
108       serverName configure -option value...
109              Sets the specified option to the  provided  value.  The  options
110              themselves are described in section OPTIONS.
111
112       serverName cget -option
113              Returns  the  current value of the specified option. The options
114              themselves are described in section OPTIONS.
115
116       serverName conn list
117              Returns a list containing the ids of all  connections  currently
118              open.
119
120       serverName conn state id
121              Returns  a list suitable for [array set] containing the state of
122              the connection referenced by id.
123

OPTIONS

125       The following options are available to pop3 server objects.
126
127       -port port
128              Defines the port to listen on for new  connections.  Default  is
129              110.  This  option  is  a bit special. If port is set to "0" the
130              server, or rather the operating system, will select a free  port
131              on  its own. When querying -port the id of this chosen port will
132              be returned. Changing the port while the server is up will  nei‐
133              ther change the returned value, nor will it change on which port
134              the server is listening on. Only after resetting the server  via
135              a  call  to down followed by a call to up will the new port take
136              effect. It is at that time that the value returned when querying
137              -port will change too.
138
139       -auth command
140              Defines  a command prefix to call whenever the authentication of
141              a user is required. If no such command is specified  the  server
142              will reject all users. The interface which has to be provided by
143              the command prefix is described in section AUTHENTICATION.
144
145       -storage command
146              Defines a command prefix to call whenever the handling of  mail‐
147              box  contents  is  required. If no such command is specified the
148              server will claim that all mailboxes are  empty.  The  interface
149              which  has  to be provided by the command prefix is described in
150              section MAILBOXES.
151
152       -socket command
153              Defines a command prefix  to  call  for  opening  the  listening
154              socket.   This  can  be used to make the pop3 server listen on a
155              SSL socket as provided by the tls package.
156

AUTHENTICATION

158       Here we describe the interface which has to be provided by the  authen‐
159       tication  callback so that pop3 servers following the interface of this
160       module are able to use it.
161
162       authCmd exists name
163              This method is given a username and  has  to  return  a  boolean
164              value telling whether or not the specified user exists.
165
166       authCmd lookup name
167              This  method is given a username and has to return a two-element
168              list containing the password for this user and a storage  refer‐
169              ence, in this order.
170
171              The  storage  reference is passed unchanged to the storage call‐
172              back, see sections OPTIONS and MAILBOXES for either  the  option
173              defining it and or the interface to provide, respectively.
174

MAILBOXES

176       Here  we describe the interface which has to be provided by the storage
177       callback so that pop3 servers following the interface  of  this  module
178       are  able  to  use  it.  The  mbox argument is the storage reference as
179       returned by the lookup method of the authentication command,  see  sec‐
180       tion AUTHENTICATION.
181
182       storageCmd dele mbox msgList
183              ]  Deletes  the  messages whose numeric ids are contained in the
184              msgList from the mailbox specified via mbox.
185
186       storageCmd lock mbox
187              This method locks the specified mailbox for use by a single con‐
188              nection  to  the  server.  This is necessary to prevent havoc if
189              several connections to the same mailbox are open. The complemen‐
190              tary  method is unlock. The command will return true if the lock
191              could be set successfully or false if not.
192
193       storageCmd unlock mbox
194              This is the complementary method to lock, it revokes the lock on
195              the specified mailbox.
196
197       storageCmd size mbox ?msgId?
198              Determines  the  size of the message specified through its id in
199              msgId, in bytes, and  returns  this  number.  The  command  will
200              return the size of the whole maildrop if no message id was spec‐
201              ified.
202
203       storageCmd stat mbox
204              Determines the number of messages in the specified  mailbox  and
205              returns this number.
206
207       storageCmd get mbox msgId
208              Returns  a  handle  for  the specified message. This handle is a
209              mime token following the interface described in  the  documenta‐
210              tion of package mime. The pop3 server will use the functionality
211              of the mime token to send the mail to the requestor at the other
212              end of a pop3 connection.
213

BUGS, IDEAS, FEEDBACK

215       This  document,  and the package it describes, will undoubtedly contain
216       bugs and other problems.  Please report such in the category  pop3d  of
217       the          Tcllib         SF         Trackers         [http://source
218       forge.net/tracker/?group_id=12883].  Please also report any  ideas  for
219       enhancements you may have for either package and/or documentation.
220

KEYWORDS

222       internet, network, pop3, protocol, rfc 1939
223
225       Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
226
227
228
229
230pop3d                                1.1.0                            pop3d(n)
Impressum