Problem on creating email user in Virtualmin User - unknown in virtual alias table

SYSTEM INFORMATION
OS type and version Ubuntu Linux 24.04.2
Webmin version 2.202
Virtualmin version 7.30.4 Pro
Webserver version Apache 2.4.58
Related packages SUGGESTED

I use the virtualmin interface to create email users, after creation, the usermin, imap/pop/smtp are normally logged in, and sent mails successfully. However, all incoming emails cannot be delivered to mailboxes. the log looks like below:

“User unknown in virtual alias table”

Here are the server’s postfix config content and user file content:

  1. # cat /etc/postfix/virtual

  admin@example.com       admin
  example.com       example.com
  webmaster@example.com     itadmin@abc.com
  postmaster@example.com    itadmin@abc.com
  abuse@example.com itadmin@abc.com
  hostmaster@example.com    itadmin@abc.com
  user1@example.com  user1\@example.com 
  user2@example.com  user2\@example.com 
  user3@example.com  user3\@example.com
  1. # cat /etc/postfix/main.cf

  smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
  biff = no
  
  append_dot_mydomain = no
  
  readme_directory = no
  
  compatibility_level = 3.6
  
  
  smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
  smtpd_tls_key_file = /etc/postfix/postfix.key.pem
  smtpd_tls_security_level = encrypt
  
  smtp_tls_CApath=/etc/ssl/certs
  smtp_tls_security_level = dane
  smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  
  
  smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
  myhostname = mail.example.com
  mydomain = example.com
  myorigin = $mydomain
  alias_maps = hash:/etc/aliases
  alias_database = hash:/etc/aliases
  mydestination = $myhostname, localhost.$mydomain , localhost
  mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
  mailbox_size_limit = 0
  recipient_delimiter = +
  inet_interfaces = all
  inet_protocols = ipv4
  virtual_alias_maps = hash:/etc/postfix/virtual
  sender_bcc_maps = hash:/etc/postfix/bcc
  sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
  home_mailbox = Maildir/
  smtpd_sasl_auth_enable = yes
  broken_sasl_auth_clients = yes
  smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination permit_inet_interfaces
  smtp_dns_support_level = dnssec
  smtp_host_lookup = dns
  allow_percent_hack = no
  resolve_dequoted_address = no
  milter_default_action = accept
  smtpd_milters = inet:127.0.0.1:8891
  non_smtpd_milters = inet:127.0.0.1:8891
  tls_server_sni_maps = hash:/etc/postfix/sni_map
  smtpd_tls_CAfile = /etc/postfix/postfix.ca.pem
  smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
  smtpd_client_restrictions = permit_mynetworks permit_inet_interfaces permit_tls_all_clientcerts permit_sasl_authenticated

  1. NO file: /etc/postfix/virtual_mailbox

  2. # id user1

id: ‘user1’: no such user

  1. # id user1@example.com

uid=1012(user1@example.com) gid=1001(admin) groups=1001(admin)

Looks kinda like you named your system the same as a domain you are hosting virtually? (i.e. you named your system example.tld and you’re hosting mail virtually for example.tld which doesn’t make sense)

If that’s not the case, we need to see the relevant log entries when you try to send mail to user that isn’t delivered. Probably the journal for the postfix unit (postconf -fu postfix and then try to send an email…the handful of entries that show up at that time are probably the relevant one). We always need logs.

my system named mail.example.com, and the domain hosting is example.com.

Something is getting lost in how you’re anonymizing your names, then, because this still looks like you’ve got virtual map entries trying to rewrite from user@example.tld to user@example.tld@example.tld.

image

The virtual map should be translating from the virtual user (user@example.tld) to the literal user on the system, but something extra is happening here.

Oh, wait. I see it.

Why did you change this?

myorigin should not be $mydomain if mydomain is a name you are hosting virtually. It’s the same as setting your hostname to the same as a virtually hosted domain in this case. You’ve named your system something reasonable, and then told postfix to ignore the reasonable thing and use the hostname that won’t work.

2 Likes

Thanks for help, the issue was fixed. :smiley: