1

Topic: Alias domain does not work for one e-mail account

Hello

I am running iRedMail pro and I'm encountering a very strange problem with one particular account on alias domain.

Setup:
Main domain is @maindomain.com
There are two user accounts: john@maindomain.com and jane@maindomain.com
Both have e-mail aliases: john.doe@maindomain.com -> john@maindomain.com and jane.doe@maindomain.com -> jane@maindomain.com

Sending e-mail to john@maindomain.com and john.doe@maindomain.com works fine.

However there is also an alias domain for maindomain.com, @aliasdomain.com. And now comes the issue:

Sending e-mail to John's accont on aliasdomain (john@aliasdomain.com and john.doe@aliasdomain.com) works fine.

But when sending e-mail to jane on the aliasdomain fails. The error message is "550 5.1.1 <jane@aliasdomain.com>: Recipient address rejected: User unknown in virtual mailbox table"

I tried to create a new account for test user Jill with alias jill.doe@maindomain.com. Sending e-mail to jill@aliasdomain.com and jill.doe@aliasdomain.com works fine. I even added a new alias domain @secondaliasdomain.com and sending e-mail to John and Jill with this domain (john@secondaliasdomain.com, john.doe@secondaliasdomain.com, jill@secondaliasdomain.com and jill.doe@secondaliasdomain.com) works perfectly.

Sending to Jane @ aliasdomain fails also from local server's RoundCube with similar error message as what Google's gmail gives.

Below is Google's error message (with actual e-mail accounts and domains changed to protect privacy).

Delivery to the following recipient failed permanently:

     jane@aliasdomain.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain radiorapu.com by posti.terracolligo.net. [5.39.124.137].

The error that the other server returned was:
550 5.1.1 <jane@aliasdomain.com>: Recipient address rejected: User unknown in virtual mailbox table


----- Original message -----

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=c0vVOS9fP/axVu52i3Xmltw4VgbWC7Gi1HHzF3AlB74=;
        b=RlrXuPc5oJv2PCvj4VQIgGIQLiZhCEiPPDpB5MI791kVwDcnxsITJ39y/Ywt+ZAy+I
         2VMhz/ipMaRpLHCJIddkJggCL9PX4yQBsh344qPVMKnsrMjh2Q8o9uCSoV3blgoq88NE
         JFU4v5h+DGyvqp3MWfKLkyghiDnvp3glbE4vaT0XndPVX1sTGmjkdOOmlE6vfU50FFvT
         xt5J65NZQQhKmk9mOLVQZMxl24ICZ1BzvyD9EM1IU3WIYpNR8P6IWnTNwk7EL7EtSzXT
         aEBLjpgITkOn1inAnscCY/ca+ZuPbj+UvM4pThv0xJHwjCIsIBBBimrAWw9ZWi5i6um7
         qSUw==
MIME-Version: 1.0
X-Received: by 10.152.26.201 with SMTP id n9mr37313261lag.50.1421746401992;
Tue, 20 Jan 2015 01:33:21 -0800 (PST)
Received: by 10.152.119.40 with HTTP; Tue, 20 Jan 2015 01:33:21 -0800 (PST)
Date: Tue, 20 Jan 2015 11:33:21 +0200
Message-ID: <CAAh__UHYm+9XS2Fiht-ymsGe2UD1_54p1fXhgtpehSrrgVwwaA@mail.gmail.com>
Subject: kouvola
From: The Sender <sender@gmail.com)
To: "jane@aliasdomain.com" <jane@aliasdomain.com>
Content-Type: multipart/alternative; boundary=089e0160a70640649b050d12213e



==== Required information ====
- iRedMail version: 1.8.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu 1401
- Related log if you're reporting an issue: N/A
====

----

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

2

Re: Alias domain does not work for one e-mail account

Is 'jane.doe@maindomain.com' an account in SQL table `vmail.alias`? or `vmail.mailbox`?
Show us output of below commands please:

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

3

Re: Alias domain does not work for one e-mail account

ZhangHuangbin wrote:

