[SOLVED] Failed to save mailbox : A mailbox or mail alias with the same name and domain already exists

Sometimes Virtualmin distracts itself and does not properly move/delete/update e-mail addresses and/or aliases. In that case the error mentioned in the title might appear. Since this seems to be a common issue I thought it makes sense to give some advice on how to solve this issue:

  1. Check if the e-mail account with the same name is already existing (of course, duh...)
  2. Check within "Edit Mail Aliases" if the e-mail address is already existing as an alias
  3. Check the file /etc/passwd if you find the e-mail address ethere either as email-address@domain.tld or as email-address-domain.tld
  4. Check the file /etc/postfix/virtual
    • after applying changes to this file issue the command postmap /etc/postfix/virtual
  5. Check the file /etc/aliases

In case you can find the e-mail address in one of the files mentioned above:

  1. Create a copy of that file
  2. Delete the line with the e-mail address from that file (e.g. by using an editor like "nano")
  3. Save the file
  4. In case of /etc/postfix/virtual => issue postmap /etc/postfix/virtual

I hope this is of any help for others to quickly find a solution to this kind of error.

For more IT tips and help considering many other IT related issues visit our blog: https://www.lexo.ch/blog

Status: 
Closed (fixed)

Comments

Howdy lexo_ch -- thanks for your tips! I hadn't actually run into this issue before. Are you seeing that problem a lot on your server?

Hi Andreycheck

For like the 3rd time. Each time I had to search for another place where aliases/addresses are stored. Today I had the error again and found an orphaned address in /etc/aliases. I deleted it from that file manually and then I could create the e-mail account.

It's difficult to reproduce the error though. Sometimes it happens. Actually Virtualmin should have listed the alias address as alias for another one. But it did not. Clicking the "Edit Mail Aliases" link did not reveal anything either. What I did was searching for the e-mail address in all files within /etc. That's how I found the /etc/aliases file.

I thought I'd put it here so that when other people are having the same issue they do not need to invest too much of their time into searching for the relevant files.

Kind regards Marcus

What action were you performing in Virtualmin that should have removed the original alias?

To be honest: I am not quite sure when this happens. Because last time I had to delete orphaned entries from the /etc/postfix/virtual file and recreated the DB with "postmap /etc/postfix/virtual".

Sometimes it seems that deleting accounts that have aliases assigned causes these kinds of errors. I cannot reproduce the error though. But I see that others have the same issue so I thought I'd create a small HowTo on how these kinds of errors can be solved easily.

I will report here in case I can reproduce the error reliably.

It's a Virtualmin bug if you delete an alias or user and those entries are left around though .. so I'd be interested to know if you can reliably trigger it.

I know. I'd love to being able to reproduce the error. Last time it happened on 30.11.16 and since this was like the 5th time already I thought I'd create a KB-Entry for this. So that if others have the same issue they can find a quick solution. Usually we had to remove the orphaned e-mail address(es) from /etc/postfix/virtual. But this time we had to edit /etc/aliases.

Unfortunately I really can't tell you why or what steps we took before it happened. I can just tell how we solved it. As soon as we can reproduce the error I'll report here.