NAME
pop3d::dbox - Simple mailbox database for pop3d
SYNOPSIS
package require TTccll 88..33 package require ppoopp33dd::::ddbbooxx ??11..00..11?? ::::ppoopp33dd::::ddbbooxx::::nneeww ?dbName? ddbbNNaammee option ?arg arg ...? dbName ddeessttrrooyy dbName bbaassee base dbName aadddd mbox dbName rreemmoovvee mbox dbName mmoovvee old new dbName lliisstt dbName eexxiissttss mbox dbName lloocckkeedd mbox dbName lloocckk mbox dbName uunnlloocckk mbox dbName ssttaatt mbox dbName ssiizzee mbox ?msgId? dbName ddeellee mbox msgList storageCmd ggeett mbox msgIdDESCRIPTION
The package ppoopp33dd::::ddbbooxx provides simple/basic mailbox management facil-
ities. Each mailbox object manages a single base directory whose subdi-
rectories represent the managed mailboxes. Mails in a mailbox are rep-
resented by files in a mailbox directory, where each of these files contains a single mail, both headers and body, in RFC 822(http://www.rfc-editor.org/rfc/rfc822.txt) conformant format.
Any mailbox object following the interface described below can be used in conjunction with the pop3 server core provided by the package ppoopp33dd. It is especially possible to directly use the objects created by this package in the storage callback of pop3 servers following the same interface as servers created by the package ppoopp33dd. ::::ppoopp33dd::::ddbbooxx::::nneeww ?dbName? This command creates a new database object with an associated global Tcl command whose name is dbName. The command ddbbNNaammee may be used to invoke various operations on the database. It has the following general form: ddbbNNaammee option ?arg arg ...? Option and the args determine the exact behavior of the command. The following commands are possible for database objects: dbName ddeessttrrooyyDestroys the mailbox database and all transient data. The direc-
tory associated with the object is not destroyed. dbName bbaassee base Defines the base directory containing the mailboxes to manage. If this method is not called none of the following methods will work. dbName aadddd mbox Adds a mailbox of name mbox to the database. The name must be a valid path component. dbName rreemmoovvee mboxRemoves the mailbox specified through mbox, and the mails con-
tained therein, from the database. This method will fail if the specified mailbox is locked. dbName mmoovvee old new Changes the name of the mailbox old to new. dbName lliisstt Returns a list containing the names of all mailboxes in the directory associated with the database. dbName eexxiissttss mboxReturns true if the mailbox with name mbox exists in the data-
base, or false if not. dbName lloocckkeedd mbox Checks if the mailbox specified through mbox is currently locked. dbName lloocckk mboxThis method locks the specified mailbox for use by a single con-
nection to the server. This is necessary to prevent havoc ifseveral connections to the same mailbox are open. The complemen-
tary method is uunnlloocckk. The command will return true if the lock could be set successfully or false if not. dbName uunnlloocckk mbox This is the complementary method to lloocckk, it revokes the lock on the specified mailbox. dbName ssttaatt mbox Determines the number of messages in the specified mailbox and returns this number. This method fails if the mailbox mbox is not locked. dbName ssiizzee mbox ?msgId? Determines the size of the message specified through its id in msgId, in bytes, and returns this number. The command willreturn the size of the whole maildrop if no message id was spec-
ified. If specified the msgId has to be in the range "1 ... [dbName ssttaatt]" or this call will fail. If ssttaatt was not called before this call, ssiizzee will assume that there are zero messages in the mailbox. dbName ddeellee mbox msgList Deletes the messages whose numeric ids are contained in the msgList from the mailbox specified via mbox. The msgList must not be empty or this call will fail. The numeric ids in msgList have to be in the range "1 ... [dbName ssttaatt]" or this call will fail. If ssttaatt was not called before this call, ddeellee will assume that there are zero messages in the mailbox. storageCmd ggeett mbox msgId Returns a handle for the specified message. This handle is amime token following the interface described in the documenta-
tion of package mmiimmee. The token is read-only. In other words,
the caller is allowed to do anything with the token except to modify it. The msgId has to be in the range "1 ... [dbName ssttaatt]" or this call will fail. If ssttaatt was not called before this call, ggeett will assume that there are zero messages in the mailbox. KKEEYYWWOORRDDSS internet, network, pop3, protocol, rfc 822 COPYRIGHT Copyright (c) 2002 Andreas Kupriespop3d 1.0.1 pop3d::dbox(n)