[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 Managing the Database

Managing the user database is a complex task, which looks differently from administrator's and user's point of view. The administrator have full rights on the database, it can add new records and delete or modify existing ones. A user, of course, does not have such ample rights. The only thing he is able to do is to maintain his own record in the database, provided that he already has one. If he does not, he should contact the system administrator and arrange for the creation of his record.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1 Administrators

All administrative tasks are done using anubisadm command — a multipurpose tool for Anubis administrator.

The command usage syntax is:

 
anubisadm command [options] database-url

where command specifies the operation to be performed on the database, options give additional operation-specific parameters, and database-url specifies the database to operate upon.

All administrative tasks can be subdivided into the following five categories:

These operations are described in detail in the following subsections .


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1.1 Creating the Database

To create a database use anubisadm --create (or anubisadm -c) command. Anubisadm will read database entries from the standard input and write them to the database. The standard input is supposed to be formatted as text database (see section Plain text databases).

Thus to create a GDBM database from plain text file ‘userlist’, use the following command

 
anubisadm --create gdbm:/etc/anubis.db < userlist

Similarly, to create an initially empty database, type

 
anubisadm --create gdbm:/etc/anubis.db < /dev/null

Notice, that if you use SQL database format, ‘--create’ command does not imply creating the database structure! So, before running

 
anubisadm --create mysql://localhost/dbname < userlist

make sure you create the underlying database structure (including granting privileges to the anubis user), via the usual procedure. Please refer to corresponding database manual for the detailed instructions on this.

It is sometimes necessary to convert the existing user database from one format (protocol) to another. For example, suppose you have been running GDBM database (text:/etc/anubis.db) for some time, but now it has grown considerably and you decided to switch to PostgreSQL database to improve performance. To do so, first create the database using postgres utilities. Then run

 
anubisadm --list text:/etc/anubis.db | \
 anubisadm --create pgsql://localhost/dbname

That's all there is to it!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1.2 Listing Database Records

The command ‘--list’ (or ‘-l’) lists the existing database. When run without additional options, it will display all records from the database, e.g.:

 
anubisadm --list gdbm:/etc/anubis.db

Among its other uses, such invocation is handy for converting user database to another format (see section Creating the Database).

If you wish to list only a particular record, specify the AUTHID using ‘--authid’ (‘-i’) option. For example, to list record of the user with AUTHIDtest’, type:

 
example$ anubisadm --list --authid test gdbm:/etc/anubis.db

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1.3 Adding New Records

To add a new record use command ‘--add’ (‘-a’). Additional data are specified via the following options:

-i string
--authid=string

Specify the user SMTP AUTHID.

-p string
--password=string

Specify user password password.

-u string
--user=string

Specify system user name corresponding to the given AUTHID.

-f string
--rcfile=string

Specify configuration file to be used for this user.

For example, the following command adds a record with SMTP AUTHIDtest’, password ‘guessme’ and maps it to the system account ‘gray’:

 
anubisadm --add --authid test --password guessme \
          --user gray gdbm:/etc/anubis.db

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1.4 Removing Existing Records

Removing a record is quite straightforward: use ‘--remove’ (‘-r’) command and specify AUTHID using ‘--authid’ option. For example, to remove the record created in the previous subsection, run:

 
anubisadm --remove --authid test gdbm:/etc/anubis.db

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1.5 Modifying Existing Records

To modify an existing record use command ‘--modify’ (‘-m’). The record is identified via ‘--authid’ option. The fields to be changed are given with the following options:

-p string
--password=string

Specify user password password.

-u string
--user=string

Specify system user name corresponding to the given AUTHID.

-f string
--rcfile=string

Specify configuration file to be used for this user.

For example, the following command sets new configuration file name for the user ‘smith’:

 
anubisadm --authid smith \
          --rcfile=/var/spool/anubis/common gdbm:/etc/anubis.db

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1.6 Summary of All Administrative Commands


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.2 Users

Users maintain their database records using anubisusr command. Main purpose of this command is to keep the copy of your configuration on GNU Anubis server up to date. . We recommend to invoke anubisusr from your ‘~/.profile’, which will make sure that your configuration file is up to date when you log in. (4).

Usage

 
anubisusr [options] [smtp-url]

where smtp-url is a URL of your GNU Anubis server. Notice that if it lacks user name and password, then anubisusr will first try to retrieve them from your ‘~/.netrc’ file (See netrc(5) for more info), and if not found it will prompt you to supply them.

Options

-m mech
--mechanism mech

Only use SASL mechanism mech. Use this option several times to set a list of allowed mechanisms.

-v
--verbose

Verbose output. Multiple options increase the verbosity. Maximum verbosity level is 3.

--version

Display program version number and exit.

--help

Display short usage summary and exit.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Sergey Poznyakoff on December, 20 2008 using texi2html 1.78.