Thank you, it helped a lot.
Marco
----- Original Message -----
From: "Vincenzo Gianferrari Pini" <[EMAIL PROTECTED]>
To: "James Users List" <[EMAIL PROTECTED]>
Sent: Thursday, August 07, 2003 7:14 AM
Subject: RE: [ANN] James v2.2.0a9 Test Build
A mail attribute is a named (keyed) object that can be set in a mail message
and later on get/reset/removed again.
Mail attributes are stored in a org.apache.mailet.Mail object as a HashMap
field, and can be accessed and removed through the following methods defined
in the org.apache.mailet.Mail interface (see the javadoc):
Serializable getAttribute(String name);
Iterator getAttributeNames();
boolean hasAttributes();
Serializable removeAttribute(String name);
void removeAllAttributes();
Serializable setAttribute(String name, Serializable object);
Although being stored in a HashMap, only String keys are allowed in a mail
attribute.
The value can be any Serializable object, not only a String.
Mail attributes are kept persistent and, as such, serialized together with
the mail container in the various mailstores (spools, inboxes etc). They are
*not* part of the MimeMessage itself, so do not live outside the server
(i.e. they are not message headers, although very similar from many points
of view).
They can be set anywhere in the James server code (including mailets) and
get also anywhere.
Typical usages include communication between matcher and mailets,
controlling endless loops in a config.xml etc.
The following matchers and mailets are available for manipulating mail
attributes from within a config.xml file, and others will come:
HasMailAttribute, SetMailAttribute, RemoveAllMailAttributes and
RemoveMailAttribute.
As an example of usage (already implemented), if the sender of a mail was
SMTPAuth-enticated, the "org.apache.james.SMTPAuthUser" mail attribute is
set with the name of the user as a string; it can be further checked using
the above methods and matchers plus the following dedicated matchers:
SMTPAuthSuccessful and SMTPAuthUserIs.
Note the full package qualification used for the key of the attribute above:
users are encouraged to use fully qualified names for their own attributes,
to avoid overlaps.
Vincenzo
> -----Original Message-----
> From: Marco Tedone [mailto:[EMAIL PROTECTED]
> Sent: mercoled� 6 agosto 2003 11.40
> To: James Users List
> Subject: Re: [ANN] James v2.2.0a9 Test Build
>
>
> What is it a mail attribute? How could I see how to set up a mail
> attribute
> and take advantage from it? I had a look at Wiki, but there is no
> description yet.
>
> Thanks,
>
> Marco
> ----- Original Message -----
> From: "Noel J. Bergman" <[EMAIL PROTECTED]>
> To: "James-General Mailing List" <[EMAIL PROTECTED]>
> Cc: "James-User Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 06, 2003 1:19 AM
> Subject: [ANN] James v2.2.0a9 Test Build
>
>
> > The James v2.2.0a9 test build is available. PLEASE NOTE A NEW URL FOR
> > DOWNLOADING! The URL for all test builds is
> > http://cvs.apache.org/builds/james-server/test-build/.
> >
> > Change in this test build from James v2.2.0a8 include:
> >
> > Adding mail attributes support.
> >
> > Corrected file protocol URL, which fixes a classloader
> problem with Sun
> > JRE 1.4.2.
> >
> > Migrated to use Jakarta Commons DBCP (Mordred is still available, but
> > deprecated)
> >
> > Updated JavaMail to v1.3.1
> >
> > New Matchers:
> > SMTPAuthSuccessful
> > SMTPAuthUserIs
> > HasMailAttribute
> >
> > New Mailets:
> > RemoveAllMailAttributes
> > RemoveMailAttribute
> > SetMailAttribute
> >
> > The Wiki,
> http://nagoya.apache.org/wiki/apachewiki.cgi?JamesV2/Plans, has
> a
> > complete list of changes.
> >
> > Please test and report any problems, anomalies, performance
> changes (good
> or
> > bad), etc.
> >
> > --- Noel
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]