integrating tmda

Hi, We are trying to get tmda, tmda-cgi, tmda-ofmipd integrated into our mailing system. We use procmail for the mail delivery with postfix mta. we also have spamassassin checks happening through procmail. The addition of tmda is not working out as virtualmin does some processing with the mails and then does not return the user field which can be used by tmda to send the mail to the correct user maildir.

If you could advise us on this integration or let us know if there is some documentation available on how to do this it would be a big help.



I haven't used TMDA myself, but it should work if run from procmail ..

What are you adding to /etc/procmailrc exactly, and how is it failing?

Thanks for your response, Jamie.

I believe the issue is that procmail passes the mail to spamassassin, and then there's no way to capture the email after SA is done processing it.

I'm having a member on my staff working on integrating TMDA into my virtualmin setup -- he just filed this ticket because of problems he's run into, specifically hooking in past spamassassin (i.e. no problem going from procmail to tmda if we dropped spamassassin - which we don't want to do - but how do we go procmail + spamassassin + tmda?) i.e. does SA return control to procmail after it's done processing, or how else can we intercept the email past the SA processing?

Let me know if this makes more sense. :-)

In a standard Virtualmin procmail setup, mail is first processed by /etc/procmailrc and then handed off to /etc/webmin/virtual-server/procmail/XXX , there XXX is the domain's unique ID. This calls spamassassin, and may deliver mail to ~/Maildir/.spam if a message is classified as spam. It may also run ClamAV and delivery virus-laden messages to /dev/null .

If the message appears safe, processing will fall back to /etc/procmailrc and eventually be delivered to the user's mailbox.

So perhaps you should add your TMDA call near the end of /etc/procmailrc , but before any final delivery recipe like :


Thanks Jamie - we'll look into this.

Hi Jamie,
I am the sysad working on the integration! Here's what's happening:

Uncaught Python 2.4.3 Exception (Tue Sep 15 14:41:37 2009):
Traceback (most recent call last):
File "/home/imtiaz/src/tmda-1.1.12/bin/tmda-filter", line 53, in ?
execfile(os.path.join(execdir, 'tmda-rfilter'))
File "/home/imtiaz/src/tmda-1.1.12/bin/tmda-rfilter", line 236, in ?
raise Errors.MissingEnvironmentVariable('SENDER')

The lines above are in the debug log for tmda.

The procmailrc looks like this:

VIRTUALMIN=|/etc/webmin/virtual-server/ $LOGNAME
* ?/usr/bin/test "$VIRTUALMIN" != ""
# Running the message through tmda-filter.
:0 w
# Take the exit code from TMDA.
# TMDA takes care of final delivery

Essentially the SENDER is not set after spamassassin returns control back to procmail. Is this something you would know about or can assis with.


I'm not sure where the SENDER variable comes from, as it is not mentioned in the procmailrc man page.

I would have expected TMDA to work it out from the mail contents actually .. such as the From: line.