I am running Mail.app on Yosemite with a few Gmail accounts on IMAP. Everything is syncing just fine, with the exception of the Junk folders: every time I use "Erase junk mail...", the emails are immediately deleted from the client, but they still show up in Gmail's spam folder.

enter image description here

This doesn't happen with the other folders (sent mail ecc): whenever I delete an item from one of these folders, the change is synced to the server. They are also configured in the same way in Mail.app:

enter image description here

How can I make sure that emptying the Junk folder in Mail.app deleted all spam from Gmail web as well?

  • The normative freak in me makes me write this: your settings differ from those recommended by Gmail. See support.google.com/mail/answer/78892?hl=en Jul 13 '15 at 20:47
  • @JaimeSantaCruz true, but 1) I don't like the recommended settings and 2) when it comes to junk mail specifically, the only setting the differs is the auto-delete one, that has no impact here because even if I set it to something else I see the same behavior :) Jul 13 '15 at 21:45
  • I'll go pester someone else with the recommended settings then ;) Jul 13 '15 at 22:02
  • @JaimeSantaCruz :D It's just that I like to keep emails on the server, that's why I use IMAP after all... Jul 17 '15 at 15:19

In your IMAP folders, do you still have the junk folder inside the GMAIL folder ? If so, you should select it, and the choose "use as -> junk" in the mailbox folder.

  • No, it's not inside the GMAIL folder. As a matter of fact, I don't even have a GMAIL folder, I just have Inbox, Sent, Junk, Trash and Archive under Mailboxes in the left column of Mail.app. Jul 13 '15 at 10:29
  • 1
    It looks like a bug. It doesn't work for me neither. Generally, the integration between Mail.app and Gmail is always erratic.
    – Matthieu
    Jul 13 '15 at 11:15
  • 1
    Yes, I agree. Well, if it happens with junk mail I can't be bothered that much since it's automatically deleted on the server as well after a month. Better this than other folders :) Jul 13 '15 at 13:12

make sure your IMAP Path Prefix is set to [Gmail]; or [Google Mail] in some locales. try the Gmail prefix first. the [brackets] are required.

enter image description here

open the Mail app, select the Spam folder under your Gmail account in the Mailboxes sidebar; then on the Mail Menubar, choose Mailbox‣Use This Mailbox As‣Junk Mailbox. you can/should also do this for Drafts, Archive, Sent, and Trash.

enter image description here

  • If I add the [Gmail] IMAP path prefix (which was previously empty), all my Gmail folders disappear from the sidebar in Mail.app Aug 26 '15 at 19:40
  • actually, your Gmail folders haven't disappeared; when you enable IMAP Path Prefix, the default Gmail sub-folders (Inbox, Sent, Junk, Trash, Drafts and Archive) will re-appear (eventually) in the sidebar, nested underneath the Local Mailbox Folders. after you enable the IMAP Prefix feature, it may take some time for Mail.app to finish rebuilding your Gmail folders, especially if you've got a lot of messages in your Gmail account. simply leave Mail.app running until it completes the job. this is the proper way to setup Gmail in Mail.app.
    – user1082
    Aug 27 '15 at 21:02
  • So I haven given this a go, Mail has rebuilt all my messages but after a few hours, still no folder in my sidebar. This seems a bit too flakey, I might revert back to not using the IMAP prefix as not having a synced junk folder is the least of all evils. Aug 28 '15 at 13:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .