Is that possible to read mail that is not stored by current mail repository object? Thanks a lot.
On 5/12/06, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
If you use James from trunk (or anything newer than James 2.2.0) you have to use ServiceManager instead of ComponentManager, Service instead of Component and ServiceException instead of ComponentException. The context attribute has not been changed: Constants.AVALON_COMPONENT_MANAGER Stefano haipeng du wrote: > How could I create repository object myself so that I can save, send , and > delete mail on my own. I just try the same as in ToRepository mailet, > > ComponentManager compMgr = > (ComponentManager)getMailetContext().getAttribute( > Constants.AVALON_COMPONENT_MANAGER); > try { > MailStore mailstore = (MailStore) compMgr.lookup(" > org.apache.james.services.MailStore"); > DefaultConfiguration mailConf > = new DefaultConfiguration("repository", > "generated:ToRepository"); > mailConf.setAttribute("destinationURL", repositoryPath); > mailConf.setAttribute("type", "MAIL"); > repository = (MailRepository) mailstore.select(mailConf); > } catch (ComponentException cnfe) { > log("Failed to retrieve Store component:" + cnfe.getMessage ()); > } catch (Exception e) { > log("Failed to retrieve Store component:" + e.getMessage()); > } > But the ComponentManager class may not be used in the future. It is > deprecated. How could I do with serviceManager. Do you have some examples? > Thanks a lot. > > On 5/12/06, Norman Maurer <[EMAIL PROTECTED]> wrote: >> >> Have you check the logs ? any exceptions ? >> >> bye >> Norman >> >> Am Donnerstag, den 11.05.2006, 15:48 -0600 schrieb haipeng du: >> > I use 2.2.0. I just want to delay send some mail out, for example after >> 48 >> > hours. First, I send these email to my special repository(for example >> > "scheduled", defined by myself). After 48 hours, I copy these files to >> > outgoing folder that I assume remote delivery mailets will help me to >> send >> > them out. >> > I try "FromRepository". It works. But even i give <delete>true</delete> >> like >> > this, it does not delete files as I hope. I do not know why. >> > Thanks a lot. >> > >> > On 5/11/06, Norman Maurer <[EMAIL PROTECTED]> wrote: >> > > >> > > Am Donnerstag, den 11.05.2006, 14:35 -0600 schrieb haipeng du: >> > > > I set up remote delivery mailet to send email out. I just copy >> files >> > > from >> > > > inbox to outbox. It dose not work. If I restart the james server, >> mails >> > > in >> > > > outgoing box were sent out. How could I set up james so that it can >> send >> > > > outgoing email at runtime? >> > > > Thanks a lot. >> > > > >> > > >> > > I don'T understand what you want.. First which james version you >> use ? >> > > Maybe the FromRepository mailet can be usefull. >> > > Do you just want to resend the emails ? In the current trunk you can >> > > force james to do this by setting the message state to "error" and >> the >> > > error_message to "0". >> > > >> > > bye >> > > Norman >> > > >> > > >> > > -----BEGIN PGP SIGNATURE----- >> > > Version: GnuPG v1.4.2.2 (GNU/Linux) >> > > >> > > iD8DBQBEY6SOUWWO/2C5ZWARAq3jAKDC+jknbESo43SG83PytYwi8cEDLgCfQcdE >> > > zyCt2uER57tAbGbRNyHmtjw= >> > > =hGX5 >> > > -----END PGP SIGNATURE----- >> > > >> > > >> > > >> > >> > >> >> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.2.2 (GNU/Linux) >> >> iD8DBQBEZCkfUWWO/2C5ZWARAvNHAKDLWNRR6o77D5sLL2kCtvlxW8L3vgCgtLZk >> MdxBiPSsH8g2d5jXGXMJDwc= >> =X8Tj >> -----END PGP SIGNATURE----- >> >> >> > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Haipeng Du Software Engineer Comphealth, Salt Lake City