Joachim Draeger wrote:
Yet another proposal, go James go! ;-)
Discussing jSieve usage, the question came up where to put the scripts.
There are number of possibilities... File, DB, LDAP etc, etc.
At the moment every Mailet that should work on a per user basis has to
implement it's own backend. (e.g. JDBC)
I have the idea of a repository that simply deals with streams. That way
everything could be easily stored. Text (like a script), XML, serialized
objects, property files.
public interface UserDataRepository {
/** @param key something like org.apache.james.mailet.SieveMailet */
public InputStream getUserDataInputStream(User user, String key);
public OutputStream getUserDataOutputStream(User user, String key);
}
A virtual backend could map different keys to different backends.
In backend configuration, keys could be mapped to e.g. custom filenames
like
"org.apache.james.mailet.SieveMailet" ->
"/home/%user_name/.sieve_script"
Joachim
Hi Joachim,
I think that creating something generic using stream is not a good
option. TO implement it safely against LDAP or JDBC we will have anyway
to buffer them to bytebuffers and to manage the stream on the otherside.
So maybe that adding simple user attributes (map of string=>serializable
objects) like we have in mail object is simpler and solve this issue anyway.
WDYT ?
Another option would be to start using some expression languange in
configurations ala OGNL. We could have an option to declare the scope of
the configuration and recalculate some configuration per mail (so maybe
we could user ${recipients[1]} ${authuser} ${sender} and so on in config
value).
Ok, this is much more complex than what you proposed and probably OT but
I thought this in past to allow naming repositories based on some
configurable option so I think this was somewhat related to this.
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]