1

Topic: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro? YES
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi, I added a new domain to iredadmin pro and all mails coming in are declined because the user is "unknown", but the users exist in the iredadmin webinterface and are shown in the database.

SELECT username FROM vmail.mailbox WHERE domain='example.de';

shows the user list, and all of them cant recieve mails.. please help sad

----

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

2 (edited by lug 2019-01-14 18:20:28)

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

Deleting and rereating it was the 'solution', but is there any thing I can do when I encounter this next time?
Luckily this domain had only 40 accounts and only some aliases.

Edit: A colleague of mine at work told me that he had the same issue some days ago, but only with one user, deleting and recreating the user worked for him.

3

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

Need to turn on debug mode in Dovecot to get more detail log.

4

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

Ok, gonna restore the VM into a clone from a backup from yesterday, and then I'll have a look at it smile

5

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

I've set

auth_verbose = yes
auth_debug = yes
mail_debug = yes

in /etc/dovecot/conf.d/10-logging.conf and restarted dovecot.

But there is the same amount of information as before.

6

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

Any idea?

7

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

lug wrote:

in /etc/dovecot/conf.d/10-logging.conf and restarted dovecot.

Wrong config file. iRedMail uses /etc/dovecot/dovecot.conf.
FYI: https://docs.iredmail.org/debug.dovecot.html

8 (edited by lug 2019-01-25 18:02:39)

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

Ok, with debug log I get this:

Jan 25 10:47:27 mail dovecot: auth-worker(22952): Debug: sql(postmaster@example.de): SELECT 'postmaster@example.de' AS master_user, CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='postmaster@example.de' AND mailbox.domain='example.de' AND mailbox.`enablelda`=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1
Jan 25 10:47:27 mail dovecot: auth-worker(22952): sql(postmaster@example.de): unknown user
Jan 25 10:47:27 mail dovecot: auth: Debug: userdb out: NOTFOUND#0111

If I do that mysql search manually, it works fine, until "AND domain.backupmx=0" gets into that search, then the output is empty. Without that there is exact one result.

9

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

lug wrote:

If I do that mysql search manually, it works fine, until "AND domain.backupmx=0" gets into that search, then the output is empty. Without that there is exact one result.

Is this domain a backup MX (with domain.backupmx=1)?

10 (edited by lug 2019-01-28 17:51:03)

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

Nope
https://i.imgur.com/DNZzhaL.png

The only thing that has been changed is setting the domain from relay mode smtp:[xyz]:25 to dovecot.

The webinterface is buggy anyway, when I hit save it sometimes applies settings I didn't tick. Some days ago I adjusted the Spam-Score setting, after hitting save every option in amavis conf was set to D_DISCARD, but in the webinterface it was not visible, I guess database and config files are not very well synchronized.
This happened on different installations with ldap and mysql versions.

Edit: As I thought, enabling backup mx and then disable it solves it. But thats not really a solution.

11

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

lug wrote:

The webinterface is buggy anyway, when I hit save it sometimes applies settings I didn't tick. Some days ago I adjusted the Spam-Score setting, after hitting save every option in amavis conf was set to D_DISCARD, but in the webinterface it was not visible, I guess database and config files are not very well synchronized.

Sorry about this trouble.

Could you please show me detailed instruction to reproduce this issue? Which settings did you adjust? and set to which value/option?

12

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

lug wrote:

The only thing that has been changed is setting the domain from relay mode smtp:[xyz]:25 to dovecot.

Could you please show me the output of SQL commands below?

USE vmail;
SELECT * FROM domain WHERE domain="<the-real-domain>" \G

Please replace "<the-real-domain>" by your real email domain name.

13

Re: Remote Server returned '554 5.1.1 < #5.1.1 x-unix; user unknown>'

It's not really reproducable, it happens in like one out of 10 times, it's just completely random.
I can exclude my browser as the error source, because it also happened on a coworkers mac with safari, I just chrome on windows. I'd really like to track down the issue, but the problem is that the problems are noticed up to hours or days later, and finding the correct log entry then is nearly impossible, unless you document every single change you do...

ZhangHuangbin wrote:
USE vmail;
SELECT * FROM domain WHERE domain="<the-real-domain>" \G

https://i.imgur.com/WKvZlFt.png

Now backupmx is set to 0, because I enabled and disabled it via webinterface, but I guess if I restore backup and do the same, it will show 1.
And the change to dovecot was executed correct, but it changes more than I wanted in that specific case ^^