Reception of emails on the main domain

SYSTEM INFORMATION
OS type and version Debian Linux 9
Webmin version 2.001
Virtualmin version 7.2-1
Related packages Postfix, Dovecot, …

Hello,
many emails seem not to be received by my server, mainly on the addresses of the main domain name.
I have however read, re-read and tried the advice given in Email – Virtualmin and /troubleshooting/ but cannot solve the problem.
For example, I send an email from a google or other account to email addresses hosted by virtual servers on my server and it is delivered, but if I send to an email address from the main domain, it does not does not arrive and is not visible in the “user mail” page of this address.
After going through many topics, I suspect a problem between myorigin, myhostname and mydomain but can’t see which one.
Here is my postfix main.cf file.

# See /usr/share/postfix/main.cf.dist 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
myhostname = ns1.ekosysteme.fr
mydomain = ekosysteme.fr

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

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
home_mailbox = Maildir/
recipient_delimiter = +
inet_protocols = all
mynetworks_style = subnet
virtual_alias_maps = hash:/etc/postfix/virtual
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
smtpd_tls_security_level = may
smtp_tls_security_level = dane
smtpd_tls_CAfile = /etc/postfix/postfix.ca.pem
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
smtpd_recipient_restrictions = permit_inet_interfaces
smtputf8_autodetect_classes = verify
#mydomain = localdomain
#relay_domains = ${{$compatibility_level}, <, {2}, ?, {$mydestination}, :, {}},
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
#relay_domains = ${{$compatibility_level}, <, {2}, ?, {$mydestination}, :, {}}, collectifcreatifcastellas.org
#meta_directory = /etc/postfix
#setgid_group = postdrop
#command_directory = /usr/sbin
#sample_directory = /etc/postfix
#newaliases_path = /usr/bin/newaliases
#mailq_path = /usr/bin/mailq
#sendmail_path = /usr/sbin/sendmail
#daemon_directory = /usr/lib/postfix/sbin
#manpage_directory = /usr/share/man
#html_directory = /usr/share/doc/postfix/html
#data_directory = /var/lib/postfix
#shlib_directory = /usr/lib/postfix
#relay_domains = ${{$compatibility_level}, <, {2}, ?, {$mydestination}, :, {}}, ekoprojet.org, ekomundi.org, collectifcreatifcastellas.org
smtpd_recipient_limit = 3000
smtp_tls_security_level = dane
smtpd_sasl_auth_enable = yes
smtp_dns_support_level = dnssec
smtp_host_lookup = dns

Thanks for your help

We need to see the relevant mail.log entries when you attempt to send mail to the server.

Excuse me, the last logs in mail.err are

Oct 20 15:33:16 ns1 dovecot: imap-login: Error: read(anvil) failed: EOF
Oct 20 16:00:28 ns1 spamd[1375]: Can't locate Mail/SpamAssassin/CompiledRegexps/body_0.pm in @INC (you may need to install the Mail::SpamAssassin::CompiledRegexps::body_0 module) (@INC contains: /var/lib/spamassassin/compiled/5.024/3.004002 /var/lib/spamassassin/compiled/5.024/3.004002/auto /usr/share/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at (eval 1977) line 1.

There is no new log in mail.log

Then your DNS is wrong or a firewall is preventing outside servers from reaching your server. I would guess your hosting provider is blocking port 25 (in which case, you can’t really run a mail server, you’d probably need to use an SMTP relay service for outgoing, and incoming won’t work).

Even if configuration is wrong, you will see something in the mail log when you try to send an email to a domain on the server, assuming DNS is right and port 25 is open.

You can confirm DNS with: host -t mx <domain.tld> (this will generally return mail.domain.tld) and then confirm the name it returns points to the IP of your server with host <mail.domain.tld>. (Replace <domain.tld> with your actual domain name, no brackets.)

1 Like

Thanks for your reply.
I changed several things and rebooted since my last message and I realize that other things can interact.
For example, I disabled and then re-enabled spam and virus features on all servers and it seems to work better.
The command

host -t mx ekosysteme.fr

Return
ekosysteme.fr mail is handled by 50 mail.reseaucitoyen.org.
ekosysteme.fr mail is handled by 5 mail.ekosysteme.fr.

The command

host mail.ekosysteme.fr

Return
mail.ekosysteme.fr has address 95.142.175.103
mail.ekosysteme.fr has IPv6 address 2001:4b98:dc0:51:216:3eff:fe96:cc3b

so I think it’s ok on that side.
My address with the main domain is working now.
There are still reception problems with other addresses that I need to clarify.
Sorry for the inconvenience but I didn’t expect such a quick response. You can classify as solved for the moment, I will redo the tests.
thanks again

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