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

OPTIONS

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

AUTHENTICATION

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

MAILBOXES

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

KEYWORDS

214       internet, network, pop3, protocol, rfc 1939
215
217       Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
218
219
220
221
222pop3d                                1.1.0                            pop3d(n)
Impressum