Cannot receive emails to any virtual server

Virtualmin: 6.09
Webmin: 1.942
CentOS: 7.8.2003

I think I’ve got myself in a right old state - I need help.

I can send emails from my virtual servers but cannot receive any emails, to any virtual server.

This is the mail system at host server1.MAINDOMAIN.com
The mail system info.VIRTUALSERVER@MAINDOMAIN.com (expanded from info@VIRTUALSERVER.com): User unknown in virtual alias table

There’s obviously something going on globally as this is the same response to all emails sent to any of my virtualservers.

Virtualmin Re-Check Configuration passes ok

etc/hosts file:

123.456.789.1 server1 server1 ns1.MAINDOMAIN.com ns2.MAINDOMAIN.com
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

command “hostname” returns:

server1

This command: grep myhostname /etc/postfix/main.cf shows:

    # The myhostname parameter specifies the internet hostname of this
    # from gethostname(). $myhostname is used as a default value for many
    #myhostname = host.domain.tld
    #myhostname = virtual.domain.tld
    # The default is to use $myhostname minus the first component.
    # mail appears to come from. The default is to append $myhostname,
    #myorigin = $myhostname
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost
    # The default is $myhostname + localhost.$mydomain.  On a mail domain
    mydestination = $myhostname, localhost.$mydomain, localhost, server1
    #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
    # You MUST specify $myhostname at the start of the text. That is an
    #smtpd_banner = $myhostname ESMTP $mail_name
    #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
    myhostname = server1.MAINDOMAIN.com

Sorry, I should have tried this before I posted, but I had server1.MAINDOMAIN.COM as a virtual server, I gather that’s a no-no I deleted it and emails seem to be receiving now. I’ll check some more and post back if any probs.

1 Like

Yep, you can’t have a domain in Virtualmin that receives mail that matches the name of the server itself (without significant hoop jumping, so we just tell you to never do that). It confuses Postfix.

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