<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/integration/mail https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd
		http://www.springframework.org/schema/task https://www.springframework.org/schema/task/spring-task.xsd
		http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd"
	xmlns:int="http://www.springframework.org/schema/integration"
	xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
	xmlns:task="http://www.springframework.org/schema/task"
	xmlns:util="http://www.springframework.org/schema/util">

	<!--

		IMAP and IMAP IDLE sample configuration to use with Gmail
		There is no test to back this up, just a sample config to use with your tests
	 -->

	<int-mail:imap-idle-channel-adapter id="customAdapter"
			store-uri="imaps://[username]:[password]@imap.gmail.com/INBOX"
			channel="receiveChannel"
			auto-startup="true"
			should-delete-messages="false"
			java-mail-properties="javaMailProperties"/>

	<int-mail:inbound-channel-adapter id="imapAdapter"
			store-uri="imaps://[username]:[password]@imap.gmail.com/INBOX"
			java-mail-properties="javaMailProperties"
			channel="receiveChannel"
			should-delete-messages="true"
			auto-startup="true">
			<int:poller max-messages-per-poll="1" fixed-delay="5000" />
	</int-mail:inbound-channel-adapter>

	<int:channel id="receiveChannel"/>

	<int:service-activator  input-channel="receiveChannel">
		<bean class="org.springframework.integration.mail.config.GoogleTest.SampleReceiver"/>
	</int:service-activator>

	<util:properties id="javaMailProperties">
		<prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
		<prop key="mail.imap.socketFactory.fallback">false</prop>
		<prop key="mail.store.protocol">imaps</prop>
		<prop key="mail.debug">false</prop>
	</util:properties>

	<task:executor id="executor" pool-size="5"/>
</beans>
