Home > Missing Answers > Add GMail MX to Plesk from command line

Add GMail MX to Plesk from command line

This is something every admin must need, but I have not found such script. So here you are.

#!/bin/bash

DOMAIN=$1

echo "\
10 aspmx.l.google.com
20 alt1.aspmx.l.google.com
20 alt2.aspmx.l.google.com
30 aspmx2.googlemail.com
30 aspmx3.googlemail.com
30 aspmx4.googlemail.com
30 aspmx5.googlemail.com\
" | awk '{print "/usr/local/psa/bin/dns -a '$1' -mx \"\" -mailexchanger " $1 " -priority " $2 }' | sh

Categories: Missing Answers Tags: