# Gmail

If you enable the use of the Filing Script, the next screen will allow you to configure how MsgFiler 4 treats Gmail messages.

{% hint style="warning" %}
Remember that in order to file Gmail messages, you must use the Filing Script.&#x20;
{% endhint %}

<figure><img src="/files/hMGwgVGBSyKZZZ7KnqY1" alt="" width="563"><figcaption></figcaption></figure>

## Archive and File

On most macOS Mail accounts that connect with Gmail, MsgFiler 4 must first archive a message before it can move it. This is because of the non-standard way Gmail treats mailboxes. In most mail systems, an email can belong to one and only one mailbox. In Gmail, however, users can assign labels to messages. Labels are somewhat analogous to mailboxes in Gmail, which means a message can appear in multiple mailboxes.

There is a bug in AppleScript wherein setting the mailbox of a message that currently resides in the Inbox does not remove the message from the Inbox. To the user, it appears that the message appears in two mailboxes, the Inbox and the destination mailbox.

To remedy this, MsgFiler 4 will first Archive the message before moving it. Doing so removes the Inbox label from the message before assigning it the destination mailbox label.

## Direct File

Now, some Gmail accounts are configured in such a way that MsgFiler 4 can file directly to a mailbox, with no need to archive first. If you receive an error from MsgFiler 4 when moving or copying a message, try turning off the setting to **Archive messages before filing** in the [Filing Settings](/settings/filing.md) section.

## Per-Account Settings

In MsgFiler 4.1.0, you can now set your Gmail filing method on a per-account basis. In [Filing Settings](/settings/filing.md), click on [**Account-Specific Settings**](/settings/filing/account-specific-settings.md) to configure how each of your Gmail accounts should file their messages.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.msgfiler.com/onboarding/gmail.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
