Anubis(1)

NAME
Anubis - an outgoing mail processor, and the SMTP tunnel.

SYNOPSIS
anubis [-b arg] [-l arg] [-h arg] [-f] [options]

DESCRIPTION
Anubis is an outgoing mail processor, and provides the SMTP tunnel between the MUA (Mail User Agent) and the MTA (Mail Transport Agent). It operates as a proxy server daemon, independently from mail user agents, and can manage and process outgoing mail on the fly using a highly configurable rule system, based on a regular expressions (PerlRE) system. Anubis can edit outgoing mail headers, encrypt and/or sign mail with GnuPG, build secure SMTP tunnels using the TLS/SSL encryption even if your mail user agent doesn't support it, or tunnel a connection through a SOCKS proxy server.

  Features
 - On-the-fly an outgoing mail processing.
 - Extended regular expressions support.
 - PerlRE support via the PCRE.
 - TLS/SSL encryption support between the MUA and the MTA.
 - GnuPG (PGP) support (via the GPGME library).
 - SOCKS Proxy and WinGates (max.2) support.
 - Remailers support (Type-I Cypherpunks).

OPTIONS

-b, --bind [HOST:]PORT
    The SMTP tunnel {default host is INADDR_ANY, default port number is 25}.

-l, --local-mta FILE
    Execute a local inetd-type program (instead of -h).

-h, --host HOST[:PORT]
    Specify the SMTP host name or IP address {default is localhost:25}.

-f, --foreground
    Foreground mode (no fork()).

-i, --sio
    Use the Tunnel as described in RFC 821 on standard input and output.

Output options:

-s, --silent
    Work silently.

-v, --verbose
    Work noisily.

-D, --debug
    Debug mode (if compiled with GDEBUG macro).

Misc. options:

--altrc FILE
    Specify alternate run control file.

--norc
    Ignore the run control file.

--version
    Print version number, copyright, and OS info.

--help
    It's obvious...

DEFINITIONS

The following definitions are used throughout the rest of this document.

ROOT MODE - supervisor's run control file
USER MODE - client's run control file

THE RUN CONTROL FILES
The behavior of Anubis is controlled by two run control files. The first one, /etc/anubisrc, is owned by a supervisor, usually root (ROOT MODE). The second one, ~/.anubisrc, belongs to a client (USER MODE). To protect your passwords in the run control files use the 0600 (u=rw,g=,o=) permissions, otherwise Anubis won't accept them.

The run control files are divided into several control sections: 1) THE TUNNEL SECTION
2) THE ALL SECTION
3) THE RULE SYSTEM (aka THE REGEX SECTION)

The ROOT MODE accepts only section no. 1.
The USER MODE accepts all the sections (1,2,3).

  THE TUNNEL SECTION (ROOT MODE)
 ---BEGIN TUNNEL---
 BIND = [HOST:]PORT
 SERVER = HOST[:PORT]
 LOCAL-MTA = FILE NAME [ARGS]
 OUTPUT = NORMAL|VERBOSE|SILENT
 SOCKS-PROXY = HOST[:PORT]
 SOCKS-V4 = yes|no
 SOCKS-USERNAME = USERNAME
 SOCKS-PASSWORD = PASSWORD
 WINGATE1 = HOST[:PORT]
 WINGATE2 = HOST[:PORT]
 SSL = yes|no
 ONEWAY-SSL = yes|no
 CERT = FILE NAME
 KEY = FILE NAME
 AUTH-LOCAL = yes|no
 ALLOW-LOCAL-MTA = yes|no
 ---END---

  THE TUNNEL SECTION (USER MODE)
  ---BEGIN TUNNEL---
 LOGFILE = FILE NAME
 LOGLEVEL = NONE|ERRORS|ALL
 SERVER = HOST[:PORT]
 LOCAL-MTA = FILE NAME [ARGS]
 SOCKS-PROXY = HOST[:PORT]
 SOCKS-V4 = yes|no
 SOCKS-USERNAME = USERNAME
 SOCKS-PASSWORD = PASSWORD
 WINGATE1 = HOST[:PORT]
 WINGATE2 = HOST[:PORT]
 SSL = yes|no
 ONEWAY-SSL = yes|no
 CERT = FILE NAME
 KEY = FILE NAME
 ---END---

  THE 'ALL' SECTION (USER MODE ONLY)
 ---BEGIN ALL---
 ACTION-LIST
 ---END---
 For example:
 ---BEGIN ALL---
 SIGNATURE = yes
 ---END---

