Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Search Term Strategy - ImapMailReceiver 2.2.0.RC2

  1. #1
    Join Date
    Oct 2012
    Posts
    5

    Default Search Term Strategy - ImapMailReceiver 2.2.0.RC2

    Hi everybody!

    I'm trying to use the new feature to create my own SearchTermStrategy, because I need to get all the mails which have not set the SEEN flag.

    I'm using the inbound-channel-adapter and not the imap-idle-channel-adapter for receiving mails by imap protocol. Somehow the schema validation tells me that it is not valid to use the "search-term-strategy" for an inbound-channel-adapter.

    My configuration is mainly the same as in your documentation:
    http://static.springsource.org/sprin...l#mail-inbound

    Is there any possibility to create my own SearchTermStrategy when not using imap-idle-channel-adapter?

    Cheers,
    Mikael

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    The search-term-strategy is currently only supported on the imap-idle adapter.

    However, the default strategy already includes the 'Not SEEN' rule (if supported by the server)...

    (RECENT and NOT ANSWERED and NOT DELETED and NOT SEEN)
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Oct 2012
    Posts
    5

    Default

    Thanks for your answer!

    My problem is that I would need to get every mail which is set as UNREAD, so that I get the mail again when the user marks it as unread. This does not work with the current SearchTerms, because as I think, the mail is not anymore flagged as RECENT.

    Is there any workaround?

    Thanks for your help!

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    You can wire up the adapter using <bean/> definitions instead of using the namespace.

    You need a SourcePollingChannelAdapterFactoryBean; this needs properties

    source - a MailReceivingMessageSource
    outputChannel - ref to a <channel/>
    pollerMetadata - ref to a <poller/>


    The MailReceivingMessageSource needs a <constructor-arg/> which, in your case, would be an ImapMailReceiver.

    When defining your ImapMailReceiver, you can inject your custom SearchTermStrategy into it using the searchTermStrategy propery.


    Please go ahead and open a New Feature JIRA ticket; it seems reasonable to me that we should allow this to be configured using the namespace.

    https://jira.springsource.org/browse/INT
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    Oct 2012
    Posts
    5

    Default

    Thank you for the description of the workaround, it's almost working

    My problem is now, that I can't access anymore the attachment in the mail which was working with version 2.1.4, I compared a bit the source of the ImapMailReceiver and I think it could have something to do that the messages aren't anymore copied before they're passed to the outputChannel. When accessing the attachment later I get a FolderClosedException.

    Thanks,
    Mikael

  6. #6
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    I believe you are correct - that looks like a bug in 2.2 to me.

    However, you should be able to use the <bean/> technique using 2.1.4.

    Is there some other reason you are using the 2.2. RC?
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  7. #7
    Join Date
    Oct 2012
    Posts
    5

    Default

    I'm using 2.2 because I need to define my own search term strategy. Version 2.1.4 does not yet provide this possibility, right?

  8. #8
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    Duh - of course; sorry.

    Let me look into the copy problem; I'll get back to you.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  9. #9
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    I opened a ticket https://jira.springsource.org/browse/INT-2803

    We expect to release RC3 shortly.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  10. #10
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    Given that we have to fix this problem, I have also scheduled to get INT-2800 into RC3 as well because it really was an omission.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •