Am Samstag, den 08.07.2006, 16:51 +0200 schrieb Stefano Bagnara:
> Noel J. Bergman wrote:
> >> + 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.
>
> I agree on this.
> We should not touch the MimeMessage if possible, and only store mail
> attributes that give us much more flexibility.
> About the Attributes2Headers I would name it MailAttributesToMimeHeaders
> and I would probably skip the regex part for the first version.
>
> Stefano
Maybe it could look like:
<mailet match="All" class="MailAttributesToMimeHeaders">
<map>org.apache.james.spamassassin.example1, headername</map>
...
...
...
</mailet>
bye
Norman
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
