Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Anubis
EGYPTIAN
ENCRYPTION
The Anubis mail manipulation daemon lets you centralize encryption
for outgoing mail. BY DANIEL S. HAISCHT
www.sxc.hu
64
WWW.LINUX - MAGAZINE.COM
SYSADMIN
Anubis
MUA 1
MTA 1
MUA 1
GNU
MTA 1
(Mutt)
(Exim)
(Mutt)
Anubis
(Postfix)
MUA 2
MTA 2
(Mozilla)
(Postfix)
Inbox
Inbox
Figure 2: GNU Anubis sits between the MUA and MTA. From the clients point of view, Anubis is the mail server. In this position, Anubis
can manipulate traffic arbitrarily.
Installation
Thanks to autoconf, Anubis is really
easy to configure and install. But make
sure you specify in advance which database will hold the user data. In Pixie
mode, you can additionally authenticate
users via an Ident daemon running on
the local workstation. This variant does
not need a relational database. It is also
possible to compile all the modules and
decide on a setup later:
Regex (support for regular expressions)
GSASL (user authentication)
The module for Ident daemon-based
WWW.LINUX - MAGAZINE.COM
65
SYSADMIN
Anubis
02 ## ...
13 #sasl-password-db mysql://
mail:access4anubis@mysql.
03 #mode auth
abyssworld.de/
04 ## ...
mail;table=anubis_user
05 #---END---
06 #
DIGEST-MD5 CRAM-MD5
07 #---BEGIN AUTH---
15 #---END---
08 #smtp-greeting-message ESMTP
16 #
Anubis (4.0.0)
17 #---BEGIN TRANSLATION---
09 #smtp-help-message help
message
18 ##translate [USER@]ADDRESS
into USERNAME
19 #translate me@daniel.stefan.
haischt.name into haischt
20 #---END---
available via OpenLDAP or an Active Directory server. For a long time, the
Anubis application only used text or
GDBM-based databases; support for relational systems is still fairly new to
Anubis. So lets hope that LDAP support
will soon follow.
You can check the config.log after you
complete the ./configure stage to see if
the modules were configured as expected. After completing the installation,
typing anubis -show-config-options tells
you if the required modules really are
available.
Anubis expects to find its configuration data in /etc/anubisrc. This path is
hard-coded in src/header.h, but you can
modify the location on the fly using the
--altrc file. The make install stage does
not actually create a configuration file;
however, there is a examples/2anubisrc
Personal Configuration
Additionally, users who need the ability
to send mail via the Anubis daemon can
create a ~/.anubisrc file in their home
directories. examples/1anubisrc gives
you an example.
For initial testing, the Anubis daemon
also has a debug mode:
anubis --altrc U
/usr/local/etc/anubis/anubisrcU
--mode=transparent -v -D -f
Pixie Authentication
Anubis has a number of approaches to
identifying users. Pixie mode is one of
the more simple approaches to authentication. Pixie mode is enabled by the
mode transparent entry in the control
block of the the global configuration file.
In this setup, an Ident daemon (AUTH
protocol) runs on the user workstation.
Anubis requires the user to authenticate
before handling mail (see Figure 3.)
However, this technique only makes
sense in a very specific scenario. The
server has to trust the Ident daemon,
and this type of client-side security
check only works if the workstation is
used by responsible admins who know
their users, and who can be sure that nobody will tamper with the network settings. Best practices would suggest
avoiding the use of this operating mode.
MUA 1
GNU
MTA 1
MUA 1
GNU
MTA 1
(Mutt)
Anubis
(Postfix)
(Mutt)
Anubis
(Postfix)
?
Ident-
Inbox
Inbox
RDBMS
Daemon
Figure 3: In Pixie mode, Anubis first asks the Ident daemon on the
senders workstation to identify the user who opened the connection
before accepting and processing the message.
66
WWW.LINUX - MAGAZINE.COM
Anubis
SYSADMIN
count, are of interest. After the authentication phase, the GNU Anubis daemon
passes the message on to the mail server
(Lines 11 through 14).
Windows XP client systems often have
an integrated firewall that can cause
trouble during the test phase. In the default configuration, the firewall understandably restricts all Ident requests to
port 113. This needs to be changed (by
unblocking port 113 or disabling the firewall.) Additionally, the mail program
cant use SMTP-AUTH user names in
Pixie mode.
Figure 5b: The MySQL table has the user credentials for haischt, who uses Dixie to authenticate. The Unix account for this user has the same name, and the configuration file is located
in /home/haischt/.anubisrc.
anubisadm --create U
'mysql://mail:access4anubisU
@mysql.abyssworld.de/mail;U
table=anubis_test' U
< /usr/local/etc/U
anubis/anubisdb.txt
Figure 5a: PHP MyAdmin showing the MySQL table structure used as the Dixie data repository for Anubis. All four fields contain text entries: user ID, password, Unix name, and the
path to the configuration file
WWW.LINUX - MAGAZINE.COM
67
SYSADMIN
Anubis
a domain to a
Table 2: Dixie Database Fields
shared name
Field
Meaning
(translate Domain
Authid
Corresponds to the name set by the user in the mail prointo User.)
gram preferences. This field is required for SMTP authentiDixie mode is
cation.
useful, as it leverPasswd
The user also sets a password in the mail client, which
ages current stanagain is required for authentication by SMTP.
dards such as
Account
Corresponds to the Unix account. This field maps the mail
SMTP-AUTH, and it
users name to the matching Unix account, in order to find
gives mail users
an Anubis configuration file in the users home directory,
for example.
without Unix acConfig
This field has the path (absolute or relative) to the Anubis
counts access to
configuration file for this user. Relative paths start in the
the service. This
users home directory.
said, it is also true
that the current implementation of the Anubis Dixie mode
As Anubis has the users credentials,
has a few annoying weaknesses:
targeted message processing is now posPasswords in the database are stored
sible; for example, you can configure
in the clear. The database field for the
Anubis to sign or encrypt email. To
users Anubis configuration file points to
allow this to happen, users need to add
an existing file. It would be more practientries to the RULE section of their
cal to store parameters in a BLOB field or
~/.anubisrc files. You'll find that it is
in a separate table.
quite simple to add attributes to the
SMTP Tricks
68
reason(47)
(2.2.3)(46)
WWW.LINUX - MAGAZINE.COM
Anubis
add header[X-Processed-By] U
"GNU Anubis"
if header [Subject] U
"^ *\\[sig\\](.*)"
remove [Subject]
add [Subject] "\1"
signature-file-append yes
INFO
trigger "sign"
gpg-sign meU
@daniel.stefan.haischt.name
done
Wily Anubis
More complex tasks need a more powerful programing language, and Anubis
gives you this in the form of the Guile
scripting language (a dialect of Scheme).
You can also use external programs for
mail manipulation. In combination with
the integrated commands, GNU Anubis
WWW.LINUX - MAGAZINE.COM
THE AUTHOR
SYSADMIN
69