|
|
TMDA Server Configuration
TMDA processes incoming messages on the SMTP server though a mail
filter program called tmda-filter.
Server configuration instructions differ slightly based on whether you
are running qmail or not. First follow the general set of instructions, and then read the set
of instructions corresponding to your local configuration
[ qmail | non-qmail ]
After you are finished, you may want to report your success (from a
TMDA user's account, not root). If you installed from gzipped
tarball, change into the top-level TMDA directory first.
% ( python -c 'from TMDA.Defaults import *; print DELIVERY_AGENT' ) \
| mail jason-tmdausage@mastaler.com
TMDA Server Configuration (general)
- A unique, private key is required for every TMDA user. This key
is stored in your TMDA configuration file (~/.tmdarc). A
key-generation utility is included with the distribution. Simply run
tmda-keygen and follow its instructions.
- Populate your "whitelist" with e-mail addresses and/or wildcard
patterns, one per line, which are considered trusted contacts and
therefore allowed directly into your mailbox if the sender of an
incoming message matches the list. You might also add your own e-mail
address to make initial testing easier. By default your whitelist is
~/.tmda/lists/whitelist. See FAQ for details
on matching syntax.
- If necessary, create a ~/.tmda/lists/blacklist containing e-mail
addresses and/or wildcard patterns of senders you want to refuse mail from.
The blacklist syntax rules are the same as for the whitelist.
TMDA Server Configuration (qmail-only)
- Finish setting up your ~/.tmdarc and optionally a
system-wide /etc/tmdarc by reading through the included
sample.tmdarc file. CRYPT_KEY is the only entry
required for qmail users, but there may be other settings you want to
enable or change.
- Setup dot-qmail files appropriately in your home directory.
First setup .qmail as shown below, and then make a symbolic
link from there to .qmail-default. This way you will only
have to make changes to the one file.
See
dot-qmail(5)
if you are unfamiliar with how to use dot-qmail files to control the
delivery of mail messages.
dot-qmail file: |
file contents: |
action: |
.qmail |
| /path/to/tmda/bin/tmda-filter
./Mailbox
|
If the message is legitimate, it
will pass-through to the second line and get saved to "~/Mailbox",
otherwise it goes through the confirmation process.
|
.qmail-default |
symbolic link ($ ln -s ~/.qmail ~/.qmail-default) |
Catches jason-* as long as another dot-qmail file does not take priority. |
TMDA Server Configuration (non-qmail-only)
- Finish setting up your ~/.tmdarc and optionally a
system-wide /etc/tmdarc by reading through the
included sample.tmdarc file. CRYPT_KEY,
MAIL_TRANSFER_AGENT, LOCAL_DELIVERY_AGENT, and
RECIPIENT_DELIMITER are required entries for non-qmail users.
- Modify ~/.forward to send your mail through tmda-filter.
"| /path/to/tmda/bin/tmda-filter"
If this produces a bounce with an env: python: No such file or
directory error, you will need to add the full path to your Python
interpreter, e.g,:
"|/usr/local/bin/python /path/to/tmda/bin/tmda-filter"
- If you already filter your mail with procmail and wish to continue
doing so, you can invoke tmda-filter from your .procmailrc instead.
First, modify LOCAL_DELIVERY_AGENT in your ~/.tmdarc so
that it runs procmail with an separate rcfile (to avoid an infinite
loop):
LOCAL_DELIVERY_AGENT = "/path/to/bin/procmail ~/.procmailrc-tmda"
~/.procmailrc-tmda at a minimum might contain the location of
your default mailbox. e.g,
DEFAULT=/path/to/your/inbox
Next, make sure your ~/.forward calls procmail with the -p option:
"|/path/to/bin/procmail -p"
Finally, add the following snippet to the end of your existing .procmailrc
to do final delivery:
# Run the message through tmda-filter.
:0 w
| /path/to/tmda/bin/tmda-filter
# Take the exit code from TMDA.
EXITCODE=$?
# TMDA takes care of final delivery
DEFAULT=/dev/null
|