Lloyd,
This does sound like a good idea, but I would suggest that instead of
just one configuration variable, you stayed with the current precedents
within TMDA and created a variable for each action e.g.
PENDING_RELEASE_ACTION_HOOK. That way the external program or script
wouldn't need to know anything about the actions being passed to it as
parameters. It does of course mean that you would have to fill in a
variable for each action with which you want to perform some external
operation, but not every one will want to handle each TMDA action
externally.
Lloyd Zusman wrote:
After a more detailed investigation consisting of perusing the tmda
source code, I realize that there isn't currently any way to do all of
the things I outlined in my recent post on the tmda-user list (quoted
below).
Therefore, I am proposing that I write an enhancement to tmda that would
work as follows:
A new configuration variable would be created, called
PENDING_ACTION_HOOK. If defined, it would contain the name of an
executable program or script that would get invoked right before any of
the following actions are taken on a pending message:
release
delete
whitelist
blacklist
The program would be invoked as follows:
PROGRAM /path/to/pending/message ACTION
... where /path/to/pending/message is the full pathname of the file
containing the pending message
... and ACTION is one of the four actions named above
... and all of the tmda configuration variables will be in the
environment
This program could then perform any desired action, including to cause
the message to be "learned" in the way I described in my original
message.
One nice feature of this is that it would work both within tmda-cgi and
tmda, itself.
I don't think that it would be very difficult to write this and add it
to the code base. However, before I come up with a patch, I'd like to
discuss this with the rest of you, to get feedback, suggestions,
complaints, etc.
What do y'all think?
Here's the text of my original post:
I'm using both crm114[*] and tmda in the following manner:
1. An incoming message gets filtered through crm114. Based on this,
one of the following headers gets added to the message:
X-CRM114-Status: SPAM definitely spam
X-CRM114-Status: GOOD definitely non-spam
X-CRM114-Status: UNSURE not sure
2. The message then gets routed through tmda. Based on my filter
rules, the following occurs:
if status == SPAM then
store message in my "Spam" folder
else if status == GOOD then
release message to my default INBOX
else (status == UNSURE)
if sender has been previously confirmed then
*** learn message as non-spam
release message to my default INBOX
else
send out confirmation request
endif
endif
Note the line flagged with "***". This involves piping the message
through one of the crm114 utilities in order to cause it to be "learned"
as non-spam. Is there a way to cause this learning to automatically
occur without my hacking the source code of tmda?
Also, want to do more learning under three other cases. Each of these
applies to messages in the pending queue; i.e., those which were
previously marked as UNSURE by crm114:
A. The message has been sitting in the pending queue for the
PENDING_LIFETIME, and it is about to be automatically expired and
deleted. During this automatic expiration process, I'd like it to
be learned as spam by crm114.
B. Via tmda-cgi, I am manually deciding to release a pending message.
Therefore, I'd like it to be passed through the crm114 utility and
learned as non-spam as it's being released.
C. Via tmda-cgi, I am manually deciding to delete a pending message.
Therefore, I'd like it to be passed through the crm114 utility and
learned as spam as it's being deleted.
Are there any hooks in tmda and tmda-cgi that I can use for performing
the "***" item above as well as items A, B, and C ... without my having
to hack the source code of tmda or tmda-cgi?
Thanks in advance.
[*] http://crm114.sourceforge.net
begin:vcard
fn:David Grimberg
n:Grimberg;David
email;internet:[EMAIL PROTECTED]
x-mozilla-html:TRUE
version:2.1
end:vcard
_____________________________________________
tmda-users mailing list (tmda-users@tmda.net)
http://tmda.net/lists/listinfo/tmda-users