Menu

#32 E-mail info is not updated after a while (ver 1.6.1.1-1)

open
nobody
Connection (5)
5
2011-02-18
2011-02-18
Miki
No

Problem:
Notifier works well when first registered to the account (so when started) and this lasts for couple of checks of e-mail. Then it keeps the same status regardles of the changes in the inbox.

From more technical side:
I am getting an error of the type "getUnreadMsgCount() failed, will try again soon" (line 253 notifier.py) after mail has been checked for couple of times. It seems that somehow 'self.connection' info is lost and 'self.connection.refreshInfo()' (line 249) fails with the mentioned exception.

Solution:
One of the possible workarounds is to update 'self.connection' again with 'self.connection=gmailatom.GmailAtom(self.options['gmailusername'],self.options['gmailpassword'],self.options['proxy'])' .

The procedure is the following in case someone esle is having the same problem:
1) open notifier.py (located at /usr/lib/gmail-notify) as root ---- or just simply in command line: sudo gedit /usr/lib/gmail-notify/notifier.py
2) before line 249 (self.connection.refreshInfo()) and after command 'try' enter: self.connection=gmailatom.GmailAtom(self.options['gmailusername'],self.options['gmailpassword'],self.options['proxy'])
3) save and that is all, now you will receive updates of the unread e-mails regularly and consistently

Also attaching the updated file.

Discussion

  • Miki

    Miki - 2011-02-18
     
  • Miki

    Miki - 2011-02-18
    • summary: E-mail info is not updated after a while --> E-mail info is not updated after a while (ver 1.6.1.1-1)
     
  • Alexander Thomas

    To be more specific, this is caused by some problem with urllib2, that causes urllib2.urlopen to keep on returning 401 errors after a few requests.
    A more elegant solution is to catch the urllib2.HTTPError in has_new_messages and calling self.connect() in case the error code is 401. This avoids re-initializing everything when it is not needed.

     

Log in to post a comment.

MongoDB Logo MongoDB