Friday, 17 October 2014

Why was iOS Mail app archiving GMail messages even though was set to delete?

iOS 8 and Gmail was behaving oddly with regard to a delete action  and was still only archiving them. The preferences in account setup was set to to the delete option  not archive and the delete folder target was set as Bin on Server.

What happened in iOS 8 Mail app

In iOS8 Mail app in GMail account, a long swipe left (=delete) or short swipe left then choose Trash all had the same effect on message. The message disappeared from inbox and if you looked in the trash folder for the gmail account you may momentarily see message as it syncs with server then the message disappears from Trash folder. Checking directly on server via browser confirmed the message was not in Trash (Bin), however looking at the "All mail" GMail folder (the GMail archive folder) showed message STILL present there.

Compared to how it should have worked as in iOS GMail app

In the iOS Gmail app Deleting a message from Inbox and it appeared in Trash (Bin) folder and remained there; at this time it was also still present in the All Mail folder. However choose then to delete forever option (from within Trash (Bin)) and disappears from both Trash AND the All Mail folder.


Summary of problem

iOS Mail app with Gmail accounts appeared with the TRASH option only to move emails to trash locally but then as soon as sync with server it disappeared from the Trash folder with no further action but remained in the All Folder. This is in effect an Archive.  It should work as as the Gmail iOS app - messages deleted or trashed are moved to Trash (from where they can be restored ) and remain there till deleted permanently manually or the Trash can is automatically purged after set time on server.


Solution

Others did not seem to have this problem but took some time to realise the issue was with the type of account configured to connect to the Gmail account, not the settings of that account.

The account was originally setup  on iOS 6, upgraded to iOS 7 and then iOS 8. Due to syncing problems with previous versions of iOS and Google many had recommended using the Exchange interface to Google and this is what  had done. When the connection was originally established the type of account chosen was "Exchange". 

For the GMail account in settings I deleted the Exchange type connection and made new account setup using the Gmail type account option in iOS8. It now all seems to work correctly , so solution was to use correct type account. I cannot remember whether I tested the Exchange version thoroughly in previous iOS versions so cannot say if this is a new problem or also existed in iOS 7. Since identifying the problem and looking at the contents of my All Mail folder it looks as though this was occurring in iOS 7.


Tidying up GMail "All Mail"

Having fixed the issue for future deletes the issue was then how to delete messages in the All Mail folder that I thought I had deleted. It is important to state that I have my own set of user defined folders (labels) where I place messages to be kept and hence do not use the Archive facility of Gmail. The following will delete all messages that exist only in the All Mail folder
  • To identify messages in All Mail that do NOT have any user applied labels (i.e. in my folders) and are not in the system folders (labels) Inbox, Drafts or Sent then use the advanced search facility while logged into GMail via a browser. In the Search box type:
           has:nouserlabels -in:sent -in:chat -in:draft -in:inbox
  • This will present the large number of messages as multiple pages. Select the tick box in header area that will select all the messages on that page and this will also then give you option (if you have selected all on that page) to select all conversations that meet this search criteria - select Yes. With all conversations selected then choose delete.
  • At this point they will still show as are in the Trash Bin. Go to Trash bin and scan the messages just to ensure that you have not accidentally deleted a large number of messages you do wish to keep - if there are then undo the delete function. If all is OK and you are happy to get rid of the messages then Empty Trash Bin.



GMail Contacts sync - Fields display in wrong order in Addresses on iPad

I use Gmail for email and contacts syncing them to iPad, iMac and MacBook. For some time some I have been confused by how some addresses display on iPad with data above the first line of address.

Address should show as [ Fields where data is entered on Google Contacts]

32 Hunter Street     [Street]
Nether Green         [Local Area]
Sheffield                [City]
S11 1AA                [Zip/Post Code]
United Kingdom    [Country]

on iPad reads as

Nether Green
2 Hunter Street
Sheffield [City]
S11 1AA
United Kingdom

Confusingly choose to edit record on iPad and the [Local Area] entry appears above the street entry. If  you change the order to correct  this on iPad in Edit screen (delete the area entry and enter the street area, delete the original street entry and enter the area entry) an odd thing happens. On Gmail contacts the updated entry are BOTH put in the street entry (as I suggest doing below).  The problem seems related to the [Local Area] field. If you want it to display correctly then do not use the [Local Area] field when entering on Google Contacts and enter a second line in the street field with the local area information and this will then display correctly.

If using Contacts on OSX and syncing with Google then also enter the Local Field as a second line in the street field as suggested above for the Gmail web interface.

The iPad sync I use takes place with the Google type internet account and hoped iOS8 would solve it but this is not the case. I have tested this on iPad with a separate CardDav account (disabling the contacts in the main Google account) and makes no difference. As such it seems like a bug in the iPad contacts display - I am surprised it has not been picked up by Apple and corrected. As I use Android phone switching to iCloud is not really an option.