You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-integration-mail/src/main/java/org/springframework/integration/mail/config/ImapIdleChannelAdapterParser.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ private BeanDefinition parseImapMailReceiver(Element element, ParserContext pars
Copy file name to clipboardExpand all lines: spring-integration-mail/src/main/java/org/springframework/integration/mail/dsl/ImapIdleChannelAdapterSpec.java
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -368,6 +368,20 @@ public ImapIdleChannelAdapterSpec shouldReconnectAutomatically(boolean shouldRec
368
368
returnthis;
369
369
}
370
370
371
+
/**
372
+
* How often to recycle the idle task (in case of a silently dropped connection).
Copy file name to clipboardExpand all lines: spring-integration-mail/src/main/java/org/springframework/integration/mail/dsl/ImapMailInboundChannelAdapterSpec.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@
24
24
*
25
25
* @author Gary Russell
26
26
* @author Artem Bilan
27
+
*
27
28
* @since 5.0
28
29
*/
29
30
publicclassImapMailInboundChannelAdapterSpec
@@ -72,12 +73,13 @@ public ImapMailInboundChannelAdapterSpec shouldMarkMessagesAsRead(boolean should
Copy file name to clipboardExpand all lines: spring-integration-mail/src/main/resources/org/springframework/integration/mail/config/spring-integration-mail-5.2.xsd
Copy file name to clipboardExpand all lines: spring-integration-mail/src/test/java/org/springframework/integration/mail/config/ImapIdleChannelAdapterParserTests-context.xml
Copy file name to clipboardExpand all lines: spring-integration-mail/src/test/java/org/springframework/integration/mail/config/ImapIdleChannelAdapterParserTests.java
+26-22Lines changed: 26 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -58,25 +58,26 @@ public class ImapIdleChannelAdapterParserTests {
Copy file name to clipboardExpand all lines: src/reference/asciidoc/mail.adoc
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -353,7 +353,7 @@ By default, the `ImapMailReceiver` searches for messages based on the default `S
353
353
354
354
The custom user flag is `spring-integration-mail-adapter`, but you can configure it.
355
355
Since version 2.2, the `SearchTerm` used by the `ImapMailReceiver` is fully configurable with `SearchTermStrategy`, which you can inject by using the `search-term-strategy` attribute.
356
-
`SearchTermStrategy` is a strategy interface with a single method that lets you create an instance of the `SearchTerm` used by the `ImapMailReceiver`.
356
+
A `SearchTermStrategy` is a strategy interface with a single method that lets you create an instance of the `SearchTerm` used by the `ImapMailReceiver`.
357
357
The following listing shows the `SearchTermStrategy` interface:
358
358
359
359
====
@@ -417,8 +417,7 @@ IMPORTANT: In both configurations, `channel` and `should-delete-messages` are re
417
417
You should understand why `should-delete-messages` is required.
418
418
The issue is with the POP3 protocol, which does not have any knowledge of messages that were read.
419
419
It can only know what has been read within a single session.
420
-
This means that, when your POP3 mail adapter runs, emails are successfully consumed as as they become available during each poll
421
-
and no single email message is delivered more then once.
420
+
This means that, when your POP3 mail adapter runs, emails are successfully consumed as as they become available during each poll and no single email message is delivered more then once.
422
421
However, as soon as you restart your adapter and begin a new session, all the email messages that might have been retrieved in the previous session are retrieved again.
423
422
That is the nature of POP3.
424
423
Some might argue that `should-delete-messages` should be `true` by default.
@@ -434,6 +433,10 @@ Leaving it up to you also means that you are less likely to end up with unintend
434
433
NOTE: When configuring a polling email adapter's `should-mark-messages-as-read` attribute, you should be aware of the protocol you are configuring to retrieve messages.
435
434
For example, POP3 does not support this flag, which means setting it to either value has no effect, as messages are not marked as read.
436
435
436
+
In case of silently dropped connection, an idle cancel task is run on background periodically (a new IDLE will usually immediately be processed).
437
+
To control this interval, a `cancelIdleInterval` option is provided; default 120 (2 minutes).
438
+
RFC 2177 recommends an interval no larger than 29 minutes.
439
+
437
440
[IMPORTANT]
438
441
=====
439
442
You should understand that that these actions (marking messages read and deleting messages) are performed after the messages are received but before they are processed.
@@ -502,7 +505,8 @@ In the preceding example, thanks to the `mail-filter-expression` attribute, only
502
505
503
506
Another reasonable question is what happens on the next poll or idle event or what happens when such an adapter is restarted.
504
507
Can there be duplication of massages to be filtered? In other words, if, on the last retrieval where you had five new messages and only one passed the filter, what would happen with the other four?
505
-
Would they go through the filtering logic again on the next poll or idle? After all, they were not marked as `SEEN`.
508
+
Would they go through the filtering logic again on the next poll or idle?
509
+
After all, they were not marked as `SEEN`.
506
510
The answer is no.
507
511
They would not be subject to duplicate processing due to another flag (`RECENT`) that is set by the email server and is used by the Spring Integration mail search filter.
508
512
Folder implementations set this flag to indicate that this message is new to this folder.
0 commit comments