Postfix and DNS setting up, how to get a working Mail server

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04
Virtualmin version 7.3-1

Howdy

having found a lot of difficulties in setting up Postfix correctly–especially the SMTP protocol–I need to ask about good rules for matching Virtualmin DNS with those of the domain provider, which in my case is OVH.

These are the two lists:

massaggiatorepercervicale.com.                         0	NS	dns200.anycast.me.		
massaggiatorepercervicale.com.                         0	NS	ns200.anycast.me.		
massaggiatorepercervicale.com.                         0	MX	1 mx4.mail.ovh.net.		
massaggiatorepercervicale.com.                         0	A	162.55.37.58		
webmail.massaggiatorepercervicale.com.                 0	A	162.55.37.58		
www.massaggiatorepercervicale.com.                     0	A	162.55.37.58		
massaggiatorepercervicale.com.                         0	TXT	"1|www.massaggiatorepercervicale.com"		
massaggiatorepercervicale.com.                         0    SPF	"v=spf1 include:mx.ovh.com ~all"		
autoconfig.massaggiatorepercervicale.com.              0	CNAME	mailconfig.ovh.net.		
autodiscover.massaggiatorepercervicale.com.            0	CNAME	mailconfig.ovh.net.		
_autodiscover._tcp.massaggiatorepercervicale.com.      0	SRV	0 0 443 mailconfig.ovh.net.		
ftp.massaggiatorepercervicale.com.                     0	CNAME	massaggiatorepercervicale.com.		
imap.massaggiatorepercervicale.com.                    0	CNAME	ssl0.ovh.net.		
_imaps._tcp.massaggiatorepercervicale.com.             0	SRV	0 0 993 ssl0.ovh.net.		
pop3.massaggiatorepercervicale.com.                    0	CNAME	ssl0.ovh.net.		
smtp.massaggiatorepercervicale.com.                    0	CNAME	ssl0.ovh.net.		
_submission._tcp.massaggiatorepercervicale.com.        0	SRV	0 0 465 ssl0.ovh.net.		
www.massaggiatorepercervicale.com.                     0	TXT	"3|welcome"		
www.massaggiatorepercervicale.com.                     0	TXT	"l|it"



massaggiatorepercervicale.com	                       SOA - Start Of Domain	host.borsedilussoartigianali.com. root.host.borsedilussoartigianali.com. 20 ...
massaggiatorepercervicale.com	                       NS - Name Server	host.borsedilussoartigianali.com.
massaggiatorepercervicale.com	                       A - IPv4 Address	162.55.37.58
www.massaggiatorepercervicale.com	               A - IPv4 Address	162.55.37.58
ftp.massaggiatorepercervicale.com	               A - IPv4 Address	162.55.37.58
m.massaggiatorepercervicale.com	                       A - IPv4 Address	162.55.37.58
localhost.massaggiatorepercervicale.com	               A - IPv4 Address	127.0.0.1
webmail.massaggiatorepercervicale.com	               A - IPv4 Address	162.55.37.58
admin.massaggiatorepercervicale.com	               A - IPv4 Address	162.55.37.58
mail.massaggiatorepercervicale.com	               A - IPv4 Address	162.55.37.58
massaggiatorepercervicale.com	                       MX - Mail Server	5 mail.massaggiatorepercervicale.com.
massaggiatorepercervicale.com	                       SPF - Sender Permitted From	v=spf1 a mx a:massaggiatorepercervicale.com ip4:162.55.37.58 ip4:162.55.37. ...
massaggiatorepercervicale.com	                       AAAA - IPv6 Address	2a01:4f8:c17:1fe5::1
www.massaggiatorepercervicale.com	               AAAA - IPv6 Address	2a01:4f8:c17:1fe5::1
ftp.massaggiatorepercervicale.com	               AAAA - IPv6 Address	2a01:4f8:c17:1fe5::1
m.massaggiatorepercervicale.com	                       AAAA - IPv6 Address	2a01:4f8:c17:1fe5::1
webmail.massaggiatorepercervicale.com	               AAAA - IPv6 Address	2a01:4f8:c17:1fe5::1
admin.massaggiatorepercervicale.com	               AAAA - IPv6 Address	2a01:4f8:c17:1fe5::1
mail.massaggiatorepercervicale.com	               AAAA - IPv6 Address	2a01:4f8:c17:1fe5::1
202210._domainkey.massaggiatorepercervicale.com	       TXT - Text	v=DKIM1; k=rsa; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvs74ca99 ...
_dmarc.massaggiatorepercervicale.com	               DMARC	v=DMARC1; p=quarantine; pct=100; adkim=r; aspf=r

What is the main logic for everything to work correctly? Do the entries on the virtual server have to match exactly with those on OVH?

My priority is to have a working mail server with the correct relay host setting, which I understand to be the basic condition for being able to add mail addresses that do their job without being considered spam accounts.

I have tried all sorts of ways to set Postfix’s main.cf file but have not been able to get what I was looking for.

I therefore told myself that the first step was to have all DNS in order.

Can someone please assist?

Thank you in advance.

on first example you’re using OVH mail servers (OVH relay) then you use mail relay for virtualmin.
on second example you probably set your own mail server (own relay). then you use mail server in virtualmin without external relay.

haven’t understood which one you prefer, so setting it up depends on what you want to do.
yes OVH might have better reputation than a new mail server, but not really guaranteed… (if it’s listed in many blocklists…).

and yes DNS is the 1st step after you decide which MX to choose.

1 Like

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