Aliases and Distribution Lists for iRedMail

From KlavoWiki
Jump to navigationJump to search

Aliases

Individual User

Unless you have purchased the Professional version of iRedMail ther WEB GUI does not offer a method to create aliases or distribution lists. Aliases and distribution lists can still be created but you will need to manually add entries to the vmail.alias MariaDB table.

An alias can be for an email address on a different domain or to a domain hosted elsewhere. An alias is basically forwarding that email to any other email address.

To create an alias of david@testforme.com for email address postmaster@testforme.com

mysql -pmypasswordforMariaDB vmail
INSERT INTO alias (address, goto, name, accesspolicy, domain, created, is_alias, alias_to) VALUES ('david@testforme.com', 'postmaster@testforme.com', 'David Klaverstyn', 'public', 'testforme.com', now(), 1, 'postmaster@testforme.com');

Catch All

To send all emails from a specific domain to a specific email address for only email address that have not already been predefined by a mailbox, alias or distribution list.

In this example all emails from domain qwerty.com to email address hereiam@me.com

mysql -pMyLongandComplexSQLPassword vmail
insert into alias (address, goto, domain, created) values ('querty.com', 'hereiam@me.com', 'qwerty.com', now());

Distribution List

A distribution list is an email address that is forwarded to two or more email address. The email address can be either locally or externally hosted emails on different domains.

To create a distribution list of sales@testforme.com that contains the members tim@testforme.com, bill@microsoft.com and john@google.com.

mysql -pmypasswordforMariaDB vmail
INSERT INTO alias (address, goto, name, accesspolicy, domain, islist, created) VALUES ('sales@testforme.com', 'tim@testforme.com,bill@microsoft.com,john@google.com', 'Sales List', 'public', 'testforme.com', 1, now());

vmail.alias Table Description

+--------------+--------------+------+-----+---------------------+-------+
| Field        | Type         | Null | Key | Default             | Extra |
+--------------+--------------+------+-----+---------------------+-------+
| address      | varchar(255) | NO   | PRI |                     |       |
| goto         | text         | YES  |     | NULL                |       |
| name         | varchar(255) | NO   |     |                     |       |
| moderators   | text         | YES  |     | NULL                |       |
| accesspolicy | varchar(30)  | NO   |     |                     |       |
| domain       | varchar(255) | NO   | MUL |                     |       |
| islist       | tinyint(1)   | NO   | MUL | 0                   |       |
| is_alias     | tinyint(1)   | NO   | MUL | 0                   |       |
| alias_to     | varchar(255) | NO   | MUL |                     |       |
| created      | datetime     | NO   |     | 1970-01-01 01:01:01 |       |
| modified     | datetime     | NO   |     | 1970-01-01 01:01:01 |       |
| expired      | datetime     | NO   | MUL | 9999-12-31 00:00:00 |       |
| active       | tinyint(1)   | NO   | MUL | 1                   |       |
+--------------+--------------+------+-----+---------------------+-------+

Access Policies

Available access policies are:

public no restrictions
domain all users under same domain are allowed to send email to this mail list.
subdomain all users under same domain and sub-domains are allowed to send email to this mail list.
membersOnly only members of this mail list are allowed.
allowedOnly only moderators of this mail list are allowed. Moderators are email addresses stored in SQL column alias.moderators. With iRedAPD-1.4.5, it's ok to use *@domain.com as (one of) moderator for all users under mail domain 'domain.com'.
memebersAndModeratorsOnly only members and moderators of this mail list are allowed.

Send from an Alias

The only way I have been able to send from an alias address is to use the roundcube web mail interface. Go into settings and create a new identity. Creating a new identity that does not existing in vmail.alias will have an error when sending the email.
Using Outlook and EAS always sends from the primary email address of the logged in account.

vi /opt/iredapd/libs/default_settings.py
ALLOWED_LOGIN_MISMATCH_SENDERS = ['email1@thisdomain.net','email2@thatdomain.com']
service iredapd restart