Topic: Per-user alias addresses have stopped working after 0.9.9 update
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Debian Stretch
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Problem: Per-user alias addresses on my system have stopped working, possibly as a result of 0.9.9 update. Messages to the target mailbox are working normally, but messages to any associated aliases are being refused with 'user unknown'.
Background: I had been running on 0.9.8 for about six months and per-user alias addresses had been working normally. However recently messages to any per-user alias addresses has been failing with a 'user unknown' bounce.
Looking at the dovecot log the problem appears to be a database lookup failure however I do not know why the lookup is now failing since nothing has changed in the SQL forwardings table since the prior working config, and furthermore non-forwarded mailboxes are receiving mail normally (only forwards to aliases are failing.)
This is possibly coincident with my recent update to 0.9.9 but not absolutely certain. All (manual) update steps during the update were performed without any problems, and I have confirmed that the two new fields in the SQL vmail database table are present, and the dovecot.conf file was modified as instructed (I do not know if these are a factor in the problem, but are the only things that I can see that would be related to the upgrade.)
Any ideas as to why per-user alias forwarding is now failing after working properly since the initial installation?
Thanks in advance.
(In all examples primary mailbox is 'target@mydomain.com' and alias is 'alias_address@mydomain.com')
Relevant data from logs:
Postfix:
Jan 10 03:05:33 mx1 postfix/pipe[25684]: D63CE425FE: to=<alias_address@mydomain.com>, relay=dovecot, delay=0.05, delays=0/0.02/0/0.02, dsn=5.1.1, status=bounced (user unknown)
Dovecot:
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: Loading modules from directory: /usr/lib/dovecot/modules
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: Module loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com: Debug: Module loaded: /usr/lib/dovecot/modules/lib15_notify_plugin.so
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: Module loaded: /usr/lib/dovecot/modules/lib20_mail_log_plugin.so
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: Module loaded: /usr/lib/dovecot/modules/lib20_mailbox_alias_plugin.so
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: Module loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: Module loaded: /usr/lib/dovecot/modules/lib90_stats_plugin.so
Jan 10 03:05:33 mx1 dovecot: auth: Debug: master in: USER#0111#011alias_address@mydomain.com#011service=lda
Jan 10 03:05:33 mx1 dovecot: auth-worker(25651): Debug: sql(alias_address@mydomain.com): SELECT 'alias_address@mydomain.com' AS master_user, LOWER(CONCAT(mailbox.storagebasedirectory, '/', mailbox.$
Jan 10 03:05:33 mx1 dovecot: auth-worker(25651): sql(alias_address@mydomain.com): unknown user
Jan 10 03:05:33 mx1 dovecot: auth: Debug: userdb out: NOTFOUND#0111
Jan 10 03:05:33 mx1 dovecot: lda(alias_address@mydomain.com): Debug: auth USER input:
Contents of dovecot-mysql.conf:
driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 port=3306 dbname=vmail user=vmail password=sql_password
# Required by doveadm tools which require to list all mail users.
iterate_query = SELECT username AS user FROM mailbox
password_query = SELECT mailbox.password, mailbox.allow_nets \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
AND mailbox.`enable%Ls%Lc`=1 \
AND mailbox.active=1 \
AND mailbox.domain=domain.domain \
AND domain.backupmx=0 \
AND domain.active=1
user_query = SELECT \
'%u' AS master_user, \
LOWER(CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir)) AS home, \
CONCAT(mailbox.mailboxformat, ':~/', mailbox.mailboxfolder, '/') AS mail, \
CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
AND mailbox.`enable%Ls%Lc`=1 \
AND mailbox.active=1 \
AND mailbox.domain=domain.domain \
AND domain.backupmx=0 \
AND domain.active=1
SQL database entries:
MariaDB [vmail]> SELECT * FROM forwardings;
+----+---------------------------+-------------------------+----------------+----------------+-------------+---------+---------------+----------+--------+
| id | address | forwarding | domain | dest_domain | is_maillist | is_list | is_forwarding | is_alias | active |
+----+---------------------------+-------------------------+----------------+----------------+-------------+---------+---------------+----------+--------+
| 4 | target@mydomain.com | target@mydomain.com | mydomain.com | mydomain.com | 0 | 0 | 1 | 0 | 1 |
| 5 | info@mydomain.com | target@mydomain.com | mydomain.com | mydomain.com | 0 | 0 | 1 | 1 | 1 |
| 6 | contact@mydomain.com | target@mydomain.com | mydomain.com | mydomain.com | 0 | 0 | 1 | 1 | 1 |
| 7 | postmaster@mydomain.com | target@mydomain.com | mydomain.com | mydomain.com | 0 | 0 | 1 | 1 | 1 |
|+----+-------------------------+-------------------------+----------------+----------------+-------------+---------+---------------+----------+--------+
Mail to the target mailbox (target@mydomain.com) is working but forwards to all aliases have stopped working. The above config had been working properly since 0.9.8 was originally installed.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.