1 (edited by zippydan 2015-06-28 02:06:01)

Topic: Recipient address rejected, not in virtual mailbox table, for alias

==== Required information ====
- iRedMail version: .0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): postgreSQL
- Web server (Apache or Nginx): apache
- Linux/BSD distribution name and version: Ubuntu
====

I added an alias to my iredmail postgres DB.  I've done this many times before with no problems.  I confirmed that the alias exists and is pointing to the right address in the alias table.

command I use:

INSERT INTO alias (address, goto, domain) VALUES (‘alias.email-ABCD@alias.domain.com’, ‘main.account@primary.domain.com’, ‘alias.domain.com’);

checking that the alias exists and is spelled correctly:

SELECT * FROM alias WHERE goto=‘main.account@primary.domain.com’;

reverse-lookup double-check:

SELECT * FROM alias WHERE address=‘alias.email-ABCD@alias.domain.com’;

When I send to the main account, mail is received.  When I send to the alias account, mail is immediately rejected.  The only thing I can guess right now is that it takes time for the "Virtual Mailbox Table" to update or refresh?  How can I directly view the "Virtual Mailbox Table"?  And/or how can I force a refresh from the DB?

The only other random thing I can guess is that this is the only alias I have created so far using a hyphen.  I have no clue why else this wouldn't be working.

Relevant /var/log/mail.log entry:

<alias.email-ABCD@alias.domain.com>: Recipient address rejected: User unknown in virtual mailbox table; from <someone@external.domain.com> to <alias.email-ABCD@alias.domain.com> proto=ESMTP helo=<LMNOP.another.domain.com>

----

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

2 (edited by mir 2015-06-25 04:46:28)

Re: Recipient address rejected, not in virtual mailbox table, for alias

zippydan wrote:

The only other random thing I can guess is that this is the only alias I have created so far using a hyphen.  I have no clue why else this wouldn't be working.

This is the regex for an email address: [\w\-][\w\-\.\+\=]*@[\w\-][\w\-\.]*\.[a-zA-Z0-9\-]{2,15}
This means that a hyphen is allowed (\-)

You can verify it yourself here: https://regex101.com/
Regular expression: [\w\-][\w\-\.\+\=]*@[\w\-][\w\-\.]*\.[a-zA-Z0-9\-]{2,15}
Test string: alias.email-ABCD@alias.domain.com

3

Re: Recipient address rejected, not in virtual mailbox table, for alias

mir wrote:
zippydan wrote:

The only other random thing I can guess is that this is the only alias I have created so far using a hyphen.  I have no clue why else this wouldn't be working.

This is the regex for an email address: [\w\-][\w\-\.\+\=]*@[\w\-][\w\-\.]*\.[a-zA-Z0-9\-]{2,15}
This means that a hyphen is allowed (\-)

You can verify it yourself here: https://regex101.com/
Regular expression: [\w\-][\w\-\.\+\=]*@[\w\-][\w\-\.]*\.[a-zA-Z0-9\-]{2,15}
Test string: alias.email-ABCD@alias.domain.com

Well that answers that question, but it doesn't tell me why my alias is not working.

6 hours since I added the alias to the db, and it still isn't working, so I'm not thinking it is a time-based refresh thing anymore...  what else can I check?

4

Re: Recipient address rejected, not in virtual mailbox table, for alias

We have to tutorial for you if you want to create mail alias account manually:
http://www.iredmail.org/docs/sql.create.mail.alias.html

You missed column 'alias.islist=1', this is required by iRedAdmin-Pro, but not required by Postfix/Dovecot, so it doesn't impact in your case.

zippydan wrote:

INSERT INTO alias (address, goto, domain) VALUES (‘alias.email-ABCD@alias.domain.com’, ‘main.account@primary.domain.com’, ‘alias.domain.com’);

this SQL command looks incorrect: Do you host mail domain 'alias.domain.com' locally?

