1pop3d::dbox(n) Tcl POP3 Server Package pop3d::dbox(n)
2
3
4
5______________________________________________________________________________
6
8 pop3d::dbox - Simple mailbox database for pop3d
9
11 package require Tcl 8.3
12
13 package require pop3d::dbox ?1.0.2?
14
15 ::pop3d::dbox::new ?dbName?
16
17 dbName option ?arg arg ...?
18
19 dbName destroy
20
21 dbName base base
22
23 dbName add mbox
24
25 dbName remove mbox
26
27 dbName move old new
28
29 dbName list
30
31 dbName exists mbox
32
33 dbName locked mbox
34
35 dbName lock mbox
36
37 dbName unlock mbox
38
39 dbName stat mbox
40
41 dbName size mbox ?msgId?
42
43 dbName dele mbox msgList
44
45 storageCmd get mbox msgId
46
47_________________________________________________________________
48
50 The package pop3d::dbox provides simple/basic mailbox management facil‐
51 ities. Each mailbox object manages a single base directory whose subdi‐
52 rectories represent the managed mailboxes. Mails in a mailbox are rep‐
53 resented by files in a mailbox directory, where each of these files
54 contains a single mail, both headers and body, in RFC 822
55 (http://www.rfc-editor.org/rfc/rfc822.txt) conformant format.
56
57 Any mailbox object following the interface described below can be used
58 in conjunction with the pop3 server core provided by the package pop3d.
59 It is especially possible to directly use the objects created by this
60 package in the storage callback of pop3 servers following the same
61 interface as servers created by the package pop3d.
62
63 ::pop3d::dbox::new ?dbName?
64 This command creates a new database object with an associated
65 global Tcl command whose name is dbName. The command dbName may
66 be used to invoke various operations on the database. It has
67 the following general form:
68
69 dbName option ?arg arg ...?
70 Option and the args determine the exact behavior of the command.
71
72 The following commands are possible for database objects:
73
74 dbName destroy
75 Destroys the mailbox database and all transient data. The direc‐
76 tory associated with the object is not destroyed.
77
78 dbName base base
79 Defines the base directory containing the mailboxes to manage.
80 If this method is not called none of the following methods will
81 work.
82
83 dbName add mbox
84 Adds a mailbox of name mbox to the database. The name must be a
85 valid path component.
86
87 dbName remove mbox
88 Removes the mailbox specified through mbox, and the mails con‐
89 tained therein, from the database. This method will fail if the
90 specified mailbox is locked.
91
92 dbName move old new
93 Changes the name of the mailbox old to new.
94
95 dbName list
96 Returns a list containing the names of all mailboxes in the
97 directory associated with the database.
98
99 dbName exists mbox
100 Returns true if the mailbox with name mbox exists in the data‐
101 base, or false if not.
102
103 dbName locked mbox
104 Checks if the mailbox specified through mbox is currently
105 locked.
106
107 dbName lock mbox
108 This method locks the specified mailbox for use by a single con‐
109 nection to the server. This is necessary to prevent havoc if
110 several connections to the same mailbox are open. The complemen‐
111 tary method is unlock. The command will return true if the lock
112 could be set successfully or false if not.
113
114 dbName unlock mbox
115 This is the complementary method to lock, it revokes the lock on
116 the specified mailbox.
117
118 dbName stat mbox
119 Determines the number of messages in the specified mailbox and
120 returns this number. This method fails if the mailbox mbox is
121 not locked.
122
123 dbName size mbox ?msgId?
124 Determines the size of the message specified through its id in
125 msgId, in bytes, and returns this number. The command will
126 return the size of the whole maildrop if no message id was spec‐
127 ified. If specified the msgId has to be in the range "1 ...
128 [dbName stat]" or this call will fail. If stat was not called
129 before this call, size will assume that there are zero messages
130 in the mailbox.
131
132 dbName dele mbox msgList
133 Deletes the messages whose numeric ids are contained in the
134 msgList from the mailbox specified via mbox. The msgList must
135 not be empty or this call will fail. The numeric ids in msgList
136 have to be in the range "1 ... [dbName stat]" or this call will
137 fail. If stat was not called before this call, dele will assume
138 that there are zero messages in the mailbox.
139
140 storageCmd get mbox msgId
141 Returns a handle for the specified message. This handle is a
142 mime token following the interface described in the documenta‐
143 tion of package mime. The token is read-only. In other words,
144 the caller is allowed to do anything with the token except to
145 modify it. The msgId has to be in the range "1 ... [dbName
146 stat]" or this call will fail. If stat was not called before
147 this call, get will assume that there are zero messages in the
148 mailbox.
149
151 internet, network, pop3, protocol, rfc 822
152
154 Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
155
156
157
158
159pop3d 1.0.2 pop3d::dbox(n)