How to Fix No Domain Under Control Error in iRedMail

While I’m setting up a mail server on Ubuntu 18.04 with iRedMail 0.9.8, I encountered the “No domain under control” error in iRedAdmin panel. This article will explain how to fix this error.

no domain under control iredadmin

Note: The method used in article is for new iRedMail server. If your iRedMail server has been running for some time, please back up your mail accounts before following the instructions below.

Fixing No Domain Under Control Error in iRedMail

Although the postmaster account is the global admin of the email server, iRedAdmin told me that no domain is under control. The domain name can’t be deleted from iRedAdmin panel. You need to delete the domain name from MySQL/MariaDB database and add it back in iRedAdmin panel. The following steps are for MariaDB users on Ubuntu.

Log into MariaDB shell. (Enter sudo user password, not MariaDB root password)

sudo mariadb -u root

Select the vmail database.

use vmail;

Check available domains in the domain table.

select domain from domain;

Delete your first domain name in the domain table.

delete from domain where domain='your-domain.com';

Exit MariaDB shell.

exit;

Then add it back in iRedAdmin panel.

add domain in iRedMail

Configuring Amavis DKIM Signing

If the above error happened to you, then amavis is likely not working. You can check the status of Amavis by running the following command.

sudo systemctl status amavis

Sample output:

● amavis.service - LSB: Starts amavisd-new mailfilter
   Loaded: loaded (/etc/init.d/amavis; generated)
   Active: failed (Result: exit-code) since Sat 2018-11-03 08:01:55 UTC; 2h 21min ago
     Docs: man:systemd-sysv-generator(8)

Nov 03 08:01:50 mail.linuxbabe.com systemd[1]: Starting LSB: Starts amavisd-new mailfilter...
Nov 03 08:01:50 mail.linuxbabe.com amavis[751]: Starting amavisd: changed ownership of '/var/run/amavis' from root:root to amavis:amavis
Nov 03 08:01:55 mail.linuxbabe.com amavis[751]: Error in config file "/etc/amavis/conf.d/50-user": Can't open PEM file /var/lib/dkim/linuxbabe.com .pem: No such file or directory at /usr/sbin/amavisd-new 
Nov 03 08:01:55 mail.linuxbabe.com amavis[751]: (failed).
Nov 03 08:01:55 mail.linuxbabe.com systemd[1]: amavis.service: Control process exited, code=exited status=1
Nov 03 08:01:55 mail.linuxbabe.com systemd[1]: amavis.service: Failed with result 'exit-code'.
Nov 03 08:01:55 mail.linuxbabe.com systemd[1]: Failed to start LSB: Starts amavisd-new mailfilter.

As you can see, Amavis is not running on my server because the private key file is not found. You can generate the private key with:

sudo amavisd-new genrsa /var/lib/dkim/your-domain.com.pem 2048

Then restart Amavis.

sudo systemctl restart amavis

Show the public key.

sudo amavisd-new showkeys

iredmail amavis public key

In your DNS manager, create a TXT record. Enter dkim._domainkey in the Name field. Copy everything in the parentheses and paste into the value field. Delete all double quotes.

amavisd-new ubuntu

After saving your changes. Check the TXT record with this command.

dig TXT dkim._domainkey.linuxbabe.com

That’s it! I hope this article helped you fix the no domain under control error in iRedMail.

Rate this tutorial
[Total: 3 Average: 5]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here