1
votes

Hi we are trying to connect a mail host with valid user name and password by using

 store.connect(host,user,password); // store is an object of          javax.mail.Store class.

from our linux server, but we are facing a below exception.

    error while reading messagesjavax.mail.AuthenticationFailedException: maildrop already locked
    javax.mail.AuthenticationFailedException: maildrop already locked
    at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:207)
    at javax.mail.Service.connect(Service.java:295)
    at javax.mail.Service.connect(Service.java:176)
    at rtnsmonitoring.Mailbox.<init>(Mailbox.java:33)
    at rtnsmonitoring.Mailbox.getMailboxes(Mailbox.java:49)
    at rtnsmonitoring.Main.run(Main.java:31)

please help me how to solve it.

note: with provided credentials im able to login to the mail from from UI. and im also able to send email using telnet, mail is delivering to recipient successfully.

2
you want to send or receive the mail ?Neeraj Jain
yeah i want send email. before that i want to connect with these credentials.satish
then this can help , How to send mails with Java ?Neeraj Jain
Thank you neeraj, but.. so far my program is sending mails fine. but suddenly one week back connection time out exception came. so that i have changed to new email, but with this i'm getting this kind of exception.please tell me in which cases ill get "maildrop already locked" exception.satish

2 Answers

0
votes

You're using the POP3 protocol, which only allows a single client to connect to a given account at a time. Try using IMAP if possible.

0
votes

Now its working. pop is a single client to connect. i in my program i already connected to my account and i didn't closed the folder which i was opened. again i'm trying to connect to that account so it is throwing this exception. now i've closed the folders and connection i'm able to process the messages from the folders.