pop3d(n)
π pop3d(n) β Tcl POP3 Server Package π
okay bestie, listen up: this is the manual for pop3d(n), the Tcl POP3 server implementation. It's giving network-server realness, and we're gonna walk through every single flag, callback, and vibe. no cap. π«Ά
π NAME π
pop3d β Tcl POP3 server implementation. periodt. π
β¨ SYNOPSIS β¨
here's the spellbook, copy-paste carefully, bestie:
package require Tcl 8.5 9
package require pop3d ?1.2.0?
::pop3d::new ?serverName?
serverName option ?arg arg ...?
serverName up
serverName down
serverName destroy ?mode?
serverName configure
serverName configure -option
serverName configure -option value...
serverName cget -option
serverName conn list
serverName conn state id
authCmd exists name
authCmd lookup name
storageCmd dele mbox msgList
storageCmd lock mbox
storageCmd unlock mbox
storageCmd size mbox ?msgId?
storageCmd stat mbox
storageCmd get mbox msgId
π¦ DESCRIPTION π¦
::pop3d::new ?serverName? β this command creates a brand-new server object with an associated global Tcl command whose name is serverName. so cute, so powerful. β¨
The command serverName is your main character: use it to invoke various operations on the server. It has this general form:
serverName option ?arg arg ...?
option and the args determine the exact behavior of the command. lowkey simple, highkey useful. π
A pop3 server can be started on any port the caller has permission for from the operating system. The default port will be 110, which is the port defined by the standard specified in RFC 1939 (http://www.rfc-editor.org/rfc/rfc1939.txt). After creating, configuring and starting, the server object will listen for and accept connections on that port and handle them according to the POP3 protocol. it's giving protocol-handler energy. π₯
Note: the server provided by this module will handle only the basic protocol by itself. For the higher levels of user authentication and handling of the actual mailbox contents, callbacks will be invoked. so you gotta bring your own auth + storage, bestie. π
The following commands are possible for server objects:
serverName upβ after this call the server will listen for connections on its configured port. glow-up activated. βserverName downβ after this call the server will stop listening for connections. This does not affect existing connections. so it's a soft pause, not ghosting the current chats. πserverName destroy ?mode?β destroys the server object. Currently open connections are handled depending on the chosenmode. The provided modes are:killβ destroys the server immediately, and forcefully closes all currently open connections. This is the default mode. very "blocked, deleted, done." πdeferβ stops the server from accepting new connections and will actually destroy it only after the last of the currently open connections for the server is closed. patient queen behavior. π
serverName configureβ returns a list containing all options and their current values in a format suitable for use by the commandarray set. The options themselves are described in section Options. (that's the one right below, bestie π)serverName configure -optionβ returns the current value of the specified option. This is an alias for the methodcget. The options themselves are described in section Options.serverName configure -option value...β sets the specified option to the provided value. The options themselves are described in section Options.serverName cget -optionβ returns the current value of the specified option. The options themselves are described in section Options.serverName conn listβ returns a list containing the ids of all connections currently open. roster check! πserverName conn state idβ returns a list suitable for[array set]containing the state of the connection referenced byid. yes, we're snooping, but consensually. π
π OPTIONS π
The following options are available to pop3 server objects. memorize them, they're the moment. β¨
-port portβ defines the port to listen on for new connections. Default is110. This option is a bit special. Ifportis set to"0"the server, or rather the operating system, will select a free port on its own. When querying-portthe id of this chosen port will be returned. Changing the port while the server is up will neither change the returned value, nor will it change on which port the server is listening on. Only after resetting the server via a call todownfollowed by a call toupwill the new port take effect. It is at that time that the value returned when querying-portwill change too. so don't expect a hot-swap, bestie. π-auth commandβ defines a command prefix to call whenever the authentication of a user is required. If no such command is specified the server will reject all users. The interface which has to be provided by the command prefix is described in section Authentication. no auth callback = no entry, periodt. π«-storage commandβ defines a command prefix to call whenever the handling of mailbox contents is required. If no such command is specified the server will claim that all mailboxes are empty. The interface which has to be provided by the command prefix is described in section Mailboxes. delulu empty inbox, but make it configurable. π-socket commandβ defines a command prefix to call for opening the listening socket. This can be used to make the pop3 server listen on a SSL socket as provided by the tls package, see the commandtls::socket. secure the bag. π
π AUTHENTICATION π
Here we describe the interface which has to be provided by the authentication callback so that pop3 servers following the interface of this module are able to use it. it's giving contract, bestie. sign it. π
authCmd exists nameβ this method is given a username and has to return a boolean value telling whether or not the specified user exists. yes/no, slay/not slay. βauthCmd lookup nameβ this method is given a username and has to return a two-element list containing the password for this user and a storage reference, in this order. The storage reference is passed unchanged to the storage callback, see sections Options and Mailboxes for either the option defining it and/or the interface to provide, respectively. order matters, don't flip it. π
π¬ MAILBOXES π¬
Here we describe the interface which has to be provided by the storage callback so that pop3 servers following the interface of this module are able to use it. The mbox argument is the storage reference as returned by the lookup method of the authentication command, see section Authentication. so mbox is the little passport from auth land. π
storageCmd dele mbox msgListβ deletes the messages whose numeric ids are contained in themsgListfrom the mailbox specified viambox. bye-bye mail. ποΈstorageCmd 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 isunlock. The command will return true if the lock could be set successfully or false if not. no fighting over the inbox, bestie. πstorageCmd unlock mboxβ this is the complementary method tolock, it revokes the lock on the specified mailbox. freedom! ποΈstorageCmd size mbox ?msgId?β determines the size of the message specified through its id inmsgId, in bytes, and returns this number. The command will return the size of the whole maildrop if no message id was specified. math but make it mail. πstorageCmd stat mboxβ determines the number of messages in the specified mailbox and returns this number. count 'em. π’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 pop3 server will use the functionality of the mime token to send the mail to the requestor at the other end of a pop3 connection. mime token said "I got this." π
π SECURE MAIL TRANSFER π
The option -socket (see Options) enables users of the package to override how the server opens its listening socket. The envisioned main use is the specification of the tls::socket command, see package tls, to secure the communication. encryption era. πβ¨
package require tls
tls::init \
...
pop3d::new S -socket tls::socket
...
π REFERENCES π
[1]RFC 1939 [http://www.rfc-editor.org/rfc/rfc1939.txt][2]RFC 2449 [http://www.rfc-editor.org/rfc/rfc2449.txt]
π BUGS, IDEAS, FEEDBACK π
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). Please also report any ideas for enhancements you may have for either package and/or documentation. we love feedback, fr fr. π
When proposing code changes, please provide unified diffs, i.e the output of diff -u. (yes, diff -u, not vibes.) π§Ύ
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. so attach, don't dump a wall of text. π«Ά
π KEYWORDS π
internet, network, pop3, protocol, rfc 1939, secure, ssl, tls
ποΈ CATEGORY ποΈ
Networking
Β© COPYRIGHT Β©
Copyright (c) 2002-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
Copyright (c) 2005 Reinhard Max <max@suse.de>
xoxo, bestie π
this was pop3d(n) from tcllib, version 1.2.0. go configure your server and slay. πβ¨
π¦ 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-2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- Copyright (c) 2005 Reinhard Max <max@suse\&.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms