sent mail is empty with gmail account

RESOLVED DUPLICATE of bug 1134987

Status

Firefox OS
Gaia::E-Mail
RESOLVED DUPLICATE of bug 1134987
4 years ago
4 years ago

People

(Reporter: an, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

65.54 KB, text/x-log
Details
13.61 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document
Details
(Reporter)

Description

4 years ago
Created attachment 8566645 [details]
email.log

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150126171358

Steps to reproduce:

Set up the account in Email app and loaded existing mail, Inbox filled right away with my mail but Sent mail says "No mail in this folder". I sent an email from the app and it didn't show up in Sent folder either. This happens only with Gmail, I just tested it with a different server (smtp/imap) and the behavior is as expected.
This was tested with both v2.1 and v2.2 on a Open C phone.

Comment 1

4 years ago
I have a similar issue in my Flame with FFOS 3.0, but it was present from the day I created the account using 2.2: the last email I can see in the Sent folder is a July 13, 2012 and refreshing shows Last sync just now. If someone thinks I should file another bug, please say so and I will.
This looks like it might be the hidden folder issue I alluded to on the mailing list.

Can you use the gmail web UI for the affected account and perform the following steps:
1) Click on the gear icon in the upper-rightish of the gmail web UI.
2) Click on the settings item.
3) Click on the "labels" header tab ("General" should be the one initially selected).
4) Under "System labels", look at the row labeled "Sent Mail".  Confirm that it is currently set to "show". (Show should be bolded and not a clickable link, "hide" should not be bolded and should be a link that you can hover over.)
5) Scan the list of labels to look for other folder names that include the word "sent" in them.

My suspicion is that "Sent Mail" is set to "hide" and that you have some other similarly named folder that we're detecting as the sent mail folder.
Flags: needinfo?(novac)
And to be clear, I suspect this because this line in the log:
  I/Gecko   ( 1815): WLOG: folder message count 0 dbCount 0 syncedThrough null oldest known 0
in the context of the 0/6 folder id suggests that gmail is telling us there are 0 messages in the folder.  If our sync logic was being buggy, the folder count should still be something other than 0.  (Unless that's the bug, which is terrifying.  I'll double check on a test account right now.)
My test was fine, so I think it may be the hidden folder issue.

Note that if this was the problem and you click "show", we unfortunately only sync the folder list once a day (there's a bug on this and we will fix it), so you will want to remove the account and re-create it so we pick up on the new folder immediately.  You should probably also delete the other erroneous label to avoid confusing the email app and other mail clients.

Comment 5

4 years ago


(In reply to Andrew Sutherland [:asuth] from comment #2)
> This looks like it might be the hidden folder issue I alluded to on the
> mailing list.
> 
> Can you use the gmail web UI for the affected account and perform the
> following steps:
> 1) Click on the gear icon in the upper-rightish of the gmail web UI.
> 2) Click on the settings item.
> 3) Click on the "labels" header tab ("General" should be the one initially
> selected).
> 4) Under "System labels", look at the row labeled "Sent Mail".  Confirm that
> it is currently set to "show". (Show should be bolded and not a clickable
> link, "hide" should not be bolded and should be a link that you can hover
> over.)
> 5) Scan the list of labels to look for other folder names that include the
> word "sent" in them.
> 
> My suspicion is that "Sent Mail" is set to "hide" and that you have some
> other similarly named folder that we're detecting as the sent mail folder.

I did what you asked and I checked. "Sent mail" is set to "Show", it is bolded and not a clickable link, "hide" is not bolded and it is a link that I can hover over. 