Is 'jane.doe@maindomain.com' an account in SQL table `vmail.alias`? or `vmail.mailbox`?
Show us output of below commands please:

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

Hi

After logging in with sudo -i (this is Ubuntu) I'm getting following output:

Working addresses: ossi at radiorapu.fi, ossi @radiorapu.com and ossi @ porvaritv.fi. (radiorapu.fi is main domain, radiorapu.com and porvaritv.fi are alias domains).

root@posti:/etc/postfix/mysql# for cf in $(ls *.cf); do echo $cf; postmap -q 'ossi@radiorapu.com' mysql:./$cf; done
catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_maps.cf
ossiman@gmail.com
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

root@posti:/etc/postfix/mysql# for cf in $(ls *.cf); do echo $cf; postmap -q 'ossi@radiorapu.fi' 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
ossi@radiorapu.fi
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
ossiman@gmail.com
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf
vmail1/radiorapu.fi/o/s/s/ossi-2014.10.14.14.19.40//Maildir/

root@posti:/etc/postfix/mysql# for cf in $(ls *.cf); do echo $cf; postmap -q 'ossi@porvaritv.fi' mysql:./$cf; done
catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_maps.cf
ossiman@gmail.com
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


Working address: timo @ radiorapu.fi

root@posti:/etc/postfix/mysql# for cf in $(ls *.cf); do echo $cf; postmap -q 'timo@radiorapu.fi' 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
timo@radiorapu.fi
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf
vmail1/radiorapu.fi/t/i/m/timo-2014.10.14.14.53.11//Maildir/
root@posti:/etc/postfix/mysql#

NON-working address: timo@radiorapu.com
root@posti:/etc/postfix/mysql# for cf in $(ls *.cf); do echo $cf; postmap -q 'timo@radiorapu.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
virtual_mailbox_maps.cf
root@posti:/etc/postfix/mysql#

NON-working address: timo @ porvaritv.fi
root@posti:/etc/postfix/mysql# for cf in $(ls *.cf); do echo $cf; postmap -q 'timo@porvaritv.fi' 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
virtual_mailbox_maps.cf
root@posti:/etc/postfix/mysql#

Please note that I've set radiorapu.com and porvaritv.fi to be the alias of radiorapu.fi domain. See attachment.

Regards,
- Ossi

4 (edited by ossiman 2015-01-20 22:23:45)

Re: Alias domain does not work for one e-mail account

Attachment below:

Post's attachments

Rapu alias.png
Rapu alias.png 34.72 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

5

Re: Alias domain does not work for one e-mail account

Could you please show me output of below commands:

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

6

Re: Alias domain does not work for one e-mail account

ZhangHuangbin wrote:

Could you please show me output of below commands:

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

root@posti:/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
root@posti:/etc/postfix/mysql#

7

Re: Alias domain does not work for one e-mail account

/etc/postfix/mysql/*.cf is fine.

Last check: please compare the SQL records of working and non-working account, check whether or not they have some differences.

8

Re: Alias domain does not work for one e-mail account

ZhangHuangbin wrote:

/etc/postfix/mysql/*.cf is fine.

Last check: please compare the SQL records of working and non-working account, check whether or not they have some differences.

How can I do that?

- Ossi

9

Re: Alias domain does not work for one e-mail account

Use MySQL command line tool or other SQL management tool (e.g. phpMyAdmin) to query working and non-working accounts, compare the output (column and value).

10

Re: Alias domain does not work for one e-mail account

ZhangHuangbin wrote:

Use MySQL command line tool or other SQL management tool (e.g. phpMyAdmin) to query working and non-working accounts, compare the output (column and value).

Without any knowledge of what table, what to look and from where this would be like looking for needle from a haystack.

I deleted the non-working "Jane" account an re-created it. Now it works. Case closed.

Regards,
- Ossi

11

Re: Alias domain does not work for one e-mail account

ossiman wrote:

I deleted the non-working "Jane" account an re-created it. Now it works. Case closed.

Just curious, did you create these non-working accounts manually?