E-Mail works for one domain, but not other ... Kind of ("Read User Mail" works for ONE of the addresses)

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.6
Virtualmin version 7.8.2 Pro

I recently formatted and started over from scratch with Virtualmin, and I thought everything was going well until I transferred a friend’s domain to the new server. Here’s the issue:

  • Email works on the first domain I added (Manually, not a transfer/backup) - I can send and receive just fine. The domain is domain.space, and the hostname of the server is sg.domain.space
  • I backed up, transferred, then restored a friend’s domain from my old server - his email doesn’t work at all. He can login but he can’t receive anything and sending doesn’t work either - there are no errors, it’s just that neither work. The other server was Virtualmin (GPL) 7.8.2
  • I added a new email to the domain that isn’t working, and I sent a test email from a gmail account and… It doesn’t show up in webmail.domain.com BUT it does show up when I go to “Read User Mail”.
  • “Read User Mail” doesn’t show any sent or received email for the other accounts on the messed up domain.
  • I looked at /var/log/mail.log and I think I see the emails that were sent or “received”, but they just don’t make their way to the mailboxes

I just tried emailing the new email (Worked… Kind of - it’s visible in Read User Mail but not webmail), and the ‘broken’ email. I got this email back shortly after:

This is the mail system at host sg.domain.space.

I’m sorry to have to inform you that your message could not
be delivered to one or more recipients. It’s attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

info@otherdomain.com: User unknown in virtual alias table

I also checked mail.log again and:

Oct 20 19:54:18 sg postfix/local[869054]: 73C8813627AB: to=test.otherdomain@domain.space, orig_to=test@otherdomain.com, relay=local, delay=19, delays=0.06/0.01/0/19, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Oct 20 19:54:18 sg postfix/cleanup[869051]: 167CE136280F: message-id=20231020195418.167CE136280F@sg.domain.space
Oct 20 19:54:18 sg postfix/bounce[869059]: 73C8813627AB: sender non-delivery notification: 167CE136280F

Oct 20 19:54:19 sg postfix/smtp[869254]: random: to=user@gmail.com, relay=gmail-smtp-in.l.google.com[142.250.113.27]:25, delay=1.6, delays=0.03/0.01/0.2/1.4, dsn=5.7.26, status=bounced (host gmail-smtp-in.l.google.com[142.250.113.27] said: 550-5.7.26 This mail has been blocked because the sender is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results: 550-5.7.26 DKIM = did not pass 550-5.7.26 SPF with ip: [ServerIP] = did not pass 550-5.7.26 550-5.7.26 To mitigate this issue, please visit Gmail’s authentication guide 550-5.7.26 for instructions on setting up authentication: 550 5.7.26 Email sender guidelines - Gmail Help

Used https://dkimvalidator.com/
And it passed, but at the bottom I see:

0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
valid
0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid

Just deleted the virtual server for the broken domain and recreated it, letting virtualmin re-make the dns and… I can send, but can’t receive. If I send from a non-gmail, I get:

Oct 21 14:04:44 sg postfix/local[1032857]: 6A6601361CF2: to=<info@domain.com@domain.space>, orig_to=info@domain.com, relay=local, delay=19, delays=0.04/0.01/0/19, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)

If I send from a gmail I don’t see anything in mail.log

Edit:

I sent another email from a gmail account to the ‘broken’ email address/domain, and checked Postfix’s mail queue and it was there! I then went to ‘Read User Mail’ and… Nothing, no new email in any of the folders

The error message you’re seeing, User unknown in virtual alias table , indicates that Postfix was unable to find a mapping for the email address info@domain.com in its virtual alias table. Essentially, this means that Postfix doesn’t know where to deliver emails addressed to info@otherdomain.com .

That said, do you have mail for domain feature enabled in Edit Virtual Server page? Did you check for the relevant directives in your /etc/postfix/virtual alias map file to see if everything is correct?

Also, what is the domain name that cannot receive mail, and what is the hostname for your system? For privacy reasons, you can change your actual TLD name but keep the change consistent.

You can also run the following command to get interactive logs from Postfix while sending mail from Gmail to your server:

journalctl -f -u postfix

I managed to fix the ‘User unknown in virtual alias table’ - I guess since this was originally (YEARS ago) a cPanel import into virtualmin, then virtualmin->virtualmin - the email username was configured as user@domain.tld, but accounts on the new server are all user.domain as the username. I just deleted the email accounts and remade them and they all worked.

Yeah, mail for domain is enabled. The aliases existed in the map file too which is weird.

I sent in an official support request last night and am going to continue there since you may need my domain names, but I’d like to keep this thread open to share what we did to fix things in case someone else has the same issues.

@Jamie, is there a good way to handle it upon migration?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.