pop3d::dbox(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ NAME ✨

okay so bestie, this page lives in the Tcl POP3 Server Package manual, section n, and it's all about pop3d::dbox β€” the simple mailbox database for pop3d πŸŽ€


🌸 SYNOPSIS 🌸

package require Tcl 8.5 9

package require pop3d::dbox ?1.0.3?

::pop3d::dbox::new ?dbName?

dbName option ?arg arg ...?

dbName destroy

dbName base base

dbName add mbox

dbName remove mbox

dbName move old new

dbName list

dbName exists mbox

dbName locked mbox

dbName lock mbox

dbName unlock mbox

dbName stat mbox

dbName size mbox ?msgId?

dbName dele mbox msgList

storageCmd get mbox msgId

πŸ¦‹ DESCRIPTION πŸ¦‹

so the package pop3d::dbox gives you simple/basic mailbox management facilities, no cap. every single mailbox object is out here managing one base directory, and the subdirectories of that base dir are the mailboxes it's managing. a mail inside a mailbox? that's just a file sitting in the mailbox directory, and each one of those files holds exactly one mail β€” headers AND body, together, in RFC 822 (http://www.rfc-editor.org/rfc/rfc822.txt) conformant format. iconic.

any mailbox object that follows the interface described down below can be used in conjunction with the pop3 server core that the package pop3d provides. and it's especially possible to directly use the objects this package creates in the storage callback of pop3 servers that follow the same interface as the servers made by the package pop3d. it's giving plug and play πŸ’…

::pop3d::dbox::new ?dbName?

this command creates a new database object, and that object gets an associated global Tcl command whose name is dbName.

dbName option ?arg arg ...?

the dbName command is how you invoke all the various operations on the database. general form right here: option and the args decide the exact behavior of the command. that's it, that's the whole vibe.

the following commands are possible for database objects:

dbName destroy

destroys the mailbox database and all transient data. important detail bestie: the directory associated with the object is not destroyed. the directory survives. periodt.

dbName base base

defines the base directory containing the mailboxes to manage.

🚨 real talk: if this method is not called, none of the following methods will work. zero. nada. call base first, i'm begging you πŸ™ˆ

dbName add mbox

adds a mailbox named mbox to the database. the name has to be a valid path component, so don't get cute with it.

dbName remove mbox

removes the mailbox specified through mbox β€” and the mails contained therein β€” from the database. this method will fail if the specified mailbox is locked. so unlock first, okay? 😭

dbName move old new

changes the name of the mailbox old to new. glow up, mailbox edition ✨

dbName list

returns a list containing the names of all mailboxes in the directory associated with the database.

dbName exists mbox

returns true if the mailbox named mbox exists in the database, or false if not. simple. clean. we love a boolean πŸ’–

dbName locked mbox

checks if the mailbox specified through mbox is currently locked.

dbName lock mbox

this method locks the specified mailbox for use by a single connection to the server. this is necessary to prevent havoc if several connections to the same mailbox are open. the complementary method is unlock. the command returns true if the lock could be set successfully, or false if not.

dbName unlock mbox

this is the complementary method to lock β€” it revokes the lock on the specified mailbox. bye bestie πŸ‘‹

dbName stat mbox

determines the number of messages in the specified mailbox and returns that number.

🚨 this method fails if the mailbox mbox is not locked. lock it up first.

dbName size mbox ?msgId?

determines the size of the message specified through its id in msgId, in bytes, and returns that number. if no message id was specified, the command returns the size of the whole maildrop instead.

if msgId is specified, it has to be in the range "1 ... [dbName stat]" or this call will fail. and lowkey important: if stat was not called before this call, size will assume that there are zero messages in the mailbox. so like, call stat first fr fr.

dbName dele mbox msgList

deletes the messages whose numeric ids are contained in msgList from the mailbox specified via mbox.

🚨 msgList must not be empty or this call will fail. the numeric ids in msgList have to be in the range "1 ... [dbName stat]" or this call will fail. and if stat was not called before this call, dele will assume that there are zero messages in the mailbox.

storageCmd get mbox msgId

returns a handle for the specified message. this handle is a mime token following the interface described in the documentation of package mime. the token is read-only β€” in other words, the caller is allowed to do anything with the token except modify it. look, don't touch, iykyk πŸ’…

the msgId has to be in the range "1 ... [dbName stat]" or this call will fail. and again: if stat was not called before this call, get will assume that there are zero messages in the mailbox.


πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

not to be dramatic but this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems 😭 please report such in the category pop3d of the Tcllib Trackers (http://core.tcl.tk/tcllib/reportlist). and please also report any ideas for enhancements you may have for either the package and/or the documentation. we want the ideas 🫢

when proposing code changes, please provide unified diffs, i.e the output of diff -u.

note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. that's the move πŸ‘‘


πŸ”‘ KEYWORDS πŸ”‘

internet, network, pop3, protocol, rfc 822


🌈 CATEGORY 🌈

Networking


Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page, bestie πŸŽ€ this was pop3d::dbox(n) from tcllib, version 1.0.3 β€” go forth and manage those mailboxes, you absolute icon πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from