JCA adaptor for incoming and outgoing mail using JBoss Mail Server
------------------------------------------------------------------
Key: JBMAIL-38
URL: http://jira.jboss.com/jira/browse/JBMAIL-38
Project: JBoss Mail
Type: Feature Request
Reporter: Andrew Oliver
Assigned to: Andrew Oliver
Priority: Critical
Fix For: 1.0-M4
A JCA adaptor for generic use of the mail server should be created for both
sending and retrieving mails.
The following are conceptual interfaces.
Context ctx = new InitialContext();
MailServer svr = (MailServer)ctx.lookup("java://mail/Server");
if (svr.checkMail();) { // current associated JAAS user is assumed
int ids[] = svr.getMailIds();
for (int k =0; k < ids.length; k++) {
System.out.println("reading mail "+ids[k]);
Mail mail = srv.getMail(ids[k]);
MailHeaders headers = mail.getHeaders();
InputStream stream = mail.getBody();
printHeaders(headers);
printBody(stream);
}
}
MailUserContext muc = new MailUserContext("user","password");
svr.setUser(muc);
if (svr.checkMail(muc)) {
int ids[] = svr.getMailIds("foldername");
...
}
Mail[] mail = svr.findMail("where SUBJECT like 'I like AOP' and FROM like
'bburke');
For the first edition I do not want to support searching in bodies.
Mail mail = new Mail();
mail.setContentType("text/plain");
mail.setBody("I like cheese.");
mail.setTo("<[EMAIL PROTECTED]>");
mail.setFrom("<[EMAIL PROTECTED]>"); // should follow validate-identity rules
(when enabled) for validating the JAAS user against the From.
svr.sendMail(mail);
svr.fetch("folder"); // force a fetchmail to happen for the current
authenticated user and block until it returns (if the user/folder aren't
configured to fetchmail from external server then this should probably return
without error)
svr.fetchAsynch("folder"); //suggest that the server run a fetchmail and return
For a later revision I want an inbound/event driven version as well.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development