pop3d::udb(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ pop3d::udb β€” the simple user database for pop3d ✨

okay bestie, welcome to pop3d::udb, part of the Tcl POP3 Server Package (that's the 3tcl manual, iykyk) πŸ’–


🌸 NAME 🌸

pop3d::udb β€” a simple user database for pop3d 🫢


πŸ¦‹ 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

πŸ‘‘ DESCRIPTION πŸ‘‘

So the package pop3d::udb hands you simple in-memory databases that you can use together with the pop3 server core that the pop3d package gives you. The way it works is: user names are the keys, and each one gets a password and a storage reference associated with it. iconic, honestly.

The objects this package makes can be dropped directly into the authentication callback of pop3 servers that follow the same interface as the servers made by the pop3d package. no glue code, no drama πŸ’…

  • ::pop3d::udb::new ?dbName? β€” creates a brand new database object with an associated global Tcl command whose name is dbName.

The command dbName is what you use to invoke the various operations on the database, and its general form is:

  • dbName option ?arg arg ...? β€” option and the args decide exactly what the command does.

Here are all the commands you can run on a database object, bestie:

  • dbName destroy β€” destroys the database object. poof, gone πŸ’€
  • dbName add user pwd storage β€” adds a new user, or changes the data of a user who's already there. stores the password and the storage reference for the given user.
  • dbName remove user β€” removes the specified user from the database.
  • dbName rename user newName β€” changes the name of the specified user to newName.
  • dbName lookup user β€” searches the database for the specified user and returns a two-element list holding the associated password and storage reference, in that order. it throws an error if the user can't be found 😭. this is exactly the interface that the authentication callback of the package pop3d expects.
  • dbName exists user β€” returns true if the specified user is known to the database, otherwise false.
  • dbName who β€” returns a list of the users known to the database. the whole squad πŸ‘―
  • dbName save ?file? β€” saves the contents of the database into the given file. if you don't specify a file, the system uses the path last used in a call to dbName read. the file it generates can be read back by the read method. πŸ”
  • dbName read file β€” reads the specified file and adds the user definitions it contains to the database. because the file is actually source'd, a safe interpreter is employed to safeguard against malicious code πŸ›‘οΈ. this interpreter knows the add command for adding users and their associated data to this database, and that command has the same argument signature as the method add. the path of the file is remembered internally so it can be used in the next call of dbName save with no argument.

πŸ™ˆ BUGS, IDEAS, FEEDBACK πŸ™ˆ

ngl, this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems. please report them in the category pop3d of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist. and please also report any ideas for enhancements you have for either the package and/or the documentation 🫢

When you propose code changes, please provide unified diffs, i.e the output of diff -u.

Also note: attachments are strongly preferred over inlined patches. you make an attachment 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. don't skip this part bestie, it matters πŸ’…

🌈 KEYWORDS 🌈

internet, network, pop3, protocol


πŸŽ€ CATEGORY πŸŽ€

Networking


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


okay that's the whole vibe, you're all caught up ✨ this was tcllib 1.0.1, pop3d::udb(3tcl), and it ate, no cap πŸ’…πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from