Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-31-2006, 01:54 AM   #1
Registered: Jun 2006
Posts: 32

Rep: Reputation: 15
tmda HOWTO

Tagged Message Delivery Agent

Ok, first, I'm new to setting up mail so this may be sloppy but it's for people who use sendmail, procmail, have their own mail server for simple personal correspondence and need a quick guide to setting up a simple SPAM solution and don't want to sort out all the info from

Second, if anyone has more in depth knowledge of tmda, please give suggestions. I.e., I have 2 users I set up TMDA for. Is there a global directory I can use for all users as opposed to creating individual ~/.tmda directories?

You need:
python 2.1 or higher

Once tmda and python are installed, create the following directories and files for the user.



Generate your tmda key:

tmda-keygen > /home/$USER/.tmda/crypt_key ; chmod 400 /home/$USER/.tmda/crypt_key

Then create your /home/$USER/.tmda/config

# -*- python -*-

# See for descriptions of all
# the available options.
# NOTE: ~/.tmda/config must be chmod 400 or chmod 600 !



DELIVERY = "/var/spool/mail/$USER"

And then your /home/$USER/.procmailrc (NOTE: the next two lines are important)

# Uncomment this for users without valid shells in /etc/passwd.
# SHELL=/bin/sh

# Set the necessary environment variables.
SENDER=`formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'`

# Run the message through tmda-filter.
:0 w
| /usr/bin/tmda-filter

# Take the exit code from TMDA.

# TMDA takes care of final delivery

If you want to create a whitelist of email addresses you definitely want to receive email from, do:

echo from-file ~/.tmda/lists/whitelist ok > /home/$USER/.tmda/filters/incoming

and then add your email addresses on separate lines in your:


Emails that are sent from people not in your whitelist will receive a confirmation email that they need to reply to in order for you to get their email. Those in your whitelist will go directly to your inbox.

Again this is a quick run through to get it going. I spent an hour or so trying to get everything sorted out and working. Hope it helps someone.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
slow delivery in qmail+tmda brazilian_user Linux - Networking 4 08-02-2006 09:37 AM
Howto... Skorch_Creature Linux - Hardware 2 05-22-2006 03:30 PM
Howto - 2.6.10 artistikone Slackware 3 01-27-2005 05:33 PM
spamassassin? why not TMDA illtbagu Linux - Software 2 11-23-2003 12:03 PM
Howto update KDE and howto switch off kdm/gdm Canaris Linux - Software 1 06-15-2003 08:40 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration