script?

weconnect

Active Member
May 20, 2020
28
2
43
37
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