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>
<header>X-Spam-Status</header>
<mapping> <!-- optional (see AbstractVirtualUser.regexMap for idea) -->
<regex>...</regex> <!-- regex to match against attribute value -->
<value>...</value> <!-- parameterized string to build header -->
</mapping>
</attribute>
<attribute name="...">
...
</attribute>
</mailet
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]