[
    {
        "role": "user",
        "content": "when%20using%20neomutt%20%2B%20mbsync%20%2B%20gmail%2C%20if%20i%20create%20a%20folder%2Fmailbox%20locally%20and%20sync%20with%20mbsync%2C%20will%20it%20automatically%20create%20it%20on%20the%20gmail%20side%3F"
    },
    {
        "role": "assistant",
        "content": "No \u2014 simply creating a folder/mailbox locally with NeoMutt (or directly on your local maildir) *won\u2019t automatically* create a corresponding label/mailbox on the Gmail (remote IMAP) side, unless your mbsync config is set up to do that. Whether or not it is created depends on several configuration options in your `~/.mbsyncrc` (or equivalent) file.\n\nHere\u2019s what you need to know:\n\n---\n\n### Key settings in mbsync (`isync`)\n\n- **Create {None|Far|Near|Both}**  \n  This controls whether mbsync will create missing mailboxes on either the remote side (**Far**), the local side (**Near**), or both. If this is not set to include the remote side, creating a local mailbox won\u2019t propagate it to Gmail. ([mankier.com](https://www.mankier.com/1/mbsync?utm_source=openai))\n\n- **Patterns**  \n  This controls which mailboxes are included in the sync. If your new folder\u2019s name does NOT match any included pattern (or matches an exclusion), it won\u2019t be considered for creation or sync. ([mankier.com](https://www.mankier.com/1/mbsync?utm_source=openai))\n\n- **SubFolders style**  \n  If you're using Gmail, its internal folder hierarchy is sometimes tricky. `SubFolders Verbatim` versus other folder naming schemes matter. If naming doesn\u2019t align with how Gmail expects its labels/folders, remote creation may fail or get ignored. ([reddit.com](https://www.reddit.com/r/commandline/comments/np5qb5?utm_source=openai))\n\n---\n\n### What actually happens when you create a local mailbox\n\n- If **Create Both** (or **Create Far**) is enabled, and your new folder matches the `Patterns`, then on the next mbsync run (or with `mbsync --create [channel]`), mbsync *will* attempt to create the mailbox on the far side (i.e. on Gmail). ([mankier.com](https://www.mankier.com/1/mbsync?utm_source=openai))\n\n- If you have **Create None** or only **Create Near**, then adding a folder locally *only* affects your local store. mbsync will print an error or skip that mailbox pair for sync. ([mankier.com](https://www.mankier.com/1/mbsync?utm_source=openai))\n\n---\n\n### Gmail\u2019s system/labels complications\n\n- Gmail uses **labels**, which map to IMAP folders. Creating a \u201cfolder\u201d via IMAP will create a label. But Gmail has certain special/hidden labels (e.g. `[Gmail]/All Mail`, `[Gmail]/Sent Mail`) that behave differently. Some sync setups explicitly exclude `[Gmail]` entries to avoid problems. If your new folder is under `[Gmail]`, you might hit folder-listing or permissions quirks. ([reddit.com](https://www.reddit.com/r/linuxadmin/comments/kdcl8f?utm_source=openai))\n\n- Gmail requires that IMAP is enabled in settings, and in recent years proper authentication (OAuth or App Password if 2FA) is needed. Folder creation via IMAP works, but only with proper permissions and correct config. (That said, this is orthogonal to the `mbsync` question.) \u2014 Not directly cited here but standard.\n\n---\n\n### Example configuration that *does* allow remote folder creation\n\nHere\u2019s a minimal example snippet that would enable what you want:\n\n```\nChannel gmail\n  Far :gmail-remote:\n  Near :gmail-local:\n  Patterns *\n  Create Both\n  SubFolders Verbatim\n  Path ~/Mail/gmail/\n  Inbox ~/Mail/gmail/INBOX\n```\n\nWith `Create Both`, any folder/mailbox you make locally (as long as its name matches one of the `Patterns`) will be created remotely on Gmail at the next sync (or via `mbsync --create gmail`). \n\n---\n\n### What to check\n\nIf your setup isn\u2019t doing what you expect, check these:\n\n1. In your `.mbsyncrc`, under the relevant `Channel`, is `Create Both` or `Create Far` set?\n2. Are the `Patterns` broad enough to include your new folder name?\n3. Is `SubFolders Verbatim` (or other appropriate setting) being used so folder names map correctly?\n4. Are there errors when you run `mbsync`? Sometimes, if far-side permissions or naming issues exist, creation fails.\n5. Try `mbsync --create [channel]` to explicitly trigger mailbox creation for missing ones. ([linuxcommandlibrary.com](https://linuxcommandlibrary.com/man/mbsync?utm_source=openai))\n\n---\n\nIf you like, I can walk through your actual `.mbsyncrc` config (if you share it) and tell you whether your current setup will or won\u2019t create mailboxes on Gmail automatically. Do you want me to check that for your config?"
    }
]