Many thanks for trying to help me!
(In reply to Gabriela [:gaby2300] from comment #5)
> I did what you asked and I checked. "Sent mail" is set to "Show", it is
> bolded and not a clickable link, "hide" is not bolded and it is a link that
> I can hover over. 

Your problem might be different.  If you could retrieve a logcat and attach it to the bug too, that would be helpful.  See https://wiki.mozilla.org/Gaia/Email/RequiredBugInfo for some info on how to do that if you're not already familiar.

Comment 7

4 years ago
(In reply to Andrew Sutherland [:asuth] from comment #6)
> (In reply to Gabriela [:gaby2300] from comment #5)
> > I did what you asked and I checked. "Sent mail" is set to "Show", it is
> > bolded and not a clickable link, "hide" is not bolded and it is a link that
> > I can hover over. 
> 
> Your problem might be different.  If you could retrieve a logcat and attach
> it to the bug too, that would be helpful.  See
> https://wiki.mozilla.org/Gaia/Email/RequiredBugInfo for some info on how to
> do that if you're not already familiar.

Following the steps in the site you told me I ran "adb logcat -v time -s GeckoDump:V Gecko:V GeckoConsole:V OomLogger:V | tee FILENAME-TO-LOG-TO", but I got "tee is not recognized as an internal or external command, program or executable batch file, so I ran "adb logcat -v time -s GeckoDump:V Gecko:V GeckoConsole:V OomLogger:V" and the output was a very long file I'm attaching here. I hope I did it correctly and that it will useful for you! Many thanks!

BTW, I can always delete and create the Gmail account again if you think it's a way to solve the issue.

Comment 8

4 years ago
Created attachment 8566722 [details]
The reuired log
Thanks for the log, :gaby2300!  Your log also indicates that we seem to be operating correctly.  The log says google is telling us there are 16 messages in the folder and we have synchronized 16 messages in the folder.

:gaby2300, I think it probably would be helpful if you could re-create the account and have the "adb logcat" command running while you do.  Specifically, I am looking for a log excerpt that will look like this (this is from my test account):

===
WLOG: [slog] imap:folder-sync:existing {"type":"inbox","name":"INBOX","path":"INBOX","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"nomail","name":"[Gmail]","path":"[Gmail]","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"archive","name":"All Mail","path":"[Gmail]/All Mail","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"drafts","name":"Drafts","path":"[Gmail]/Drafts","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"important","name":"Important","path":"[Gmail]/Important","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"sent","name":"Sent Mail","path":"[Gmail]/Sent Mail","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"junk","name":"Spam","path":"[Gmail]/Spam","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"starred","name":"Starred","path":"[Gmail]/Starred","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"trash","name":"Trash","path":"[Gmail]/Trash","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"normal","name":"external images","path":"external images","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"normal","name":"links","path":"links","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"normal","name":"test_compose_reply_all","path":"test_compose_reply_all","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"normal","name":"test_empty_sync","path":"test_empty_sync","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"normal","name":"test_initial_full_sync","path":"test_initial_full_sync","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"normal","name":"test_multiple_ranges","path":"test_multiple_ranges","delim":"/"}
WLOG: [slog] imap:folder-sync:add {"type":"normal","name":"test_saturated_sync","path":"test_saturated_sync","delim":"/"}
===

Note that the folder names are based on the labels you have applied in gmail.  As such, they may include private information and may need to be redacted somewhat.  What I really care about are:
- any lines where "type":"sent" appears.
- the line number this occurred on.  This means if you are performing redactions, it would be preferred that for each line you remove you replace it with "redacted" or something.
- based on your log, I probably only care about the 9th line.

Please feel free to redact as much as you would like; we can also do this in multiple steps if I find too much have been redacted.  If it helps save you effort, you can feel free to email me at asuth@mozilla.com so that there's less concern about information being exposed publicly.  I would delete the message after finding whatever is notable related to the problem.  (Ideally copy and paste directly into the email rather than involving an open/libre office document.)
(In reply to Andrew Sutherland [:asuth] from comment #9)
> Thanks for the log, :gaby2300!  Your log also indicates that we seem to be
> operating correctly.  The log says google is telling us there are 16
> messages in the folder and we have synchronized 16 messages in the folder.
> 
> :gaby2300, I think it probably would be helpful if you could re-create the
> account and have the "adb logcat" command running while you do. 
> Specifically, I am looking for a log excerpt that will look like this (this
> is from my test account):

:asuth, many thanks for such a detailed reply!
By the above, do you mean run the "adb logcat" command while I enter my account's name, email address,  and so on till the account is created and the emails downloaded? If so, I'll do it (I just want to be sure it's what you mean) and I'll send the complete output to your email address to avoid redacting any useful text.
(In reply to Gabriela [:gaby2300] from comment #10)
> :asuth, many thanks for such a detailed reply!
> By the above, do you mean run the "adb logcat" command while I enter my
> account's name, email address,  and so on till the account is created and
> the emails downloaded? If so, I'll do it (I just want to be sure it's what
> you mean) and I'll send the complete output to your email address to avoid
> redacting any useful text.

Yes, exactly.  The key thing is to start running the logcat command ("adb logcat -v time -s GeckoDump:V Gecko:V GeckoConsole:V OomLogger:V" is fine/probably better than other options) before you start so that we don't lose anything.  logcat uses a circular buffer which constantly overwrites itself when it fills up, so otherwise it might be too late to get the data out by the time you run the command.

(And note that passwords/google oauth credentials won't be included in the log.)
(In reply to Andrew Sutherland [:asuth] from comment #11)
> (In reply to Gabriela [:gaby2300] from comment #10)


> Yes, exactly.  The key thing is to start running the logcat command ("adb
> logcat -v time -s GeckoDump:V Gecko:V GeckoConsole:V OomLogger:V" is
> fine/probably better than other options) before you start so that we don't
> lose anything.  logcat uses a circular buffer which constantly overwrites
> itself when it fills up, so otherwise it might be too late to get the data
> out by the time you run the command.
> 
> (And note that passwords/google oauth credentials won't be included in the
> log.)

I just sent you the log. Many thanks for your time and your patience!
(Reporter)

Comment 13

4 years ago
Andrew, I hope you're right about the hidden folder but...
I looked over that Labels page in Settings 20 times already (I don't think I ever changed anything there ever) and I have under System Labels all Show and also checkbox Show in IMAP checked. Further down I have under the heading Labels [Imap]Drafts, [Imap]Sent, etc. which are also switched to Show. These labels were created by Google not me, I will switch them to Hide see what happens and let you know.
Flags: needinfo?(novac)
(Reporter)

Comment 14

4 years ago
I removed all [Imap] labels and Sent mail now shows ALL my sent mail as expected. Thanks Andrew for the patience and persistence. Since I never created those labels I'm assuming others might run in the same problems, maybe it's possible to filter 'artificially' created labels out so that the app doesn't get confused.
AFAIAC this can be considered resolved.
(In reply to an from comment #14)
> I removed all [Imap] labels and Sent mail now shows ALL my sent mail as
> expected. Thanks Andrew for the patience and persistence. Since I never
> created those labels I'm assuming others might run in the same problems,
> maybe it's possible to filter 'artificially' created labels out so that the
> app doesn't get confused.

These were most likely created by an IMAP client that you were using that didn't have special-logic to understand gmail (at the time).  Unfortunately this is historically a big problem-area for IMAP and it's only recently that servers report unambiguously what a sent folder is.  Unfortunately that doesn't fix the cruft left over from old IMAP clients or new IMAP clients that still don't understand gmail.

I've filed bug 1134987 on improving our behaviour in this specific situation.  It's not easy to perfectly address this, but we can certainly do better or make things slightly more intuitive.  Probably the easiest thing we could have done in this case would be to put both "Sent" folders next to each other in the list.  It would have been confusing/annoying, but you would have been able to find your sent mail!
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to Gabriela [:gaby2300] from comment #12)
> I just sent you the log. Many thanks for your time and your patience!

Thanks for the log and your time and patience too! :)

The log indicates you are experiencing the same situation.  Specifically, folder sync is saying:

imap:folder-sync:add {"type":"sent","name":"Sent","path":"Sent","delim":"/"}
imap:folder-sync:add {"type":"sent","name":"Sent Mail","path":"[Google Mail]/Sent Mail","delim":"/"}

In your folder list, that first one will be near the top of the folder list, but it's the fake one.  The real one is that second one.  The best way to address this is:
- Using the gmail web UI, move any of the messages in the incorrect sent folder to the real sent folder.  (They should probably already be there because gmail automatically puts messages in the sent folder when they are sent via SMTP and I believe it's always done this.  So you may actually be able to skip this step.)
- "Remove" the label from the gmail settings "Labels" UI.
- Remove and re-add the account again on your Firefox OS device.


I am going to dupe this bug over to the new bug I filed, bug 1134987, because this bug may help others with similar problems find this bug and direct them to the solution.  I think this will cc you both on that bug.  I'm not sure you're going to want to follow that bug, so I'm going to manually remove you from the cc list, but please do feel free to re-add yourselves if you are interested in following our attempts to address the problem.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1134987
(In reply to Andrew Sutherland [:asuth] from comment #16)
> (In reply to Gabriela [:gaby2300] from comment #12)

> In your folder list, that first one will be near the top of the folder list,
> but it's the fake one.  The real one is that second one.  The best way to
> address this is:
> - Using the gmail web UI, move any of the messages in the incorrect sent
> folder to the real sent folder.  (They should probably already be there
> because gmail automatically puts messages in the sent folder when they are
> sent via SMTP and I believe it's always done this.  So you may actually be
> able to skip this step.)
> - "Remove" the label from the gmail settings "Labels" UI.
> - Remove and re-add the account again on your Firefox OS device.


I followed all the above steps and I solved the Sent folder issue. The folder is named Sent Mail now. All the other folders work as expected, so this bug is fixed. I will add myself to the cc list of the other bug to be able to follow it.
If you want me to add something else here, please comment. 
Otherwise, many thanks for your interest in my issue, and also for your patience explaining me the correct procedures step by step! I really appreciate it!!!
You need to log in before you can comment on or make changes to this bug.