File: pop3d_udb.man

package info (click to toggle)
tcllib 2.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,560 kB
  • sloc: tcl: 306,798; ansic: 14,272; sh: 3,035; xml: 1,766; yacc: 1,157; pascal: 881; makefile: 124; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (112 lines) | stat: -rw-r--r-- 3,430 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[comment {-*- tcl -*-}]
[manpage_begin pop3d::udb n 1.0.1]
[keywords internet]
[keywords network]
[keywords pop3]
[keywords protocol]
[copyright {2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>}]
[moddesc   {Tcl POP3 Server Package}]
[titledesc {Simple user database for pop3d}]
[category  Networking]
[require Tcl "8.5 9"]
[require pop3d::udb [opt 1.0.1]]
[description]
[para]

The package [package pop3d::udb] provides simple in memory databases
which can be used in conjunction with the pop3 server core provided by
the package [package pop3d]. The databases will use the names of users
as keys and associates passwords and storage references with them.

[para]

Objects created by this package can be directly used in the
authentication callback of pop3 servers following the same interface
as servers created by the package [package pop3d].

[para]

[list_begin definitions]

[call  [cmd ::pop3d::udb::new] [opt [arg dbName]]]

This command creates a new database object with an associated global
Tcl command whose name is [arg dbName].

[list_end]

The command [cmd dbName] may be used to invoke various operations on
the database.  It has the following general form:

[list_begin definitions]
[call [cmd dbName] [arg option] [opt [arg "arg arg ..."]]]

[arg Option] and the [arg arg]s determine the exact behavior of the
command.

[list_end]

[para]

The following commands are possible for database objects:

[list_begin definitions]

[call [arg dbName] [method destroy]]

Destroys the database object.

[call [arg dbName] [method add] [arg {user pwd storage}]]

Add a new user or changes the data of an existing user. Stores
[arg password] and [arg storage] reference for the given [arg user].

[call [arg dbName] [method remove] [arg user]]

Removes the specified [arg user] from the database.

[call [arg dbName] [method rename] [arg {user newName}]]

Changes the name of the specified [arg user] to [arg newName].

[call [arg dbName] [method lookup] [arg user]]

Searches the database for the specified [arg user] and returns a
two-element list containing the associated password and storage
reference, in this order. Throws an error if the user could not be
found. This is the interface as expected by the authentication
callback of package [package pop3d].

[call [arg dbName] [method exists] [arg user]]

Returns true if the specified [arg user] is known to the database,
else false.

[call [arg dbName] [method who]]

Returns a list of users known to the database.

[call [arg dbName] [method save] [opt [arg file]]]

Saves the contents of the database into the given [arg file]. If the
file is not specified the system will use the path last used in a call
to [arg dbName] [method read]. The generated file can be read by the
[method read] method.

[call [arg dbName] [method read] [arg file]]

Reads the specified [arg file] and adds the contained user definitions
to the database. As the file is actually [cmd source]'d a safe
interpreter is employed to safeguard against malicious code. This
interpreter knows the [cmd add] command for adding users and their
associated data to this database. This command has the same argument
signature as the method [method add]. The path of the [arg file] is
remembered internally so that it can be used in the next call of

[arg dbName] [method save] without an argument.

[list_end]

[vset CATEGORY pop3d]
[include ../common-text/feedback.inc]
[manpage_end]