javax.mail.AuthenticationFailedException: maildrop already locked
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Antony_Maiyo
Posted On:   Wednesday, May 19, 2004 08:28 AM

I am getting the above error when I read pop3 mail in a loop below. javax.mail.AuthenticationFailedException: maildrop already locked void javax.mail.Service.connect(java.lang.String, int, java.lang.String, java.lang.String) void javax.mail.Service.connect(java.lang.String, java.lang.String, java.lang.String) javax.mail.Message[] cellmart.CMMailServices.fetchMail(java.lang.String, java.lang.String, java.lang.String) void cellmart.CMMailServer.run() void java.lang.Thread.run() I am using mdaemon 2.8 as pop3 server. //calling block do { Messgs = fetchMail(....); Sleep(FETCH_INTERVAL); }while(true)    More>>

I am getting the above error when I read pop3 mail in a loop below.

			
javax.mail.AuthenticationFailedException: maildrop already locked void javax.mail.Service.connect(java.lang.String, int, java.lang.String, java.lang.String)
void javax.mail.Service.connect(java.lang.String, java.lang.String, java.lang.String)
javax.mail.Message[] cellmart.CMMailServices.fetchMail(java.lang.String, java.lang.String, java.lang.String)
void cellmart.CMMailServer.run()
void java.lang.Thread.run()





I am using mdaemon 2.8 as pop3 server.


			
//calling block
do {
Messgs = fetchMail(....);
Sleep(FETCH_INTERVAL);
}while(true)


			
public static Message[] fetchMail(String popServer, String popUser, String popPassword) throws Exception {
// -- Get hold of the default session --
Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props, null);
// -- Get hold of a POP3 message store, and connect to it --
Store store = session.getStore("pop3");
if(!store.isConnected())
store.connect(popServer, popUser, popPassword);
// -- Try to get hold of the default folder --
Folder folder = store.getDefaultFolder();
if (folder == null) throw new Exception("No default folder");
// -- ...and its INBOX --
folder = folder.getFolder("INBOX");
if (folder == null) throw new Exception("No POP3 INBOX");
// -- Open the folder for read only --
folder.open(Folder.READ_WRITE);
// -- Get the message wrappers and process them --
Message[] msgs = folder.getMessages();

try {
if (folder!=null)
folder.close(false);
if (store!=null)
store.close();
}
catch (Exception ex2) {
ex2.printStackTrace();
}

return msgs;
} //read
   <<Less
About | Sitemap | Contact