1

Topic: Mail Alias

Hi,

We are happily using iRedAdmin pro, version v1.3.1 (MySQL).

Everything is just fine, but as usual, simplest things are driving us crazy...

I just explain my objective:
- I have a mailbox named user@example.com
- I want to create an alias named alias@example.com which "redirect" incoming mails to above mailbox.

When I create the alias, the panel just doesn't allow me to add members who belong to the same domain (example.com), but only external addresses.

How can we manage this????

PS: postfixadmin can do this very very simply :-(

Thank you!


==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL): 0.8.0 MySql
- Linux/BSD distribution name and version: CentOS release 6.2
====

2

Re: Mail Alias

infoaziende wrote:

We are happily using iRedAdmin pro, version v1.3.1 (MySQL).

Glad to hear that. smile

infoaziende wrote:

I just explain my objective:
- I have a mailbox named user@example.com
- I want to create an alias named alias@example.com which "redirect" incoming mails to above mailbox.
When I create the alias, the panel just doesn't allow me to add members who belong to the same domain (example.com), but only external addresses.

May i know how you create account "alias@example.com"? Does your "redirect" mean forwarding?

iRedAdmin-Pro will verify the members you submit, and discards the non-exist ones.

3

Re: Mail Alias

ZhangHuangbin wrote:

May i know how you create account "alias@example.com"? Does your "redirect" mean forwarding?

iRedAdmin-Pro will verify the members you submit, and discards the non-exist ones.

I do it this way:
1) I Add the alias with mail address "alias@example.com"
2) I leave "Who can send email to this list" to the default value "Unrestricted"
3) I Insert in the "Add new member" the line "user@example.com" which EXISTS already as a mailbox/user in the domain "example.com"
4) Click on "Save changes".

