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 test@ixnfo.com is a non-existent email address):

INSERT INTO alias (address, domain, active) VALUES ('test@ixnfo.com', 'ixnfo.com', 1);

Let’s enable forwarding of all mail from this alias to the desired email address (for example support@example.com):

INSERT INTO forwardings (address, forwarding,domain, dest_domain,is_alias, active) VALUES ('test@ixnfo.com', 'support@example.com','ixnfo.com', 'example.com', 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 = 'test@ixnfo.com' AND id=12;

See also my articles:

Leave a comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading