Hi Daniel, Sorry for the delay... I never tried it but I think your could iterate over the mails in the repository and use a HeaderTerm to see if the mail match .. Let me know if it works ..
For more infos: http://java.sun.com/products/javamail/javadocs/javax/mail/search/HeaderTerm.html Maybe you can store all stuff in a Inbox and build a service which do the work all 30 minutes. The Service can do something like ( example): ------------------------------------------------------------------------- List mails = new ArrayList(); HeaderTerm term = new HeaderTerm(headerName,searchPattern); Iterator inboxIt = inbox.list(); while (inboxIt.hasNext()) { String key = (String) inboxIt.next(); Mail m = inbox.retrieve(key); if (term.match(m.getMessage())) { mails.add(m); } } return mails; ------------------------------------------------------------------------------------------------------------- bye Norman Ps: Let us know if you need any further help Daniel Gradecak schrieb: > Sorry I forgot to specify that I did not find how to get only with > java mail api the email that has a speccial header attribute, as you > mentioned. > Is that possible ... ? > > Daniel Gradecak wrote: >> Hi Norman, >> >> do you know if the mail is given the "Mail.getName(); " even before >> it is actually stored in an inbox? and is there a way to get an email >> according to its name >> inside embeded james (i could embed it in spring) ? I mean that I do >> not need to get the whole "inbox" and iterate over it ... any ideas? >> is the same thing possiblke with the java mail api (i did not find it)? >> >> Please if anything of that is possible give me a hint;) >> >> Regarding, >> Daniel >> >> Norman Maurer wrote: >>> Hi Daniel, >>> >>> in james you get an unique id via: >>> Mail.getName(); >>> >>> But this name is only valid in james and not javamail. Maybe you could >>> add an unique id as mailheader in the email to use it later via >>> javamail ? >>> >>> bye >>> Norman >>> >>> Daniel Gradecak schrieb: >>> >>>> Hello, >>>> >>>> is it possible somehow, to get the unique ID of an email via a >>>> mailet ? >>>> >>>> I would like to send a message to a JMS queue saying there is a new >>>> email, but the "jms mailet" is processed before the delevery to the >>>> storage. so I wonder if it is somehow >>>> possible to get the mail ID so I can send the jms message with that ID >>>> included ... so later on I can access it via java mail api? or is >>>> there a better way to access directly >>>> an email stored on james than using java mail api ? >>>> >>>> I am not even sure if it could be done via the java mail api to >>>> retrieve a specific email according to its ID ? >>>> >>>> Regards, >>>> Daniel >>>> >>>> --------------------------------------------------------------------- >>>> 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] > > > !DSPAM:1,463d0fbb79381520557788! > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