The example above will add a signature file to EVERY outgoing message!

  THE RULE SYSTEM (USER MODE ONLY)
The whole rule system starts with the "---BEGIN REGEX---" line, and the "---END---" line ends it.

  Grammar
 IF ... =REGEX1[!=REGEX2]
    ACTION-LIST
 FI The first regular expression (REGEX1) is required. The second one (REGEX2) is optional. Here is a simple rule:
 IF ... =REGEX1
    ACTION-LIST
 FI The rule above is true if REGEX1 is TRUE.
 OR:
 IF ... =REGEX1!=REGEX2
    ACTION-LIST
 FI The rule above is true if REGEX1 is TRUE and REGEX2 is FALSE. The control operator '!=' breaks regular expressions into two pieces: REGEX1 and REGEX2. Note that there is no SPACE between regular expressions and the control operators '=' and '!='. The rule system is case insensitive (except regular expressions), so you can also write:
 if ... =REGEX1[!=REGEX2]
    action-list
 fi The "..." is "COMMAND" or "HEADER", for example:
 ---BEGIN REGEX---
 IF COMMAND =REGEX
    ACTION-LIST
 FI
 IF HEADER =REGEX
    ACTION-LIST
 FI
 ---END--- An example:
 if header =^Subject:!=^Subject:[ ]*urgent
    signature = yes
 fi The example above will always add a signature file, except an email with the subject "urgent". ACTION LIST:
 ADD = HEADER LINE
 REMOVE = HEADER LINE (REGEX)
 MODIFY = NEW HEADER LINE
 ROT13-SUBJECT = yes|no
 ROT13-BODY = yes|no
 SIGNATURE = yes|no
 BODY-ATTACH = FILE NAME
 BODY-CLEAR-ATTACH = FILE NAME
 GPG-ENCRYPT = GPG KEY(S)
 GPG-SIGN = PASSWORD
 RM-RRT = EMAIL ADDRESS
 RM-POST = NEWS GROUP
 RM-GPG = GPG KEY
 RM-HEADER = HEADER LINE
 RM-LT = TIME
 RM-RLT = yes|no
 EXTERNAL-BODY-PROCESSOR = FILE NAME [ARGS]

An example (~/.anubisrc):
 ---BEGIN REGEX---
 IF HEADER =^X-Mailer:
    REMOVE =^X-Mailer:
    ADD = X-EXTRA: TEST
    GPG-SIGN = your password
    SIGNATURE = yes
 FI
 ---END---

The example above will remove (on-the-fly) the "X-Mailer:" line from an outgoing email, add an extra header line (X-EXTRA:), sign your message with your private key, and add a simple signature file from your home directory. Dynamic Commands Manipulation system (aka DCM) (USER MODE ONLY)

@@ -> enables the DCM system.

An example (~/.anubisrc):
 ---BEGIN REGEX---
 IF HEADER =^gpg-encrypt-john
    GPG-ENCRYPT = john's_gpg_key
 FI
 ---END---

Now you can simply send an email with the following subject: "hello John!@@gpg-encrypt-john" to process an outgoing email with the rule above -> encrypt message with a John's private key. Moreover the DCM will remove the '@@', so John will only receive a message with the subject "hello John!".

FILES

/etc/anubisrc - supervisor's run control file

~/.anubisrc - client's run control file

SEE ALSO
grep(1), regex(7), perlre(1), pcre(3), sendmail(8), openssl(1), gpg(1), identd(1)

AUTHORS
The Anubis Team (read the AUTHORS file).

Anubis Home Page:
http://anubis.sourceforge.net/

LICENSE

Anubis is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Anubis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Anubis is released under the GPL with the additional exemption that compiling, linking, and/or using OpenSSL is allowed.