james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: svn commit: r420100 - /james/server/trunk/src/java/org/apache/james/smtpserver/SpamAssassinHandler.java
Date Sat, 08 Jul 2006 14:37:29 GMT
Several comments inline:

> + // Not scan the message if relaying allowed

Should that be configurable?

> + Iterator headers = sa.getHeaders().keySet().iterator();
> + // Add the headers
> + while (headers.hasNext()) {
> +   String key = headers.next().toString();
> +   message.setHeader(key, (String) sa.getHeaders().get(key));
> + }

Do we want to add the header's now, or set attributes that we can map to headers later?  Personally,
I'm leaning towards the latter.  We might even have a generic mailet along the lines:

  <mailet match="All" class="Attributes2Headers">
    <attribute name="org.apache.james.SpamAssassin-Status>
      <mapping> <!-- optional (see AbstractVirtualUser.regexMap for idea) -->
        <regex>...</regex> <!-- regex to match against attribute value -->
        <value>...</value> <!-- parameterized string to build header   -->
    <attribute name="...">

This would give us more control over header names and content (if there were no mapping element,
the value would be copied directly).  For example, the ASF version of the header looks like:

  X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME

And it would also be more efficient, since we could modify the message just once, rather than
each time we want to add meta-data.

> + String responseString = "554 "
> +        + DSNStatus.getStatus(DSNStatus.PERMANENT,
> +                              DSNStatus.SECURITY_OTHER)
> +        + " This message smells like SPAM. Message rejected";

Please use more useful and less "cutsie" replies.  This reply is not useful to a sender who
might want to resolve the problem.  And once again, I would turn to a generalized version
of the regexMap code to allow the administrator to configure precisely the content of the
string portion of the response.  This approach to message strings, possibly combined with
XMLResources, could become pervasive in JAMES v3 and later.

	--- Noel

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message