spring integration - SpringIntegration Mail Failed to create new store connection Unrecognised SSL message -


i have strange exception happens since week in production environment, sporadically. worked fine until now.

in code connecting using imap ms exchange server read emails. part of code still working ok.

once email has been read archived in subfolder. this part sending exception.

the exception "failed create new store connection".

and after message have following exception in traces:

javax.net.ssl.sslexception: unrecognized ssl message, plaintext connection?     @ org.springframework.integration.mail.mailreceivingmessagesource.receive(mailreceivingmessagesource.java:117)     @ org.springframework.integration.endpoint.sourcepollingchanneladapter.receivemessage(sourcepollingchanneladapter.java:144)     @ org.springframework.integration.endpoint.abstractpollingendpoint.dopoll(abstractpollingendpoint.java:192)     @ org.springframework.integration.endpoint.abstractpollingendpoint.access$000(abstractpollingendpoint.java:55)     @ org.springframework.integration.endpoint.abstractpollingendpoint$1.call(abstractpollingendpoint.java:149)     @ org.springframework.integration.endpoint.abstractpollingendpoint$1.call(abstractpollingendpoint.java:146)     @ org.springframework.integration.endpoint.abstractpollingendpoint$poller$1.run(abstractpollingendpoint.java:298)     @ org.springframework.integration.util.errorhandlingtaskexecutor$1.run(errorhandlingtaskexecutor.java:52)     @ org.springframework.core.task.synctaskexecutor.execute(synctaskexecutor.java:50)     @ org.springframework.integration.util.errorhandlingtaskexecutor.execute(errorhandlingtaskexecutor.java:49)     @ org.springframework.integration.endpoint.abstractpollingendpoint$poller.run(abstractpollingendpoint.java:292)     @ org.springframework.scheduling.support.delegatingerrorhandlingrunnable.run(delegatingerrorhandlingrunnable.java:54)     @ org.springframework.scheduling.concurrent.reschedulingrunnable.run(reschedulingrunnable.java:81)     @ java.util.concurrent.executors$runnableadapter.call(executors.java:471)     @ java.util.concurrent.futuretask.run(futuretask.java:262)     @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$201(scheduledthreadpoolexecutor.java:178)     @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run(scheduledthreadpoolexecutor.java:292)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)     @ java.lang.thread.run(thread.java:745) caused by: javax.mail.messagingexception: unrecognized ssl message, plaintext connection?;   nested exception is:     javax.net.ssl.sslexception: unrecognized ssl message, plaintext connection?     @ com.sun.mail.imap.imapstore.protocolconnect(imapstore.java:726)     @ javax.mail.service.connect(service.java:364)     @ javax.mail.service.connect(service.java:245)     @ javax.mail.service.connect(service.java:194)     @ org.springframework.integration.mail.abstractmailreceiver.connectstoreifnecessary(abstractmailreceiver.java:227)     @ org.springframework.integration.mail.abstractmailreceiver.openfolder(abstractmailreceiver.java:238)     @ org.springframework.integration.mail.abstractmailreceiver.receive(abstractmailreceiver.java:260)     @ org.springframework.integration.mail.mailreceivingmessagesource.receive(mailreceivingmessagesource.java:103) 

what think strange is when connect store happens. can still read emails no problems.

the exception thrown in piece of code:

public void savemessage(mimemessage message, string foldername) {     try {         folder folder = message.getfolder();         folder.open(folder.read_write);         // mark message delete in folder         string messageid = message.getmessageid();         message[] messages = folder.getmessages(); 

it seems getfolder sends message.

what can't figure out why have ssl exception when try access store, while same uri used without issue read emails.

i have following configuration:

<int:channel id="receivechannel" datatype="javax.mail.internet.mimemessage"/>  <int-mail:inbound-channel-adapter id="incomingemailsadapter"     store-uri="${inboundmail.storeuri}"     channel="receivechannel"     should-delete-messages="false"     should-mark-messages-as-read="true"     auto-startup="${inboundmail.startup}"     java-mail-properties="javamailinboundproperties">     <int:poller max-messages-per-poll="${inboundmail.nb.poll}" fixed-rate="${inboundmail.nb.rate}"/> </int-mail:inbound-channel-adapter>  <util:properties id="javamailinboundproperties">     <prop key="mail.imap.socketfactory.class">javax.net.ssl.sslsocketfactory</prop>     <prop key="mail.imaps.ssl.trust">*</prop>     <prop key="mail.imap.socketfactory.fallback">false</prop>     <prop key="mail.store.protocol">imaps</prop>     <prop key="mail.debug">${inboundmail.debug}</prop> </util:properties>  <int:service-activator id="serviceactivator" input-channel="receivechannel" ref="mailservice" method="handlemail"/> 

with:

inboundmail.storeuri = imaps://unknown:redacted@company.com:993/inbox

why can read emails uri, , can not open store same one?

this issue happens several times day, since week.

any idea come from?

thanks

gilles


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -