I just moved my IMAP email from one server to another and now while I'm trying to delete any emails, Mail produces the following error:

An error occurred while moving messages to mailbox “(null)”.

I Google'd for it and found a lot of folks out there who are having the exact same issue but was not able to find solution.

up vote 30 down vote accepted
+50

Try selecting the Trash mailbox (folder) and then the menu item:

MailboxUse This Mailbox AsTrash Mailbox

  • 1
    Had same issue with El Capitan and this fixed it. Thanks. – daniels Oct 2 '15 at 12:44
  • I was having this issue with an IMAP account on a custom domain on El Capitan and this fixed it as well. Thanks! – Form Nov 24 '15 at 13:08
  • Note the folder in question must be on the email server, according to Mail.app help text for “Use a specific mailbox to store messages in an IMAP Server”. This says “If the mailboxes listed in the menu are dimmed, you didn't select a server mailbox for the account in the Mail sidebar; make sure you select a mailbox below the account name.” – Charles Lindsay Sep 12 at 18:39

If this is occurring with a Gmail IMAP account:

This problem occurred for me because my Trash label in gmail was not set to 'show in IMAP' (despite following the recommendation of @rcarver). I required one additional step first, i.e.

  1. In Gmail settings, make sure that the trash label is set to 'show' and 'Show in IMAP'.

  2. In Mail.app, select the trash folder, Mailbox → Use This Mailbox As → Trash Mailbox.
    [see @rcarver's answer above]

  • Why the downvote?? – DilithiumMatrix Jan 13 '15 at 21:05
  • This worked for me, so I don't know. – TheCodingArt Mar 2 '15 at 19:50
  • I've no idea, but it feel like that this should be the right answer. – VessoVit Oct 2 '15 at 6:23

This helped in my case (same error message, IMAP-server, deleting messages always popped up this error):

Mail → Preferences → troubled account → Mailbox Behavior and removed the tick on "store deleted messages on server".

Here is where I found help: https://discussions.apple.com/thread/1986823?tstart=0

  • 2
    very risky! accidentally deleted message is GONE for good! no thank you! – alexus Dec 3 '14 at 4:50
  • This makes it so deleted messages are gone permanently - not a viable solution to the original post question - I guess. – riccardolardi Nov 18 '15 at 14:25
  • This worked for me. The Mailbox → Use This Mailbox As → Trash Mailbox option was greyed out. – jseals Mar 3 '16 at 1:30

Unsure if you've resolved the issue but I've just had the same problem and fixed it.

Select the trash folder in your new email account. Click 'Mailbox' from the toolbar and 'Use this mailbox as', then click on trash.

Solved it straight away :)

  • 3
    your answer brings nothing to the table, as this question been already answered & accepted and you just repeating what the other guy already said. – alexus Apr 25 '15 at 17:08

protected by Community May 22 '15 at 21:01

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.