Opened 9 years ago

Closed 9 years ago

#12369 closed bug (fixed)

[IMAP] Worker quits, never syncs emails for GMail

Reported by: jessicah Owned by: axeld
Priority: normal Milestone: R1
Component: Servers/mail_daemon Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

At the end of the initial connect/check with the GMail server, the imap worker thread quits, and further attempts to sync email fail, due to the missing worker thread.

The end of the debug from mail_daemon:

C: A0000172 SELECT "[Gmail]"
A0000172 NO [NONEXISTENT] Unknown Mailbox: [Gmail] (now in authenticated state) (Failure)
worker quit
C: A0000173 LOGOUT
* BYE LOGOUT Requested
Unhandled S: BYE, LOGOUT, Requested
A0000173 OK 73 good day (Success)

I've tried re-adding my account, and not including the "[GMail]" folder, but this never seems to have much of an effect. It's like it's forced to be included.

Also, sometimes when mail_daemon gets notified to do some operation when one is in progress (the imap worker thread is busy), it has the habit of killing the entire mail_daemon process.

Attachments (2)

mail_daemon.log (49.4 KB ) - added by jessicah 9 years ago.
mail_daemon-11037-debug-10-09-2015-07-00-32.report (12.8 KB ) - added by jessicah 9 years ago.

Download all attachments as: .zip

Change History (5)

by jessicah, 9 years ago

Attachment: mail_daemon.log added

comment:1 by jessicah, 9 years ago

This is caused by http://cgit.haiku-os.org/haiku/tree/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPConnectionWorker.cpp#n330 and could be resolved by returning B_OK instead.

However, I also noticed in the mail_daemon output for LSUB that the "[Gmail]" folder has the property \Noselect. So probably the correct behaviour here is to not add "[Gmail]" to the folder list for selecting. Google IMAP is weird...

C: A0000004 LSUB "" "*"
* LSUB (\HasNoChildren) "/" "Haiku Commits"
...
* LSUB (\HasChildren \Noselect) "/" "[Gmail]"
* LSUB (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
A0000004 OK Success

comment:2 by jessicah, 9 years ago

Perhaps in ListCommand::HandleUntagged something like:

if (folder == "")
  return true;

if (fSubscribedOnly && response.IsListAt(1)
    && response.ListAt(1).Contains("\\NoSelect"))
  return true;

try {
  folder = fEncoding.Decode(folder);

I presume returning true is the correct thing to do. It at least seems to be working locally without the previous change in IMAPConnectionWorker.

comment:3 by axeld, 9 years ago

Resolution: fixed
Status: newclosed

Should be fixed in hrev50079, thanks for the investigation! I also think that not being able to select a mailbox should not result in quitting the worker (at least when there are other mailboxes that worker is responsible for). I'll try to remember that when I work on it the next time :-)

Note: See TracTickets for help on using tickets.