How to add Alias to iRedMail

Once, on the same mail server with iRedMail, I needed to redirect mail from the old domain to the new one, so I decided to add an alias so as not to lose contact with clients who will write to the email addresses of the old domain.

It is assumed that the domain for which the alias will be added has already been added through the free iRedAdmin, as well as the DNS settings of the domain point to the IP address of the server with iRedMail.

You can add alias through iRedAdmin-Pro, but I will do it by executing SQL queries, open any mysql client or use the console one on linux:

mysql -u root -p

Let’s select the vmail database:

USE vmail;

Add alias (where is a non-existent email address):

INSERT INTO alias (address, domain, active) VALUES ('', '', 1);

Let’s enable forwarding of all mail from this alias to the desired email address (for example

INSERT INTO forwardings (address, forwarding,domain, dest_domain,is_alias, active) VALUES ('', '','', '', 1, 1);

Let’s see the added records in the tables:

SELECT * FROM alias;
SELECT * FROM forwardings;

Here’s an example of deletion:

DELETE from forwardings where address = '' AND id=12;

See also my articles:

Leave a comment

Leave a Reply