5

Re: Recipient address rejected, not in virtual mailbox table, for alias

ZhangHuangbin wrote:

We have to tutorial for you if you want to create mail alias account manually:
http://www.iredmail.org/docs/sql.create.mail.alias.html

You missed column 'alias.islist=1', this is required by iRedAdmin-Pro, but not required by Postfix/Dovecot, so it doesn't impact in your case.

zippydan wrote:

INSERT INTO alias (address, goto, domain) VALUES (‘alias.email-ABCD@alias.domain.com’, ‘main.account@primary.domain.com’, ‘alias.domain.com’);

this SQL command looks incorrect: Do you host mail domain 'alias.domain.com' locally?

The SQL command is correct for postgres at least.

I have used this command for dozens of other aliases and they are all working.  Postgres responds with "INSERT 0 1" to confirm the SQL command was executed successfully, and I can check the table to see that the entries are there.

The mx records for primary.domain.com and alias.domain.com both point to the box running iredadmin, and I have other aliases using alias.domain.com working fine.

6

Re: Recipient address rejected, not in virtual mailbox table, for alias

The SQL command syntax is correct, i mean the value in SQL command may be not correct.

iRedMail doesn't add any email address with alias domain in `alias` table, although it works, but we don't add it directly.
If same SQL command works for you with other email aliases, i have no idea why it doesn't work this time. Do you have any typo in these email addresses?

7 (edited by zippydan 2015-06-27 00:02:23)

Re: Recipient address rejected, not in virtual mailbox table, for alias

ZhangHuangbin wrote:

The SQL command syntax is correct, i mean the value in SQL command may be not correct.

iRedMail doesn't add any email address with alias domain in `alias` table, although it works, but we don't add it directly.
If same SQL command works for you with other email aliases, i have no idea why it doesn't work this time. Do you have any typo in these email addresses?

I have double-checked and triple-checked to make sure the e-mail is spelled correctly both in the DB and when trying to send a test e-mail (I have tried copy-paste as well to insure it is identical).

What I am wondering is if there is a command line option to run through exactly what steps Postfix is doing when it tries to find whether an email address "exists" on the system.  I want to narrow down exactly where the failure is occurring.  I know that the alias.email exists in the database, so where exactly is the mismatch occurring when the e-mail arrives?  Why is it not matching the listed recipient email to the entry in the DB?  Is there some intermediate step that is failing?  Does it perform an SQL lookup when an email arrives?  What is the syntax for that lookup?  etc.

8

Re: Recipient address rejected, not in virtual mailbox table, for alias

zippydan wrote:

What I am wondering is if there is a command line option to run through exactly what steps Postfix is doing when it tries to find whether an email address "exists" on the system.  I want to narrow down exactly where the failure is occurring.  I know that the alias.email exists in the database, so where exactly is the mismatch occurring when the e-mail arrives?  Why is it not matching the listed recipient email to the entry in the DB?  Is there some intermediate step that is failing?  Does it perform an SQL lookup when an email arrives?  What is the syntax for that lookup?  etc.

You could increase logging of MySQL to see what requests Postfix actually sends when checking for the mailbox to deliver to.

9

Re: Recipient address rejected, not in virtual mailbox table, for alias

Try this and paste the FULL terminal output here:

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

10

Re: Recipient address rejected, not in virtual mailbox table, for alias

ZhangHuangbin wrote:

Try this and paste the FULL terminal output here:

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

I'm using PostreSQL

11

Re: Recipient address rejected, not in virtual mailbox table, for alias

zippydan wrote:

I'm using PostreSQL

Just replace 'mysql' by 'pgsql'.

12 (edited by zippydan 2015-06-30 09:34:42)

Re: Recipient address rejected, not in virtual mailbox table, for alias

ZhangHuangbin wrote:
zippydan wrote:

I'm using PostreSQL

Just replace 'mysql' by 'pgsql'.


Command:

# sudo -i
# cd /etc/postfix/pgsql/
# for cf in $(ls *cf); do echo $cf; postmap -q 'alias.email@alias.domain.com' pgsql:./$cf; done

Result:

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

I got "Permission denied" errors without sudo -i.  smile

13

Re: Recipient address rejected, not in virtual mailbox table, for alias

Please add '-v' flag for postmap command and try again:

# sudo -i
# cd /etc/postfix/pgsql/
# for cf in $(ls *cf); do echo $cf; postmap -v -q 'alias.email@alias.domain.com' pgsql:./$cf; done

14

Re: Recipient address rejected, not in virtual mailbox table, for alias

ZhangHuangbin wrote:

Please add '-v' flag for postmap command and try again:

# sudo -i
# cd /etc/postfix/pgsql/
# for cf in $(ls *cf); do echo $cf; postmap -v -q 'alias.email@alias.domain.com' pgsql:./$cf; done

catchall_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./catchall_maps.cf: user = vmail
postmap: cfg_get_str: ./catchall_maps.cf: password = SeCrEt
postmap: cfg_get_str: ./catchall_maps.cf: dbname = vmail
postmap: cfg_get_str: ./catchall_maps.cf: result_format = %s
postmap: cfg_get_int: ./catchall_maps.cf: expansion_limit = 0
postmap: cfg_get_str: ./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
postmap: cfg_get_str: ./catchall_maps.cf: domain =
postmap: cfg_get_str: ./catchall_maps.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./catchall_maps.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
domain_alias_catchall_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./domain_alias_catchall_maps.cf: user = vmail
postmap: cfg_get_str: ./domain_alias_catchall_maps.cf: password = SeCrEt
postmap: cfg_get_str: ./domain_alias_catchall_maps.cf: dbname = vmail
postmap: cfg_get_str: ./domain_alias_catchall_maps.cf: result_format = %s
postmap: cfg_get_int: ./domain_alias_catchall_maps.cf: expansion_limit = 0
postmap: cfg_get_str: ./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
postmap: cfg_get_str: ./domain_alias_catchall_maps.cf: domain =
postmap: cfg_get_str: ./domain_alias_catchall_maps.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./domain_alias_catchall_maps.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
domain_alias_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./domain_alias_maps.cf: user = vmail
postmap: cfg_get_str: ./domain_alias_maps.cf: password = SeCrEt
postmap: cfg_get_str: ./domain_alias_maps.cf: dbname = vmail
postmap: cfg_get_str: ./domain_alias_maps.cf: result_format = %s
postmap: cfg_get_int: ./domain_alias_maps.cf: expansion_limit = 0
postmap: cfg_get_str: ./domain_alias_maps.cf: query = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=('%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
postmap: cfg_get_str: ./domain_alias_maps.cf: domain =
postmap: cfg_get_str: ./domain_alias_maps.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./domain_alias_maps.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
recipient_bcc_maps_domain.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./recipient_bcc_maps_domain.cf: user = vmail
postmap: cfg_get_str: ./recipient_bcc_maps_domain.cf: password = SeCrEt
postmap: cfg_get_str: ./recipient_bcc_maps_domain.cf: dbname = vmail
postmap: cfg_get_str: ./recipient_bcc_maps_domain.cf: result_format = %s
postmap: cfg_get_int: ./recipient_bcc_maps_domain.cf: expansion_limit = 0
postmap: cfg_get_str: ./recipient_bcc_maps_domain.cf: query = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1
postmap: cfg_get_str: ./recipient_bcc_maps_domain.cf: domain =
postmap: cfg_get_str: ./recipient_bcc_maps_domain.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./recipient_bcc_maps_domain.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
recipient_bcc_maps_user.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./recipient_bcc_maps_user.cf: user = vmail
postmap: cfg_get_str: ./recipient_bcc_maps_user.cf: password = SeCrEt
postmap: cfg_get_str: ./recipient_bcc_maps_user.cf: dbname = vmail
postmap: cfg_get_str: ./recipient_bcc_maps_user.cf: result_format = %s
postmap: cfg_get_int: ./recipient_bcc_maps_user.cf: expansion_limit = 0
postmap: cfg_get_str: ./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 recipient_bcc_user.active=1 AND domain.backupmx=0 AND domain.active=1
postmap: cfg_get_str: ./recipient_bcc_maps_user.cf: domain =
postmap: cfg_get_str: ./recipient_bcc_maps_user.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./recipient_bcc_maps_user.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
relay_domains.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./relay_domains.cf: user = vmail
postmap: cfg_get_str: ./relay_domains.cf: password = SeCrEt
postmap: cfg_get_str: ./relay_domains.cf: dbname = vmail
postmap: cfg_get_str: ./relay_domains.cf: result_format = %s
postmap: cfg_get_int: ./relay_domains.cf: expansion_limit = 0
postmap: cfg_get_str: ./relay_domains.cf: query = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1
postmap: cfg_get_str: ./relay_domains.cf: domain =
postmap: cfg_get_str: ./relay_domains.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./relay_domains.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
sender_bcc_maps_domain.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./sender_bcc_maps_domain.cf: user = vmail
postmap: cfg_get_str: ./sender_bcc_maps_domain.cf: password = SeCrEt
postmap: cfg_get_str: ./sender_bcc_maps_domain.cf: dbname = vmail
postmap: cfg_get_str: ./sender_bcc_maps_domain.cf: result_format = %s
postmap: cfg_get_int: ./sender_bcc_maps_domain.cf: expansion_limit = 0
postmap: cfg_get_str: ./sender_bcc_maps_domain.cf: query = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1
postmap: cfg_get_str: ./sender_bcc_maps_domain.cf: domain =
postmap: cfg_get_str: ./sender_bcc_maps_domain.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./sender_bcc_maps_domain.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
sender_bcc_maps_user.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./sender_bcc_maps_user.cf: user = vmail
postmap: cfg_get_str: ./sender_bcc_maps_user.cf: password = SeCrEt
postmap: cfg_get_str: ./sender_bcc_maps_user.cf: dbname = vmail
postmap: cfg_get_str: ./sender_bcc_maps_user.cf: result_format = %s
postmap: cfg_get_int: ./sender_bcc_maps_user.cf: expansion_limit = 0
postmap: cfg_get_str: ./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 sender_bcc_user.active=1 AND domain.backupmx=0 AND domain.active=1
postmap: cfg_get_str: ./sender_bcc_maps_user.cf: domain =
postmap: cfg_get_str: ./sender_bcc_maps_user.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./sender_bcc_maps_user.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
sender_login_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./sender_login_maps.cf: user = vmail
postmap: cfg_get_str: ./sender_login_maps.cf: password = SeCrEt
postmap: cfg_get_str: ./sender_login_maps.cf: dbname = vmail
postmap: cfg_get_str: ./sender_login_maps.cf: result_format = %s
postmap: cfg_get_int: ./sender_login_maps.cf: expansion_limit = 0
postmap: cfg_get_str: ./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
postmap: cfg_get_str: ./sender_login_maps.cf: domain =
postmap: cfg_get_str: ./sender_login_maps.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./sender_login_maps.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
transport_maps_domain.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./transport_maps_domain.cf: user = vmail
postmap: cfg_get_str: ./transport_maps_domain.cf: password = SeCrEt
postmap: cfg_get_str: ./transport_maps_domain.cf: dbname = vmail
postmap: cfg_get_str: ./transport_maps_domain.cf: result_format = %s
postmap: cfg_get_int: ./transport_maps_domain.cf: expansion_limit = 0
postmap: cfg_get_str: ./transport_maps_domain.cf: query = SELECT transport FROM domain WHERE domain='%s' AND active=1
postmap: cfg_get_str: ./transport_maps_domain.cf: domain =
postmap: cfg_get_str: ./transport_maps_domain.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./transport_maps_domain.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
transport_maps_user.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./transport_maps_user.cf: user = vmail
postmap: cfg_get_str: ./transport_maps_user.cf: password = SeCrEt
postmap: cfg_get_str: ./transport_maps_user.cf: dbname = vmail
postmap: cfg_get_str: ./transport_maps_user.cf: result_format = %s
postmap: cfg_get_int: ./transport_maps_user.cf: expansion_limit = 0
postmap: cfg_get_str: ./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
postmap: cfg_get_str: ./transport_maps_user.cf: domain =
postmap: cfg_get_str: ./transport_maps_user.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./transport_maps_user.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
virtual_alias_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./virtual_alias_maps.cf: user = vmail
postmap: cfg_get_str: ./virtual_alias_maps.cf: password = SeCrEt
postmap: cfg_get_str: ./virtual_alias_maps.cf: dbname = vmail
postmap: cfg_get_str: ./virtual_alias_maps.cf: result_format = %s
postmap: cfg_get_int: ./virtual_alias_maps.cf: expansion_limit = 0
postmap: cfg_get_str: ./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: ./virtual_alias_maps.cf: domain =
postmap: cfg_get_str: ./virtual_alias_maps.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./virtual_alias_maps.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
virtual_mailbox_domains.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./virtual_mailbox_domains.cf: user = vmail
postmap: cfg_get_str: ./virtual_mailbox_domains.cf: password = SeCrEt
postmap: cfg_get_str: ./virtual_mailbox_domains.cf: dbname = vmail
postmap: cfg_get_str: ./virtual_mailbox_domains.cf: result_format = %s
postmap: cfg_get_int: ./virtual_mailbox_domains.cf: expansion_limit = 0
postmap: cfg_get_str: ./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
postmap: cfg_get_str: ./virtual_mailbox_domains.cf: domain =
postmap: cfg_get_str: ./virtual_mailbox_domains.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./virtual_mailbox_domains.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows
virtual_mailbox_maps.cf
postmap: name_mask: all
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 0 IPv6 addresses
postmap: cfg_get_str: ./virtual_mailbox_maps.cf: user = vmail
postmap: cfg_get_str: ./virtual_mailbox_maps.cf: password = SeCrEt
postmap: cfg_get_str: ./virtual_mailbox_maps.cf: dbname = vmail
postmap: cfg_get_str: ./virtual_mailbox_maps.cf: result_format = %s
postmap: cfg_get_int: ./virtual_mailbox_maps.cf: expansion_limit = 0
postmap: cfg_get_str: ./virtual_mailbox_maps.cf: query = SELECT (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
postmap: cfg_get_str: ./virtual_mailbox_maps.cf: domain =
postmap: cfg_get_str: ./virtual_mailbox_maps.cf: hosts = 127.0.0.1
postmap: dict_open: pgsql:./virtual_mailbox_maps.cf
postmap: dict_pgsql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_pgsql: successful connection to host 127.0.0.1
postmap: dict_pgsql: successful query from host 127.0.0.1
postmap: dict_pgsql_lookup: retrieved 0 rows

I'm guessing that "retrieved 0 rows" is a bad thing and explains why my alias isn't working.  The question is "why?"

15

Re: Recipient address rejected, not in virtual mailbox table, for alias

I expect you to reply earlier, at least not 17 days later. so that i don't need to re-read all old posts in this thread to know what issue we were trying to solve.

zippydan wrote:

virtual_alias_maps.cf
...
postmap: cfg_get_str: ./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: dict_pgsql_lookup: retrieved 0 rows

Does this sql command return any record if you run it manually on mysql command line? If no record, please check the values of all columns, compare the the sql command, then you should figure out why it doesn't return a record.