You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Sid Stuart <si...@weaselworks.com> on 2003/04/25 17:06:59 UTC
Mailet feature request
The current interface definition org.apache.james.mailet.MailetContext
provides a single storeMail method,
void storeMail(MailAddress sender, MailAddress recipient,
MimeMessage msg)
throws MessagingException;
Would it be possible to add a second definition that passes a Collection
of recipients instead of just one recipient?
void storeMail(MailAddress sender, Collection recipients,
MimeMessage msg)
throws MessagingException;
This would allow the implementation of MailetContext to store a single
copy of the message content for all of the local recipients of a
message. Saving a single copy of the message content reduces the load on
the server. It also improves its robustness. A malevolent entity wishing
to disrupt the operation of the server could do so by sending an email
to multiple users with a very large attachment. If the server creates a
copy for each recipient, it multiplies the impact of the evil email.
Sid
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: Mailet feature request
Posted by Danny Angus <da...@apache.org>.
Sid
Addressing this in the context of our discussion of snedMail and storeMail..
> The current interface definition org.apache.james.mailet.MailetContext
> provides a single storeMail method,
> Would it be possible to add a second definition that passes a Collection
> of recipients instead of just one recipient?
Probably not, because...
MailetContext.storeMail is a convenience method used to store a message to a local account, each account can only have one owner, and therefore each storeMail call can only be for one address.
If you want to store mail for multiple recipients you'd have to iterate through the recipients and call storeMail for each.
If you want to perform more complex repository actions Mailet v3 provides a new method..
MailRepository MailetContext.getMailRepository(String specificationURL)
which returns a MailRepository per the specificationURL (like the James config repository URL's), creating one if it doesn't exist.
MailRepository in turn provides these methods..
void store(Mail mc);
Iterator list();
Mail retrieve(String key);
void remove(Mail mail);
void remove(String key);
boolean lock(String key);
boolean unlock(String key);
With which you can perform more complex activity directly on the repository.
If storeMail is thought to be less than useful I would be in favour of depercating it in favour of
MailetContext.getRepository(String specificationURL).store(Mail mail)
rather than have MailetContext become heavy with "convenience" methods for which perfectly adequate alternative exist.
Not only that but also.. it would pave the way for removing the incompatibility between POP and IMAP, with the MailetContext able to return both POP and IMAP user account repositories.
d.
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org