Edit Domain of Postfix

SYSTEM INFORMATION
OS type and version Debian 11
Webmin version 2.105

Hello,
I had the mail server that worked normally, but yesterday I decided to change the domain for the site, so I changed the domain in the main.cf, also for the SSL certificates, then I restarted Postfix and its configuration that appears to be active and works with a telnet localhost 587, but if I try to connect from Outlook, Thunderbird or PHPmailer it no longer works.

What made you think you should do that?

The fact that I no longer own the first domain…?

Dovecot handles that, so changing thing in postfix has screwed your imap/pop logins.
Hopefully you have created a backup of your main.cf or can remember what you changed.

I have no problem restoring the old main.cf, but could you tell me how to fix the problem? Because the old domain no longer points to my IP, so Dovecot can’t handle it as the signal doesn’t reach my server.

Not sure in webmin, virtualmin it would do it easy. I haven’t used webmin do that for at least 10 years.
Doesn’t Mail Alais and Virtual Domains handle most of the domain stuff

I don’t understand your answer…

When state domain do you mean hostname ? Most virtual servers should have an a record in dns so it resolves to your IP and of course the mx record should point to the correct ip. Check the dns records for your new domain and make sure they point to your ip, if not correct them in the webmin bind module, if your webmin instance is responsible for serving your dns if not use the interface that is responsible for managing your dns

The DNS records are managed externally and the mail.domain.tld domain points to my IP address

No, I mean, why is any domain in main.cf?

I can’t understand you, I changed the domain of the main.cf from mail.xxx.tld to mail.zzz.tld, then I changed the paths of the SSL certificates.
Now I should be able to connect via mail.zzz.tld, but for some reason it doesn’t work.

Post the output of

postconf -n

so we can see all modifications made to postfix

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_percent_hack = no
anvil_rate_time_unit = 60m
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 2
default_transport = error
home_mailbox = Maildir/
inet_interfaces = loopback-only
inet_protocols = all
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
milter_default_action = accept
mydestination = $myhostname, vmi1010884.contaboserver.net, mail.coveriphone.eu,                                                                                                                                                              localhost.coveriphone.eu, localhost
myhostname = mail.coveriphone.eu
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = subnet
myorigin = /etc/mailname
non_smtpd_milters = inet:localhost:8891,local:/var/spool/postfix/var/run/milter-                                                                                                                                                             greylist/milter-greylist.sock
readme_directory = no
recipient_delimiter = +
relay_transport = error
sender_bcc_maps = hash:/etc/postfix/bcc
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
smtp_dns_support_level = dnssec
smtp_host_lookup = dns
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = dane
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_client_message_rate_limit = 2
smtpd_milters = inet:localhost:8891,local:/var/spool/postfix/var/run/milter-grey                                                                                                                                                             list/milter-greylist.sock
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated rejec                                                                                                                                                             t_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_una                                                                                                                                                             uth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/letsencrypt/live/coveriphone.eu/fullchain.pem
smtpd_tls_cert_file = /etc/letsencrypt/live/coveriphone.eu/cert.pem
smtpd_tls_key_file = /etc/letsencrypt/live/coveriphone.eu/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_security_level = may
tls_server_sni_maps = hash:/etc/postfix/sni_map
virtual_alias_maps = hash:/etc/postfix/virtual

I’m talking about this:

I just realized we’re also doing this in the Virtualmin installer, too, and it’s not necessary.

$myhostname is automatically the system hostname, and it’s automatically the right thing for mydestination if everything else is in virtual.

But, that has nothing to do with Outlook or whatever, it’s just about deliverability, I just got distracted, and now I need to fix the installer to stop doing this (it’s been doing it for 15 years, so it’s obviously harmless, but it’s going to bug me).

Anyway, connections to 587 are configured in master.cf, so maybe show us that, if you’ve modified it.

But, we need to see the actual error (“it no longer works” is not useful for troubleshooting). And, we need to see what appears in the mail log or the journal for the postfix unit when you try to send a message with a mail client.

master.cf has not been modified, while this is the error message:

Dec 21 10:21:21 panel postfix/pickup[872802]: 921072595F3: uid=0 from=<webmin@panel.donagest.com>
Dec 21 10:21:21 panel postfix/cleanup[876528]: warning: connect to Milter service local:/var/spool/postfix/var/run/milter-greylist/milter-greylist.sock: No such file or directory
Dec 21 10:21:21 panel postfix/cleanup[876528]: 921072595F3: message-id=<1734772881.876248.2@panel.donagest.com>
Dec 21 10:21:21 panel opendkim[192508]: 921072595F3: DKIM-Signature field added (s=202208, d=panel.donagest.com)
Dec 21 10:21:21 panel postfix/qmgr[692278]: 921072595F3: from=<webmin@panel.donagest.com>, size=2642, nrcpt=1 (queue active)
Dec 21 10:21:21 panel postfix/error[876538]: 921072595F3: to=<luigidona636@gmail.com>, relay=none, delay=0.11, delays=0.1/0/0/0.01, dsn=5.0.0, status=bounced (gmail.com)
Dec 21 10:21:21 panel postfix/cleanup[876528]: A40F62595BC: message-id=<20241221092121.A40F62595BC@mail.coveriphone.eu>
Dec 21 10:21:21 panel postfix/bounce[876539]: 921072595F3: sender non-delivery notification: A40F62595BC
Dec 21 10:21:21 panel postfix/qmgr[692278]: 921072595F3: removed
Dec 21 10:21:21 panel postfix/qmgr[692278]: A40F62595BC: from=<>, size=5111, nrcpt=1 (queue active)
Dec 21 10:21:21 panel postfix/error[876538]: A40F62595BC: to=<webmin@panel.donagest.com>, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=5.0.0, status=bounced (panel.donagest.com)
Dec 21 10:21:21 panel postfix/qmgr[692278]: A40F62595BC: removed

Agreed! Fixed now!

Postfix is set up to use a mail filter service, but the socket file for the milter is missing. If the milter is mandatory, this causes Postfix to fail to process messages.

I had guessed this, but how do I solve it?

Disable “Email Settings ⇾ Mail Rate Limiting” feature.

The path looks like a chrooted Postfix. Is Postfix actually running in a chroot on this system, and does everything else know what? I mean is the milter configured to put its socket file inside the chroot?