Duplicate Messages When Importing From Gmail in Apple Mail

Can I resurrect this thread, with Gmail-related questions? I am picking up with Eagle Filer after an initial massive first-time backup a couple of years ago, and I figured it was time to clean some email out of Apple Mail and into Eagle Filer again. I found myself again puzzled, and wanting to figure out proper workflows for pulling out of Gmail and into Eagle Filer.

Right now, I have upwards of 70,000 emails in gmail, the vast majority of which I assume were received and “archived” (inbox label removed). When looking on Apple Mail, these are in a folder Apple Mail calls “archive” (but I have Apple Mail settings to use Gmail/All Mail as the archive option; I also, as of now, have online gmail settings to SHOW Allmail in IMAP apps).

Wanting to take “Allmail” out of the equation, I followed your suggestion to hide it from IMAP on gmail settings. But then… I couldn’t archive within Apple Mail and . … further, all of those nearly 70k emails I wanted to shortly get into Eagle Filer, were suddenly invisible to Apple Mail!!!

So, I reverted for the moment – reenabled showing Allmail to IMAP apps, and Aple Mail is now rebuilding/downloading/re-indexing so I can get things to where they were before proceeding.

I guess my question is - how should I proceed? Should I do a one-time import with the Allmail as is, clear everything out of gmail server and Apple Mail once it is safely in Eagle Filer, and THEN hide the allmail and use a google-generated true “Archive” folder henceforth? And, after putting the “Allmail” into Eagle Filer, can I then put my Apple Mail “Sent” folder into Eagle Filer, or will that by definition create duplciates, or how to proceed with that? I apologize if this is covered more explicitly in the manual - I didn’t think so (other than the suggestion to hide Allmail from IMAP on the server settings but it seems there was no suggestion for what to do if doing that immediately hides most of what you want to archive into Eagle Filer!)

It’s not clear to me what your goal is here. The original thread is about preserving the mailbox name, but it seems like your main concern is duplicate messages?

It really depends on whether you want to use the Archive command/mailbox. If you don’t, it’s simpler to turn off All Mail.

If you are trying to import sent messages, you can Select All in the Sent mailbox and press the capture key, and this will import those messages. You would just need to rename the mailbox in EagleFiler afterwards.

OK – I was probably less than clear, and sorry again for hijacking this thread. I viewed as at least tangentially related but I really guess I should have started my own thread. But, since we’re here, let me try again.

  1. Day to day, I use Apple Mail with the gmail account. I maintain inbox zero, so day-to-day I frequently either put email into specific folders (labels), or otherwise just “archive” everything (not delete, but archive aka remove the inbox label in gmail.). That is, I DO want to regularly use the Apple Mail “archive” command; i.e., take the email out of the inbox but leave it on the server.

  2. I assume if I leave things as=is/default, with the allmail folder, this will happen when I move into Eagle Filer:

    a. First, I import the “Archive” (i.e. “allmail”) folder into Eagle Filer.

    b. Second, because I want a separate Eagle Filer “Sent” record, I will import
    the “Sent” folder into Eagle Filer.

    c. But, this will result in duplicates, because step 2.a (allmail) already
    includes sent items, right? Or how would Eagle Filer handle? Will I just have
    sent items in both places (Allmail and Sent), and then I can run the script to
    remove the duplicates afterward (leaving them in “Sent” but removing them
    from “Allmail” which I will like relabel “Archive” after it is in Eagle Filer)?

  3. For the future, if I want to continue to use the “archive” command within Apple Mail on my Gmail account, do I need to leave “Allmail” visible and functioning as I have? It would make more sense to me to turn it off if I can do that and still do the regular use of the “archive” command and have the archived items go…somewhere? Would it be a new Gmail level/folder actually labeled “archive,” or what?

Gmail puts copies of sent messages in All Mail. So if you import Sent and you also import everything in All Mail, you will get all the sent messages in both places.

The Remove Duplicate Messages script removes duplicates within a mailbox, not across multiple mailboxes.

If you like the Archive command in Mail but don’t want to mix your archived messages with your sent messages, you could configure the Mailbox Behaviors in Mail to have Archive move the messages to a mailbox other than All Mail, e.g. to one called Archive.

Right. I assume you mean at the gmail server level?

No, I mean in the Mail app in Settings ‣ Accounts ‣ Mailbox Behaviors. That’s how you can control what the Archive command in Mail does.

If you archive messages from Gmail on the Web, I think they will always go to All Mail.