1

Topic: email alias bounced

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx):nginx
- Manage mail accounts with iRedAdmin-Pro?no
- Related log if you're reporting an issue:


Mar 29 13:45:10 mx0 postfix/smtp[22364]: 30A777C0609: to=<robertson@tv???.com.br>, relay=tv????.com.br[37.xxxxxxx]:25, delay=0.16, delays=0.05/0.01/0.05/0.05, dsn=5.1.1, status=bounced (host tv????.com.br[37.xxxxxx] said: 550 5.1.1 <robertson@tv????.com.br>: Recipient address rejected: User unknown in relay recipient table (in reply to RCPT TO command))


Hello

I have on the table "alias" the following:


INSERT INTO `alias` (`address`, `goto`, `name`, `moderators`, `accesspolicy`, `domain`, `islist`, `is_alias`, `alias_to`, `created`, `modified`, `expired`, `active`) VALUES
('robertson@tv????.com.br', 'beto@tv?????rn.com.br', '', NULL, 'public', 'tv?????rn.com.br', 1, 0, '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '9999-12-31 00:00:00', 1);

by sending an email to test get the error in the log postfix

----

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

2

Re: email alias bounced

Shows us output of commands below:

cd /etc/postfix/mysql/
for cf in $(ls *.cf); do echo $cf; postmap -q 'robertson@tv????.com.br' mysql:./$cf; done

3

Re: email alias bounced

Hi

[root@mx0 mysql]# for cf in $(ls *.cf); do echo $cf; postmap -q 'robertson@tv????.com.br' 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

4

Re: email alias bounced

Did you use the real email address in command? Or just 'robertson@tv????.com'?

5

Re: email alias bounced

Hello
I used the real email address

6

Re: email alias bounced

if you were using a real email address, the "postmap" commands should print some output, but it didn't. That means your mail alias account was not created properly.

Could you please try to create a new one by following our tutorial below?
http://www.iredmail.org/docs/sql.create.mail.alias.html

7

Re: email alias bounced

[root@mx0 mysql]# for cf in $(ls *.cf); do echo $cf; postmap -q 'adm@tvxxxrn.com.br' 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
admin@tvxxxrn.com.br
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf

[root@mx0 mysql]# for cf in $(ls *.cf); do echo $cf; postmap -q 'robertson@tvxx.com.br' 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


Hello

the robertson@tvxx.com.br email alias is set to the same as the adm@tvxxxrn.com.br, but see only the adm retorma a value for the admin email.

the only difference and that adm@tvxxxrn.com.br => admin@tvxxxrn.com.br take the same domain.

Already robertson@tvxx.com.br => beto@tvxxxrn.com.br are different domains and tvxx.com.br is not registered in iredmail. just mx points to the server with iredmail.

8

Re: email alias bounced

Could you please try this again:

postmap -v -q 'your_alias_address' mysql:/etc/postfix/mysql/virtual_alias_maps.cf

It will show you detailed SQL command it executed, please try to figure out why your alias account doesn't work with the SQL command.

9 (edited by mrteam 2016-04-09 02:57:47)

Re: email alias bounced

[root@mx0 ~]# postmap -v -q 'adm@tvxxxrn.com.br' mysql:/etc/postfix/mysql/virtual_alias_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 3 IPv6 addresses
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: user = vmail
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: password = xxx
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: dbname = vmail
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: result_format = %s
postmap: cfg_get_int: /etc/postfix/mysql/virtual_alias_maps.cf: expansion_limit = 0
postmap: cfg_get_str: /etc/postfix/mysql/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
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: domain =
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: hosts = 127.0.0.1
postmap: dict_open: mysql:/etc/postfix/mysql/virtual_alias_maps.cf
postmap: dict_mysql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_mysql: successful connection to host 127.0.0.1
postmap: dict_mysql: successful query from host 127.0.0.1
postmap: dict_mysql_lookup: retrieved 1 rows
admin@tvxxxrn.com.br

[root@mx0 ~]# postmap -v -q 'robertson@tvxx.com.br' mysql:/etc/postfix/mysql/virtual_alias_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 3 IPv6 addresses
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: user = vmail
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: password = xxx
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: dbname = vmail
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: result_format = %s
postmap: cfg_get_int: /etc/postfix/mysql/virtual_alias_maps.cf: expansion_limit = 0
postmap: cfg_get_str: /etc/postfix/mysql/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
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: domain =
postmap: cfg_get_str: /etc/postfix/mysql/virtual_alias_maps.cf: hosts = 127.0.0.1
postmap: dict_open: mysql:/etc/postfix/mysql/virtual_alias_maps.cf
postmap: dict_mysql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_mysql: successful connection to host 127.0.0.1
postmap: dict_mysql: successful query from host 127.0.0.1
postmap: dict_mysql_lookup: retrieved 1 rows
beto@tvxxxrn.com.br

NOQUEUE: reject: RCPT from localhost.localdomain[127.0.0.1]: 550 5.1.1 <beto@tvrn.com.br>: Recipient address rejected: User unknown in virtual mailbox table; from=<gserver@bymr.me> to=<beto@tvrn.com.br> proto=ESMTP helo=<_>

MariaDB [vmail]> select * from alias where alias.islist = 1;
+------------------------------+-------------------------+------+------------+--------------+-------------------+--------+----------+----------+---------------------+---------------------+---------------------+--------+
| address                      | goto                    | name | moderators | accesspolicy | domain            | islist | is_alias | alias_to | created             | modified            | expired             | active |
+------------------------------+-------------------------+------+------------+--------------+-------------------+--------+----------+----------+---------------------+---------------------+---------------------+--------+
| adm@tvxxxrn.com.br           | admin@tvxxxrn.com.br |      | NULL       | public       | tvxxxrn.com.br |      1 |        0 |          | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 9999-12-31 00:00:00 |      1 |
| postmaster@tvxxxrn.com.br    | mauricio@bymr.com.br |      | NULL       | public       | tvxxxrn.com.br |      1 |        0 |          | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 9999-12-31 00:00:00 |      1 |
| robertson@tvxx.com.br        | beto@tvxxxrn.com.br  |      | NULL       | public       | tvxx.com.br    |      1 |        0 |          | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 9999-12-31 00:00:00 |      1 |
+------------------------------+-------------------------+------+------------+--------------+-------------------+--------+----------+----------+---------------------+---------------------+---------------------+--------+
3 rows in set (0.00 sec)