Submitted by HarryZink on Tue, 09/15/2009 - 04:32
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.
Status:
Active
Comments
Submitted by JamieCameron on Tue, 09/15/2009 - 11:46 Comment #1
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?
Submitted by HarryZink on Tue, 09/15/2009 - 11:50 Comment #2
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. :-)
Submitted by JamieCameron on Tue, 09/15/2009 - 12:01 Comment #3
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 :
:0
$DEFAULT
Submitted by HarryZink on Tue, 09/15/2009 - 14:51 Comment #4
Thanks Jamie - we'll look into this.
Submitted by netbrix on Tue, 09/15/2009 - 17:09 Comment #5
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')
MissingEnvironmentVariable
The lines above are in the debug log for tmda.
The procmailrc looks like this:
LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
:0
* ?/usr/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir
# Running the message through tmda-filter.
:0 w
|/usr/src/tmda-1.1.12/bin/tmda-filter
# Take the exit code from TMDA.
EXITCODE=$?
# TMDA takes care of final delivery
DEFAULT=/dev/null
DROPPRIVS=yes
:0
$DEFAULT
Essentially the SENDER is not set after spamassassin returns control back to procmail. Is this something you would know about or can assis with.
-imtiaz
Submitted by JamieCameron on Tue, 09/15/2009 - 17:39 Comment #6
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.