1 (edited by marcus 2018-01-09 02:20:56)

Topic: Domain Alias no longer working in 0.9.7

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: CentOS 6.9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
When sending to an email user@domain.com in which domain.com is an alias of domain.ca, sending to .com returns the error:

The response from the remote server was:
550 5.1.1 <user@domain.com>: Recipient address rejected: User unknown in virtual mailbox table

I had to add the .com domain to iRedAdmin and then each individual domain.ca user to the new forwarding table to allow the .com emails to forward into their .ca accounts, when previously all I needed was the domains added in the alias_domain table and any email sent to .com would direct into the matching .ca account.

I don't see anything in the documentation about changes to the alias_domain table, but obviously the new forwarding table has added some changes - any ideas of what is causing the issue?

Thanks!

----

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

2

Re: Domain Alias no longer working in 0.9.7

No changes made to alias domain related settings. Did you change any settings yourself?

I will test it later today. Thanks for the feedback.

3

Re: Domain Alias no longer working in 0.9.7

Tested alias domain and it works for me.

4

Re: Domain Alias no longer working in 0.9.7

ZhangHuangbin wrote:

No changes made to alias domain related settings. Did you change any settings yourself?

I will test it later today. Thanks for the feedback.

Odd, I didn't alter anything outside of the upgrade documentation.  Here is the error I get in the logs when someone sends to an alias domain:

Jan 15 13:17:21 IDMailnew postfix/smtpd[18349]: NOQUEUE: reject: RCPT from unknown[40.92.0.11]: 550 5.1.1 <user@aliasdomain.com>: Recipient address rejected: User unknown in virtual mailbox table; from=<user@hotmail.com> to=<user@aliasdomain.com> proto=ESMTP helo=<NAM01-BN3-obe.outbound.protection.outlook.com>


Any idea what may be causing this error?  Thanks for your time!

5

Re: Domain Alias no longer working in 0.9.7

Please show us output of command below:

cd /etc/postfix/mysql/
for cf in $(ls *.cf; do echo $cf; postmap -v -q '<user>@<alias-domain.com>' mysql:./$cf; done

NOTE: please replace '<user>@<alias-domain.com>' by the real email address under an alias domain.

6

Re: Domain Alias no longer working in 0.9.7

Oops, my bad, please remove the '-v' flag for postmap command and try again:

cd /etc/postfix/mysql/
for cf in $(ls *.cf; do echo $cf; postmap -q '<user>@<alias-domain.com>' mysql:./$cf; done

Also, did you get any result while executing SQL command below manually?

SELECT forwardings.forwarding FROM forwardings,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND forwardings.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND forwardings.active=1 AND alias_domain.active=1 AND domain.backupmx=0

Replace '%d' by the alias domain name, and '%u' by the username part of email address.

7

Re: Domain Alias no longer working in 0.9.7

No problem, here are the results:

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_dependent_relayhost_maps.cf
sender_login_maps_alias.cf
postmap: warning: mysql query failed: Unknown column 'alias.enablesmtp' in 'where clause'
sender_login_maps.cf
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf

No results for the SQL command

I think I've discovered my problem - I have regular users missing from the forwardings table.  When I was doing the upgrade to 0.9.7 I had issues with my innodb tables crashing and the migration failed a couple of times so I ended up manually moving some of the alias accounts to forwarding, but I didn't realize that non-forwarding accounts needed to also be in the forwardings table as well.  I've added the user to the forwarding table and it now returns a result to the SQL command.  I will go through and add the remaining missing users to the forwardings table and we should be all fixed now I think.  Just to confirm, each user should also have a forwarding entry set to forward to the same email as the user with forwarding set to 1.  This appears to be what is added when I add a new user through iRedAdmin.

Thank you so much for your help in tracking down the cause for this!

8

Re: Domain Alias no longer working in 0.9.7

marcus wrote:

Just to confirm, each user should also have a forwarding entry set to forward to the same email as the user with forwarding set to 1.

It's commented in SQL template file:
https://bitbucket.org/zhb/iredmail/src/ … l.mysql-78