When the web page refreshes, I have no entry in "Members" field. :-(

PS: I tried inserting an external member (i.e. xxxxx@externaldomain.com) and it does works...

4

Re: Mail Alias

- Did you try to add other mail users as alias member? Same issue?
- Did you try the latest iRedAdmin-Pro-MySQL-1.4.0?

5

Re: Mail Alias

Sorry for my late answer, but lately I've been very busy.

I've tried both solution, but there's no way to make it work.

Please, help!!

6

Re: Mail Alias

Does it work if you assign this user to mail alias in user profile page?

- Login to iRedAdmin-Pro
- Go to user profile page of user@example.com
- Assign this user to mail alias 'alias@example.com'.
- Save changes.

7

Re: Mail Alias

Now the external administrator of a domain, has added an alias user and it is working. Maybe an issue with the superadministrator.

Now I'have a new problem: Alias Domains!

Simply added an alias for one of my domain (and checked in the DB with a simple "select * from alias_domain;")
But any mail sent to user1@aliasdomain.com is refused with code 550: Recipient address rejected: User unknown in virtual mailbox table;

8

Re: Mail Alias

Have you configured your dns correctly (mx records) for the alias domain?

9

Re: Mail Alias

infoaziende wrote:

But any mail sent to user1@aliasdomain.com is refused with code 550: Recipient address rejected: User unknown in virtual mailbox table;

Could you please paste output of below commands here to help troubleshoot? Replace 'user1@aliasdomain.com' by the real email address (in alias domain) below:

# cd /etc/postfix/mysql/
# for cf in $(ls *.cf); do echo $cf; postmap -q 'user1@aliasdomain.com' mysql:./$cf; done

10

Re: Mail Alias

This is the output resulting from the operation above:


catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_maps.cf
recipient_bcc_maps_domain.cf
recipient_bcc_maps_user.cf
relay_domains.cf
sender_bcc_maps_domain.cf
sender_bcc_maps_user.cf
sender_login_maps.cf
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf


Thanks

11

Re: Mail Alias

any news?

tnx

12

Re: Mail Alias

infoaziende wrote:

any news?

tnx

Sorry ZhangHuangbin, but I've got no answer from you since 26/6... what happens?

13

Re: Mail Alias

infoaziende wrote:

This is the output resulting from the operation above:

There's no output related to alias domain, so there may be something wrong with your Postfix MySQL lookup files.

Could you please check value of parameter "query =" in all files under /etc/postfix/mysql/? Here are sample config files:
https://bitbucket.org/zhb/iredmail/src/ … fix/mysql/

14

Re: Mail Alias

I've checked every single .cf file in mysql directory... and everything is fine according to the sample config files you told me to check.
The issue is still present.
Anyway I've changed the "hosts" parameter in every .cf file to make them pointing to the postfix server (I have separated the MTA/Antispam server from the mailboxes server)

15

Re: Mail Alias

infoaziende wrote:

I've checked every single .cf file in mysql directory... and everything is fine according to the sample config files you told me to check.

Then there must be something wrong in the data stored in SQL server.

infoaziende wrote:

Now I'have a new problem: Alias Domains!
Simply added an alias for one of my domain (and checked in the DB with a simple "select * from alias_domain;")
But any mail sent to user1@aliasdomain.com is refused with code 550: Recipient address rejected: User unknown in virtual mailbox table;

Questions:

- Did you add alias domain with iRedAdmin-Pro or other tools/commands?
- Please show us output of SQL command:

# mysql -uroot -p vmail
mysql> SELECT alias_domain, target_domain, created, active FROM alias_domain;

- Show me output of below command:

# cd /etc/postfix/mysql/
# grep 'query' *.cf

- Show me output of below command. Please replace 'aliasdomain.com' below with the real alias domain name.

# cd /etc/postfix/mysql/
# for cf in $(ls *.cf); do echo $cf; postmap -q 'aliasdomain.com' mysql:./$cf; done

16

Re: Mail Alias

ZhangHuangbin wrote:

Questions:

- Did you add alias domain with iRedAdmin-Pro or other tools/commands?

Absolutely iRedAdmin-Pro

ZhangHuangbin wrote:

- Please show us output of SQL command:

# mysql -uroot -p vmail
mysql> SELECT alias_domain, target_domain, created, active FROM alias_domain;

+------------------------+-----------------+---------------------+--------+
| alias_domain           | target_domain   | created             | active |
+------------------------+-----------------+---------------------+--------+
| aliasdomain.it        | domain.it        | 2012-06-25 10:54:39 |      1 |
+------------------------+-----------------+---------------------+--------+


ZhangHuangbin wrote:

- Show me output of below command:

# cd /etc/postfix/mysql/
# grep 'query' *.cf

catchall_maps.cf:query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0
domain_alias_catchall_maps.cf:query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1
domain_alias_maps.cf:query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
recipient_bcc_maps_domain.cf:query       = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1
recipient_bcc_maps_user.cf:query       = SELECT recipient_bcc_user.bcc_address FROM recipient_bcc_user,domain WHERE recipient_bcc_user.username='%s' AND recipient_bcc_user.domain='%d' AND recipient_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND recipient_bcc_user.active=1
relay_domains.cf:query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1
sender_bcc_maps_domain.cf:query       = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1
sender_bcc_maps_user.cf:query       = SELECT sender_bcc_user.bcc_address FROM sender_bcc_user,domain WHERE sender_bcc_user.username='%s' AND sender_bcc_user.domain='%d' AND sender_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND sender_bcc_user.active=1
sender_login_maps.cf:query       = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1
transport_maps_domain.cf:query       = SELECT transport FROM domain WHERE domain='%s' AND active=1
transport_maps_user.cf:query       = SELECT mailbox.transport FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.transport<>'' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.backupmx=0 AND domain.active=1
virtual_alias_maps.cf:query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias.domain='%d' AND alias.domain=domain.domain AND alias.active=1 AND domain.backupmx=0 AND domain.active=1
virtual_mailbox_domains.cf:query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=0 AND active=1 UNION SELECT alias_domain.alias_domain FROM alias_domain,domain WHERE alias_domain.alias_domain='%s' AND alias_domain.active=1 AND alias_domain.target_domain=domain.domain AND domain.active=1 AND domain.backupmx=0
virtual_mailbox_maps.cf:query       = SELECT CONCAT(mailbox.storagenode, '/', mailbox.maildir, '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1

ZhangHuangbin wrote:

- Show me output of below command. Please replace 'aliasdomain.com' below with the real alias domain name.

# cd /etc/postfix/mysql/
# for cf in $(ls *.cf); do echo $cf; postmap -q 'aliasdomain.com' mysql:./$cf; done


catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_maps.cf
recipient_bcc_maps_domain.cf
recipient_bcc_maps_user.cf
relay_domains.cf
sender_bcc_maps_domain.cf
sender_bcc_maps_user.cf
sender_login_maps.cf
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
virtual_mailbox_domains.cf
aliasdomain.it
virtual_mailbox_maps.cf

17

Re: Mail Alias

Answers?

18

Re: Mail Alias

Query commands are all ok. I've no idea why it doesn't work yet.
Does it work if you remove this alias domain then re-add it?