pop3d::udb(n)
π NAME π
pop3d::udb β the simplest little user database for pop3d, bestie. it's giving "small but mighty" and honestly? iconic. β¨
(it's a Tcl POP3 Server Package page, for the record β pop3d::udb(n), that's her full government name π
)
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require pop3d::udb ?1.0.1?
::pop3d::udb::new ?dbName?
dbName option ?arg arg ...?
dbName destroy
dbName add user pwd storage
dbName remove user
dbName rename user newName
dbName lookup user
dbName exists user
dbName who
dbName save ?file?
dbName read file
like, look at her. so organized. so slay. π
π¦ DESCRIPTION π¦
okay so the package pop3d::udb hands you simple in-memory databases that you can plug right into the pop3 server core from the package pop3d. no cap. π«Ά
the way it works is: the users' names are the keys, and the database associates passwords and storage references with them. that's the whole vibe.
and here's the best part β objects created by this package can be dropped directly into the authentication callback of pop3 servers that follow the same interface as servers created by the package pop3d. plug and play, periodt. π
π ::pop3d::udb::new ?dbName?
this command creates a brand new database object, and it comes with a global Tcl command whose name is dbName. new bestie unlocked β¨
the command dbName may be used to invoke various operations on the database. it has the following general form:
π dbName option ?arg arg ...?
option and the args determine the exact behavior of the command. classic.
the following commands are possible for database objects:
β¨ the commands β¨
dbName destroyβ destroys the database object. she's gone, she's at peace, we love a clean exit. πdbName add user pwd storageβ add a new user, or change the data of a user who already exists. stores the password and the storage reference for the given user. lowkey the workhorse of the whole operation.dbName remove userβ removes the specified user from the database. bye bestie π¦dbName rename user newNameβ changes the name of the specified user to newName. glow-up name change, we support it. πdbName lookup userβ searches the database for the specified user and returns a two-element list containing the associated password and storage reference, in this order: password first, storage second. > throws an error if the user could not be found. π and this, right here, is the interface as expected by the authentication callback of packagepop3d. iykyk.dbName exists userβ returns true if the specified user is known to the database, else false. simple. honest. a vibe check, basically. βdbName whoβ returns a list of users known to the database. the full roster. the guest list. πdbName save ?file?β saves the contents of the database into the given file. if the file is not specified, the system will use the path last used in a call todbName read. and the generated file can be read by thereadmethod β it's a whole circular ecosystem, we love to see it. πdbName read fileβ reads the specified file and adds the contained user definitions to the database. here's the important part, bestie: because the file is actually source'd, a safe interpreter is employed to safeguard against malicious code. π‘οΈ that safe interpreter knows theaddcommand for adding users and their associated data to this database, and that command has the same argument signature as the methodadd. also, the path of the file is remembered internally, so it can be used in the next call ofdbName savewithout an argument. see? ecosystem. π§
π BUGS, IDEAS, FEEDBACK π
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. that's just how it is, no shade. please report such in the category pop3d of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. π
also please report any ideas for enhancements you may have for either the package and/or the documentation. we're listening, we're invested. π«Ά
when proposing code changes, please provide unified diffs, i.e the output of diff -u. fr fr, this one matters.
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
π CATEGORY π
Networking
π COPYRIGHT π
Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page, bestie!! this was brought to you by tcllib, version 1.0.1 β go off, drink water, and remember: your user database is only as good as your safe interpreter. πβ¨ππ¦πΈπ
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2002 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms