1 (edited by kaplink 2012-10-26 08:33:15)

Topic: How to create an email alias in iRedMail (shell) [SOLVED]

Hello everyone,

I 'm trying to figure out how can I create an alias for an already created email account.

For instance:
EmailUser@example.net is created and active.
How to add EmailUserAlias@example.net as an alias to the EmailUser@example.net so that emails destined to EmailUserAlias@example.com are landed (not forwarded) to EmailUser@example.net

I believe that it's an SQL query and then reloading postfix but I haven't figure it out.

Thanks for any help.

- iRedMail version: 0.8.3, MySQL, Debian 6

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: How to create an email alias in iRedMail (shell) [SOLVED]

kaplink wrote:

I 'm trying to figure out how can I create an alias for an already created email account.

For instance:
EmailUser@example.net is created and active.
How to add EmailUserAlias@example.net as an alias to the EmailUser@example.net so that emails destined to EmailUserAlias@example.com are landed (not forwarded) to EmailUser@example.net

Either you buy the Pro-Admin-Package or you install postfixadmin (with a few fixes, you should find the discussions in the forum) and use that.

I believe that it's an SQL query and then reloading postfix but I haven't figure it out.

No, a reload should not be necessary.

Cheers
   Mike

3

Re: How to create an email alias in iRedMail (shell) [SOLVED]

Thanks for your reply Mike,

I read the relevants posts but to me both options are too much.
There should be a simpler non gui way.

4

Re: How to create an email alias in iRedMail (shell) [SOLVED]

kaplink wrote:

I read the relevants posts but to me both options are too much.
There should be a simpler non gui way.

I'd suggest you look them up in the postfixadmin sources.

In the beginning I was thinking in the same direction, now I'm more
inclined to patch postfixadmin so that it'll work together with the
database structure which was changed from/based on the original
postfixadmin database layout.

Cheers
   Mike

5

Re: How to create an email alias in iRedMail (shell) [SOLVED]

kaplink wrote:

How to add EmailUserAlias@example.net as an alias to the EmailUser@example.net so that emails destined to EmailUserAlias@example.com are landed (not forwarded) to EmailUser@example.net

Insert a record in SQL table "vmail.alias". For example:

mysql> USE vmail;
mysql> INSERT INTO alias (address, goto, domain) VALUES ('EmailUserAlias@example.net', 'EmailUser@example.net', 'example.net');

Note: It's a good idea to always use lower cases for email addresses.

6

Re: How to create an email alias in iRedMail (shell) [SOLVED]

Thank you ZhangHuangbin.

In order to delete an email alias:

mysql> USE vmail;
mysql> DELETE FROM alias where address='EmailUserAlias@example.net'