How to destroy the admin panel and recover it

I read many topics about the admin panel wich is not reacheable or goes 404.
Mine MIAB was one of these.

How i destroyed NGINX:

I tryed to follow the instruction reported here [RESOLVED] box.mydomain.com/admin suddenly 404s with a little success: the admin panel came back up but on any changes to users or aliases ended with same result:
“Something goes wrong” and admin panel in 404.

How i fixed it:
Taking inspiration from How to remove Mail-in-a-Box i made a backup of all the user-data (is not necessary but one bakup is better than zero) and i uninstalled the following packages

php5-cli php5-sqlite php5-gd php5-imap php5-curl php-pear php-apc curl libapr1 libtool libcurl4-openssl-dev php-xml-parser
php5 php5-dev php5-gd php5-fpm memcached php5-memcache unzip
bind9-host netcat-openbsd
opendkim opendkim-tools opendmarc
php5-fpm php-soap php5-imap libawl-php php5-xsl postfix postfix-pcre postgrey ca-certificates
spampd razor pyzor dovecot-antispam dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-sqlite sqlite3 dovecot-sieve dovecot-managesieved

Probably is a redundant list, but i don’t care.
Note: f you follow the installed packages in the sourcecode you will find “sed”, i don’t what sed is but ubuntu consider it stricly necessary so i didn’t removed it.
Note 2: I don’t know how but during tthe process i removed curl.

Then i re-installed MIAB.

You deleted your own admin account?

In general I would suggest:

  • Run mailinabox again.
  • If that fails, restart the server.
  • If that fails too, post a message before trying anything else.

I just confirmed that there is a bug if you delete the account you are logged in with on the control panel. It’ll be fixed in the next update. Thanks.

where did you read that i deleted my own admin account ? :smiley:
i didn’t deleted it, i deleted the catch-all target (trash@gennymobility.com) wich was a normal user, from my admin account (matteo@netfluid.org) wich is still active

Update:
removing an alias from a domain inside miab to ouside (no one of these is my account) michele@genny.ch -> michele@genny.it the admin panel went 404

Because you said:

I created a new box (trash@mydomaindomain.com)

In any case, at least I found an unrelated error!

What version of Mail-in-a-Box are you using?

if what i did in op has reinstalled anything the latest (i made it 2 days ago)
just one hour ago the server is re-exploded, i’m making a full back-up and them i will setup a completly fresh new system on wich i will copy the user-data folder.
(if you know another solution write me ASAP it’s a business installation of our company)

my current theory is: the system crash if you@domain1.com remove the alias someoneelse@domain2.com

That’s the right way to do it. Copy the folder first, then run setup.

no way, the user-data folder bring the error with him, once you copy it admin panel and imap access are gone

Take a look at /var/log/syslog and /var/log/mail.log to see if you can spot any errors when you try to access the admin panel or login via IMAP.