After think more about the code we should maybe do better something like:

<handler class="org.apache.james.smtpserver.core.filter.fastfail.DNSRBLHandler" 
onCommand="RCPT">
   <action> reject </action>
</handler>

or:

<handler class="org.apache.james.smtpserver.core.filter.fastfail.DNSRBLHandler" 
onCommand="RCPT">
   <action> junkScore </action>
   <match> +10 </match>
   <notmatch> 0 </notmatch>
</handler>

So the admin can maybe substract scores if he want etc..
The JunkScore Object also needs to hold one Map with scores which used for the 
whole session and one which used per message.

Maybe something like:

public Map getStoredScores();
public Map getStoredSessionScores();
public int getStoredScore(String key);
public int getStoredSessionScore(String key);
public int getCompleteStoredScores();
public int getCompleteStoredSessionScores();
public int getMergedStoredScores();
public int addStoredScore(String key,int score);
public int addStoredSessionScore(String key,int score);
public int removeStoredScore(String key);
public int removeStoredSessionScore(String key);
public int resetStoredScores();
public int resetStoredSessionScores();

Any thoughts ?


bye
Norman

Norman Maurer (JIRA) schrieb:
Add more actions to FastFailHandlers -------------------------------------

                 Key: JAMES-614
                 URL: http://issues.apache.org/jira/browse/JAMES-614
             Project: James
          Issue Type: New Feature
          Components: SMTPServer
            Reporter: Norman Maurer
         Assigned To: Norman Maurer
             Fix For: 3.0


From ML:

Norman Maurer wrote:
Hi,
after i talk with Stefano and later noel in skype the some idea raised.
Here it is:

1. Change every fastfail filter to allow more actions then reject. It
should be possible to assign socres to a handler when it match. So the
admin can react on such scores later. Something like:

<handler class="org.apache.james.smtpserver.core.filter.fastfail.DNSRBLHandler" 
onCommand="RCPT">
    <action> reject </action>
</handler>

or:

<handler class="org.apache.james.smtpserver.core.filter.fastfail.DNSRBLHandler" 
onCommand="RCPT">
    <action> +10 </action>
</handler>

+1
I would use a text identifier even for the score rule:
<action> junkScore: 10 </action>
(maybe we should also be able to specify what key to use when storing
the score in the map because we could have multiple handler having the
same class bug configured differently).

2. Create an class which represent the object to store the scores in. It
should provide a HashMap with the handler as key and the score it
stores. Also methods for acess the data and modify it etc.
Something like:

int getCompleteStoredScores();
HashMap getStoredScores();
String getStoredScore(String key);
void setStoredScore(String key, int score);
void resetStoredScores();

+1

3. Add handler/mailet/matcher to react on the score.
Maybe something like:

<handler class="org.apache.james.smtpserver.core.filter.fastfail.ScoreHandler">
    <rejectScore> 100 </rejectScore>
</handler>

Any ideas etc ?

s/ScoreHandler/JunkScoreHandler/

Stefano




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to