javamail - IMAP folder receives email Twice -


i trying develop email listener using java mail api. receiving same email twice, scenario not happening every time; randomly occurs.

the following code used make imap connection

try {             isconnecting.set(true);             createsession();             logger.warn("session created "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);             store = session.getstore("imap");             if(store==null){                 logger.warn("store null return here"+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                 return;             }             store.connect(imapserveraddress, imaploginid, imappasswrd);             logger.warn("connecting successful "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);             folder = store.getfolder(foldername);             logger.warn("folder creating "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);             if (timer == null) {                 timer = new hashedwheeltimer(1, timeunit.seconds);             }             if (idlemanager == null) {                 idlemanager = new idlemanager(session, es);             }             if (folder == null || !folder.exists()) {                 logger.warn("invalid folder exit here "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                 system.out.println("invalid folder");                 return;             }             synchronized (folder) {                 logger.warn("folder sync "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                 folder.addconnectionlistener(this);                 folder.open(folder.read_write);                 folder.addmessagecountlistener(this);                  system.out.println("message count listener added");                 logger.warn("message count listner added "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                 if (folder instanceof imapfolder) {                     imapfolder f = (imapfolder) folder;                     system.out.println("enter idle");                     logger.warn("idle condition "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                     idlemanager.watch(f);                     setisconnected(true);                     logger.warn("folder.watch "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                     dbutil.updatemediastream(getidentifier(), true);                     isconnecting.set(false);                     connectionattempt.set(0);                     logger.warn("db updated "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                     system.out.println("idle done");                     scheduletask();                     logger.warn("scheduler starts "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);                 }              }              system.out.println(new date()                     + "================================== connect() end");             logger.warn("____________________end connecting "+getidentifier() +"on imap"+imaploginid+" pw "+imappasswrd);         } catch (exception fex) {                  if (connectionattempt.get() >= 3) {                     logger.error("reconnection failed", fex);                     connectionattempt.set(0);                     throw new illegalstateexception(                             "error while connecting mediastream", fex);                 }                 logger.error("reconnecting mediastream attempt "                         + connectionattempt.get(), fex);                 connectionattempt.incrementandget();                 closefolderandstore();                 connect();          } 

the email received here, "public void messagesadded(messagecountevent ev)" method calling twice

@override     public void messagesadded(messagecountevent ev) {         message[] msgs = ev.getmessages();         system.out.println("got " + msgs.length + " new messages");         logger.info("new message received {}" ,msgs.length);         // dump out new messages          (int = 0; < msgs.length; i++) {              try {                  // msgs[i].writeto(system.out);                      system.out.println("-----");                     system.out.println("message >>" + msgs[i].getmessagenumber()                             + ":");                     logger.info("email received >>> {}" , msgs[i].getmessagenumber());                     processemail(msgs[i]);               } catch (exception ioex) {                 logger.error("messagesadded:getmessagenumber", ioex);                 ioex.printstacktrace();             }         }         try {             synchronized (folder) {                 if (folder != null && idlemanager != null) {                     idlemanager.watch(folder);                 }             }         } catch (exception e) {             logger.error("messagesadded:watch", e);             e.printstacktrace();         }     } 

the imap debug log follows

debug: getprovider() returning javax.mail.provider[store,imap,com.sun.mail.imap.imapstore,oracle] debug imap: mail.imap.fetchsize: 16384 debug imap: mail.imap.ignorebodystructuresize: false debug imap: mail.imap.statuscachetimeout: 1000 debug imap: mail.imap.appendbuffersize: -1 debug imap: mail.imap.minidletime: 10 debug imap: enable starttls debug imap: closefoldersonstorefailure debug imap: trying connect host "outlook.office365.com", port 993, isssl true * ok microsoft exchange imap4 service ready. [qqbnadmauabsadaanqbdaeeamaayadgalgblahuacgbwahiazaawadualgbwahiabwbkac4abwb1ahqababvag8aawauagmabwbtaa==] a0 capability * capability imap4 imap4rev1 auth=plain auth=xoauth2 sasl-ir uidplus move id unselect children idle namespace literal+ a0 ok capability completed. debug imap: auth: plain debug imap: auth: xoauth2 debug imap: protocolconnect login, host=outlook.office365.com, user=amith.bharathan@drd.co.in, password=<non-null> debug imap: authenticate plain command trace suppressed debug imap: authenticate plain command result: a1 ok authenticate completed. a2 capability * capability imap4 imap4rev1 auth=plain auth=xoauth2 sasl-ir uidplus move id unselect clientaccessrules clientnetworkpresencelocation backendauthenticate children idle namespace literal+ a2 ok capability completed. debug imap: auth: plain debug imap: auth: xoauth2 a3 list "" inbox debug imap: idlemanager select starting debug imap: idlemanager waiting... * list (\marked \hasnochildren) "/" inbox a3 ok list completed. debug imap: connection available -- size: 1 a4 select inbox * 463 exists * 0 recent * flags (\seen \answered \flagged \deleted \draft $mdnsent) * ok [permanentflags (\seen \answered \flagged \deleted \draft $mdnsent)] permanent flags * ok [unseen 36] first unseen message * ok [uidvalidity 14] uidvalidity value * ok [uidnext 7207] next unique identifier value a4 ok [read-write] select completed. debug imap: idlemanager watching imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a5 idle + idle accepted, awaiting done command. debug imap: startidle: set idle debug imap: startidle: return true debug imap: idlemanager.watch startidle succeeded imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager selected 0 channels debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox * 1 recent * 464 exists debug imap: waitifidle: request idlemanager abort debug imap: waitifidle: wait not idle: thread[pool-21-thread-2,5,main] debug imap: idlemanager continue watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager aborting idle folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox done debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a5 ok idle completed. debug imap: handleidle: set running debug imap: waitifidle: wait done, idlestate 0: thread[pool-21-thread-2,5,main] a6 fetch 464 (envelope internaldate rfc822.size) debug imap: idlemanager done watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager waiting... * 464 fetch (envelope ("wed, 29 jun 2016 08:31:06 +0000" "4444" (("amith k bharathan" nil "amith.bharathan" "drd.co.in")) nil nil (("amith k bharathan" nil "amith.bharathan" "drd.co.in")) nil nil nil "<he1pr06mb1196d2a9f2fdb040ab2b05b5bf230@he1pr06mb1196.eurprd06.prod.outlook.com>") internaldate "29-jun-2016 14:01:07 +0530" rfc822.size 19822) a6 ok fetch completed. a7 fetch 464 (bodystructure) * 464 fetch (bodystructure ("text" "html" ("charset" "us-ascii") nil nil "7bit" 1586 48 nil nil "en-us" nil)) a7 ok fetch completed. a8 fetch 464 (body[text]<0.1586>) * 464 fetch (body[text]<0> {1586} <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/tr/rec-html40"> <head> <meta http-equiv="content-type" content="text/html; charset=us-ascii"> <meta name="generator" content="microsoft word 14 (filtered medium)"> <style><!-- /* font definitions */ @font-face     {font-family:calibri;     panose-1:2 15 5 2 2 2 4 3 2 4;} /* style definitions */ p.msonormal, li.msonormal, div.msonormal     {margin:0in;     margin-bottom:.0001pt;     font-size:11.0pt;     font-family:"calibri","sans-serif";} a:link, span.msohyperlink     {mso-style-priority:99;     color:blue;     text-decoration:underline;} a:visited, span.msohyperlinkfollowed     {mso-style-priority:99;     color:purple;     text-decoration:underline;} span.emailstyle17     {mso-style-type:personal-compose;     font-family:"calibri","sans-serif";     color:windowtext;} .msochpdefault     {mso-style-type:export-only;     font-family:"calibri","sans-serif";} @page wordsection1     {size:8.5in 11.0in;     margin:1.0in 1.0in 1.0in 1.0in;} div.wordsection1     {page:wordsection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1" /> </o:shapelayout></xml><![endif]--> </head> <body lang="en-us" link="blue" vlink="purple"> <div class="wordsection1"> <p class="msonormal">555555555555<o:p></o:p></p> </div> </body> </html>  flags (\seen \recent)) a8 ok fetch completed. a9 fetch 464 (body[text]<0.1586>) * 464 fetch (body[text]<0> {1586} <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/tr/rec-html40"> <head> <meta http-equiv="content-type" content="text/html; charset=us-ascii"> <meta name="generator" content="microsoft word 14 (filtered medium)"> <style><!-- /* font definitions */ @font-face     {font-family:calibri;     panose-1:2 15 5 2 2 2 4 3 2 4;} /* style definitions */ p.msonormal, li.msonormal, div.msonormal     {margin:0in;     margin-bottom:.0001pt;     font-size:11.0pt;     font-family:"calibri","sans-serif";} a:link, span.msohyperlink     {mso-style-priority:99;     color:blue;     text-decoration:underline;} a:visited, span.msohyperlinkfollowed     {mso-style-priority:99;     color:purple;     text-decoration:underline;} span.emailstyle17     {mso-style-type:personal-compose;     font-family:"calibri","sans-serif";     color:windowtext;} .msochpdefault     {mso-style-type:export-only;     font-family:"calibri","sans-serif";} @page wordsection1     {size:8.5in 11.0in;     margin:1.0in 1.0in 1.0in 1.0in;} div.wordsection1     {page:wordsection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1" /> </o:shapelayout></xml><![endif]--> </head> <body lang="en-us" link="blue" vlink="purple"> <div class="wordsection1"> <p class="msonormal">555555555555<o:p></o:p></p> </div> </body> </html>  flags (\seen \recent)) a9 ok fetch completed. debug imap: idlemanager watching imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a10 idle + idle accepted, awaiting done command. debug imap: startidle: set idle debug imap: startidle: return true debug imap: idlemanager.watch startidle succeeded imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager selected 0 channels debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox * 2 recent * 465 exists debug imap: waitifidle: request idlemanager abort debug imap: waitifidle: wait not idle: thread[pool-21-thread-2,5,main] debug imap: idlemanager continue watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager aborting idle folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox done debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a10 ok idle completed. debug imap: handleidle: set running debug imap: waitifidle: wait done, idlestate 0: thread[pool-21-thread-2,5,main] a11 fetch 465 (envelope internaldate rfc822.size) debug imap: idlemanager done watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager waiting... * 465 fetch (envelope ("wed, 29 jun 2016 08:32:01 +0000" "test" (("gopikrishnan v" nil "gopikrishnan.v" "drd.co.in")) nil nil (("amith k bharathan" nil "amith.bharathan" "drd.co.in")) nil nil nil "<db4pr06mb0464157db21114b7e237b93c0230@db4pr06mb046.eurprd06.prod.outlook.com>") internaldate "29-jun-2016 14:02:05 +0530" rfc822.size 18300) a11 ok fetch completed. a12 fetch 465 (bodystructure) * 465 fetch (bodystructure ("text" "html" ("charset" "iso-8859-1") nil nil "quoted-printable" 427 15 nil nil "en-gb" nil)) a12 ok fetch completed. a13 fetch 465 (body[text]<0.427>) * 465 fetch (body[text]<0> {427} <html> <head> <meta http-equiv=3d"content-type" content=3d"text/html; charset=3diso-8859-= 1"> <style type=3d"text/css" style=3d"display:none;"><!-- p {margin-top:0;margi= n-bottom:0;} --></style> </head> <body dir=3d"ltr"> <div id=3d"divtagdefaultwrapper" style=3d"font-size:12pt;color:#000000;back= ground-color:#ffffff;font-family:calibri,arial,helvetica,sans-serif;"> <p>test<br> </p> </div> </body> </html>  flags (\seen \recent)) a13 ok fetch completed. a14 fetch 465 (body[text]<0.427>) * 465 fetch (body[text]<0> {427} <html> <head> <meta http-equiv=3d"content-type" content=3d"text/html; charset=3diso-8859-= 1"> <style type=3d"text/css" style=3d"display:none;"><!-- p {margin-top:0;margi= n-bottom:0;} --></style> </head> <body dir=3d"ltr"> <div id=3d"divtagdefaultwrapper" style=3d"font-size:12pt;color:#000000;back= ground-color:#ffffff;font-family:calibri,arial,helvetica,sans-serif;"> <p>test<br> </p> </div> </body> </html>  flags (\seen \recent)) a14 ok fetch completed. debug imap: idlemanager watching imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a15 idle + idle accepted, awaiting done command. debug imap: startidle: set idle debug imap: startidle: return true debug imap: idlemanager.watch startidle succeeded imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager selected 0 channels debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox * 3 recent * 466 exists debug imap: waitifidle: request idlemanager abort debug imap: waitifidle: wait not idle: thread[pool-21-thread-2,5,main] debug imap: idlemanager continue watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager aborting idle folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox done debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a15 ok idle completed. debug imap: handleidle: set running debug imap: waitifidle: wait done, idlestate 0: thread[pool-21-thread-2,5,main] a16 fetch 466 (envelope internaldate rfc822.size) debug imap: idlemanager done watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager waiting... * 466 fetch (envelope ("wed, 29 jun 2016 08:35:56 +0000" nil (("gopikrishnan v" nil "gopikrishnan.v" "drd.co.in")) nil nil (("amith k bharathan" nil "amith.bharathan" "drd.co.in")) nil nil nil "<db4pr06mb0466336d31c8ce8919bd4b3c0230@db4pr06mb046.eurprd06.prod.outlook.com>") internaldate "29-jun-2016 14:05:57 +0530" rfc822.size 11747) a16 ok fetch completed. a17 fetch 466 (bodystructure) * 466 fetch (bodystructure ("text" "html" ("charset" "iso-8859-1") nil nil "quoted-printable" 427 15 nil nil "en-gb" nil)) a17 ok fetch completed. a18 fetch 466 (body[text]<0.427>) * 466 fetch (body[text]<0> {427} <html> <head> <meta http-equiv=3d"content-type" content=3d"text/html; charset=3diso-8859-= 1"> <style type=3d"text/css" style=3d"display:none;"><!-- p {margin-top:0;margi= n-bottom:0;} --></style> </head> <body dir=3d"ltr"> <div id=3d"divtagdefaultwrapper" style=3d"font-size:12pt;color:#000000;back= ground-color:#ffffff;font-family:calibri,arial,helvetica,sans-serif;"> <p>test<br> </p> </div> </body> </html>  flags (\seen \recent)) a18 ok fetch completed. a19 fetch 466 (body[text]<0.427>) * 466 fetch (body[text]<0> {427} <html> <head> <meta http-equiv=3d"content-type" content=3d"text/html; charset=3diso-8859-= 1"> <style type=3d"text/css" style=3d"display:none;"><!-- p {margin-top:0;margi= n-bottom:0;} --></style> </head> <body dir=3d"ltr"> <div id=3d"divtagdefaultwrapper" style=3d"font-size:12pt;color:#000000;back= ground-color:#ffffff;font-family:calibri,arial,helvetica,sans-serif;"> <p>test<br> </p> </div> </body> </html>  flags (\seen \recent)) a19 ok fetch completed. debug imap: idlemanager watching imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a20 idle + idle accepted, awaiting done command. debug imap: startidle: set idle debug imap: startidle: return true debug imap: idlemanager.watch startidle succeeded imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager selected 0 channels debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox * 466 expunge * 466 exists debug imap: waitifidle: request idlemanager abort debug imap: waitifidle: wait not idle: thread[pool-21-thread-2,5,main] debug imap: idlemanager continue watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager aborting idle folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox done debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... debug imap: idlemanager selected 1 channels debug imap: idlemanager selected folder: imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a20 ok idle completed. debug imap: handleidle: set running debug imap: waitifidle: wait done, idlestate 0: thread[pool-21-thread-2,5,main] a21 fetch 466 (envelope internaldate rfc822.size) debug imap: idlemanager done watching folder imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager waiting... * 466 fetch (envelope ("wed, 29 jun 2016 08:35:56 +0000" nil (("gopikrishnan v" nil "gopikrishnan.v" "drd.co.in")) nil nil (("amith k bharathan" nil "amith.bharathan" "drd.co.in")) nil nil nil "<db4pr06mb0466336d31c8ce8919bd4b3c0230@db4pr06mb046.eurprd06.prod.outlook.com>") internaldate "29-jun-2016 14:05:57 +0530" rfc822.size 13152) a21 ok fetch completed. a22 fetch 466 (bodystructure) * 466 fetch (bodystructure ("text" "html" ("charset" "iso-8859-1") nil nil "quoted-printable" 427 15 nil nil "en-gb" nil)) a22 ok fetch completed. a23 fetch 466 (body[text]<0.427>) * 466 fetch (body[text]<0> {427} <html> <head> <meta http-equiv=3d"content-type" content=3d"text/html; charset=3diso-8859-= 1"> <style type=3d"text/css" style=3d"display:none;"><!-- p {margin-top:0;margi= n-bottom:0;} --></style> </head> <body dir=3d"ltr"> <div id=3d"divtagdefaultwrapper" style=3d"font-size:12pt;color:#000000;back= ground-color:#ffffff;font-family:calibri,arial,helvetica,sans-serif;"> <p>test<br> </p> </div> </body> </html>  flags (\seen \recent)) a23 ok fetch completed. a24 fetch 466 (body[text]<0.427>) * 466 fetch (body[text]<0> {427} <html> <head> <meta http-equiv=3d"content-type" content=3d"text/html; charset=3diso-8859-= 1"> <style type=3d"text/css" style=3d"display:none;"><!-- p {margin-top:0;margi= n-bottom:0;} --></style> </head> <body dir=3d"ltr"> <div id=3d"divtagdefaultwrapper" style=3d"font-size:12pt;color:#000000;back= ground-color:#ffffff;font-family:calibri,arial,helvetica,sans-serif;"> <p>test<br> </p> </div> </body> </html>  flags (\seen \recent)) a24 ok fetch completed. debug imap: idlemanager watching imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox a25 idle + idle accepted, awaiting done command. debug imap: startidle: set idle debug imap: startidle: return true debug imap: idlemanager.watch startidle succeeded imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox debug imap: idlemanager selected 0 channels debug imap: idlemanager adding imap://amith.bharathan%40drd.co.in@outlook.office365.com/inbox selector debug imap: idlemanager waiting... 

the email body "test" repeating

please advice.

thanks

amith

this message number 466 in mailbox. server announces new message:

    * 3 recent     * 466 exists 

you process message:

    a16 fetch 466 (envelope internaldate rfc822.size)     ... 

you wait new messages, , server tells you:

    * 466 expunge     * 466 exists 

that means message number 466 removed mailbox , there's new message number 466 in mailbox. javamail notifies of new message number 466. apparently, it's same removed message number 466.

i have no idea why server doing that. looks bug in server me. please report microsoft.

you might want check imap uid of messages you're processing. new message 466 absolutely must have different uid. if doesn't, that's more serious bug in server.

you can check message-id of message make sure haven't seen message before. if error cases this, may need keep history of 1 message. note while message-ids intended unique , unique, unlike imap uids there's no guarantee are unique, or exist @ all.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -