script?

weconnect

Member
May 20, 2020
21
1
8
35
Hello

we moved from an old mail relay system to Proxmox Mail Gateway Cluster setup and imported all of our smtp settings.

is there a script to see if domain is pointing to its cluster and if not remove the domain from transport and domains file on the master node?
 
Not quite sure I understand the question - but if you want to go over all relay domains you have configured in your PMG and check if their MX record points to you PMG - there is no ready made script for this.

but it's not too hard to create one - the relay domains are stored in /etc/pmg/domains

something like:
Code:
for i in $(cat /etc/pmg/domains | awk '/^[^#]/{print $1}'); do echo -n $i: ;  dig +short mx $i; echo ''; done
should help you to get started
(you might need to install dnsutils to get dig with `apt install dnsutils`)

I hope this helps!
 
  • Like
Reactions: Maxim Macovei

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!