Postfix mailserver trouble


I have managed to set up my web server on debian with various virtual servers in virtualmin, but I cannot get my mailserver to work. I am sending mail using mailgun and followed the tutorial at as well as the Mailgun-documentation at I am using Lets Encrypt Certificates and want to setup the mailserver for various domains/virtual servers. Two domains (, have already been transferred to the server, my main domain ( that I use for all my email is already set up in Virtualmin but the DNS records currently still point to my old shared webhosting provider.

I have the following issues:

  • I cannot receive any mails sent from outside the server (e.g. gmail), they do not even appear in the mail.log
  • I can receive internal mails in ReadUserMail, but they do not appear in my Thunderbird Inbox or Roundcube Inbox
  • I can send mails from Roundcube and ReadUserMail, but I cannot connect Thunderbird to the SMTP-Server. Telnet-Result on all SMTP-Ports (25, 465, 587) is "telnet: Unable to connect to remote host: Connection refused", ufw status is currently set to disabled.
  • The emails sent from roundcube/ReadUserMail are always signed by (the one I used as Lets encrypt certificate for Dovecot+Postfix), even if they are sent from
  • From my normal email-adress (on my old webhosting in Thunderbird I can send mails to (no bounce, but they never arrive on my mail server), but when trying to send mails to, I get the error "User unknown in virtual alias table". Domain 2 contains special characters.

My file:
# See /usr/share/postfix/ for a commented, more complete version

Debian specific: Specifying a file name will cause the first

line of that file to be used as the name. The Debian default

is /etc/mailname.

#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

appending .domain is the MUA’s job.

append_dot_mydomain = no

Uncomment the next line to generate “delayed mail” warnings

#delay_warning_time = 4h

readme_directory = no

mydomain =
myorigin = $mydomain
mydestination =,, , localhost
relayhost = []:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

TLS support

smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/
smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination

smtp_generic_maps = hash:/etc/postfix/generic
virtual_alias_maps = hash:/etc/postfix/virtual

myhostname =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_command = procmail -a “$EXTENSION”
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
smtpd_sasl_auth_enable = yes

Another strange thing I noticed: When I add my backup mx servers (mailgun) in my dns configuration with a lower priority (10 instead of 5), the mailgun MX-Server receives my mail. So my local server seems not to be running a mailserver?