Email fowarding to same domain (internally) fails. Mail Delivery System: "Unknown user"

I am trying to forward bookings@domain.com to kyle@domain.com

Same domain.

I have ticked “Forward to other addresses” under Mail forwarding options for bookings@domain.com and then entered kyle@domain.com as the email address to forward too. See screenshot (actual domain redacted).

Whenever an email is sent to bookings@domain.com, the sender receives a Mail Delivery System email stating:

kyle@domain.com (expanded from bookings@domain.com): unknown
user: “kyle”

I ran the virtualmin configuration checker and it shows no issues.

Any idea why internal mail forwarding to the same domain is not working?

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.6
Webmin version 2.101
Virtualmin version 7.7

Have you checked that the username kyle is valid and working in domain.com ?

kyle@domain.com is my primary email address and I use it daily with no problems.


I’ll see if I can replicate. Just a question, does bookings@ need to be a email account? You can just use Mail Aliases otherwise.

P.S. Just did what you did and works fine, sent a email from my gmail account.

The only thing that sticks out in the error is user:“kyle” and not kyle@domain.com or kyle-domain.com

If I remove kyle account and send to bookings@ I get this error

<kyle@domain.com> (expanded from <bookings@domain.com>): User unknown in virtual
alias table

---------- Forwarded message ----------
From: Steve <mygmailname@gmail.com>
To: bookings@domain.com
Cc:
Bcc:
Date: Fri, 8 Sep 2023 18:59:25

I agree, the fact that it does not say @domain.com in the error is a clue, but I couldn’t figure out what the problem is. Any suggestions on what to check?

Yes, bookings@domain.com needs to be it’s own email, but I want it also forwarded to kyle@domain.com

I did from external i just realized you did internally, not sure why that would be different though.

P.S. Internally work fine as well.

Postfix mail alias table is it using kyle? If so you can manually fix it but it shouldn’t be doing that.

This is from the Postfix Mail Aliases under Webmin.

It creates this entry when I enable forwarding as discussed above.

Is there somewhere else I should be checking?

P.S, if I forward to an external address it works, so the issue seems to only be when forwarding to the same domain internally.

Looks exactly what I have. Seems your local deliver is dropping the domain. I know this can be done somewhere in the postfix config.

Seen some say mydestination in main.cf can cause something that. Mine is.
mydestination = $myhostname,localhost.$mydomain, localhost

Thanks for the reply.

I tried changing mydestination entries, and even tried yours then restarted the postfix service and it made no change unfortunately. Still the same with “unknown
user: “kyle””

Really not sure what else to do.

Got me, strange one. If you send from a email address to bookings@ from a gmail address or external email address same things happens I presume.
I know you can rebuild the virtual.db file with postmap command
postmap /etc/postfix/virtual

then restart postfix, long shot :slight_smile:

Yeah I’ve tried sending emails to bookings@ from an Outlook.com account and a Gmail account. Same issue.

Trued rebuilding the virtual.db file, no luck. Might have to nuke the install and start again :frowning:

@stefan1959 I forwarded it to another domain on my server and that works, so it’s only with my primary domain/hostname.

When I set the forwarding address to kyle-domain.com (instead of kyle@domain.com), the forwarding works. That must give some clue…?

Maybe format of address has something to do with it.

Hmm don’t think so. My template is the same as yours and is the default. The usernames also show with the @domain.com, it’s just whenever trying to use forwarding that postfix drops the @domain.

I found a section in postfix called Address rewriting and masquerading and theres this "rewrite “user” to “user@$mydomain.com”. I have specified mydomain in the postfix main.cf but this doesn’t seem to do anything.

Its getting out of my knowledge. The only thing I do different (just to get roundcube working correct) and can’t see it fixing things, but you never know is this setting.

That will create a extra user fixes authentication issue with roundcube.

So users and groups in webmin look like this

What is the output of this command on your system:

postconf -n | grep resolve_dequoted_address

The option named Prevent use of @ in mailbox names? is actually resolve_dequoted_address, and it should be set to No.

You shouldn’t really enable creation of extra Unix user for Postfix.

I tried setting resolve_dequoted_address to no already and it made no difference.

It seems the issue is @domain.com is not being appended during some part of the forwarding.

I wouldn’t but for some reason Roundcube won’t authenticate with it. I agree its not postfix thing.

And what is the actual Unix user name?

There was a discussion in the forum about how to fix this for RoundCube.