How to read yahoo email with python
<p>tried to use the following code to read yahoo email.
The error message says "NB: mailbox is locked by server from here to 'quit()'"</p>

<p>Q> How to fix the issue?</p>

<pre><code>import poplib
from email import parser

pop_conn = poplib.POP3_SSL('pop.mail.yahoo.com')
pop_conn.user('xxxx@yahoo.com')
pop_conn.pass_('xxxx')

#Get messages from server:
iMessageCount = len(pop_conn.list()[1])
messages = [pop_conn.retr(i) for i in range(1, iMessageCount + 1)]


# Concat message pieces:
messages = ["\n".join(mssg[1]) for mssg in messages]

#Parse message intom an email object:
messages = [parser.Parser().parsestr(mssg) for mssg in messages]
for message in messages:
    print message['subject']


13 #Get messages from server:


/usr/lib/python2.7/poplib.pyc in pass_(self, pswd)
    187         NB: mailbox is locked by server from here to 'quit()'
    188         """
--&gt; 189         return self._shortcmd('PASS %s' % pswd)
</code></pre>
