Adding the following syntax support:
config mxhost
option domain mydomain.com
option relay svr10.ironport.com
option pref 50
and this will generate an MX record for mydomain.com pointing at the relay with
a given preference.
Redux: default the preference to 0 if absent.
Signed-off-by: Philip Prindeville <[email protected]>
Index: package/dnsmasq/files/dnsmasq.init
===================================================================
--- package/dnsmasq/files/dnsmasq.init (revision 30690)
+++ package/dnsmasq/files/dnsmasq.init (working copy)
@@ -367,6 +367,22 @@
append args "-W $service"
}
+dhcp_mx_add() {
+ local cfg="$1"
+
+ config_get domain "$cfg" domain
+ [ -n "$domain" ] || return 0
+
+ config_get relay "$cfg" relay
+ [ -n "$relay" ] || return 0
+
+ config_get pref "$cfg" pref 0
+
+ local service="$domain,$relay,$pref"
+
+ append args "--mx-host=$service"
+}
+
dhcp_cname_add() {
local cfg="$1"
local cname target
@@ -401,6 +417,7 @@
config_foreach dhcp_subscrid_add subscrid
config_foreach dhcp_domain_add domain
config_foreach dhcp_srv_add srvhost
+ config_foreach dhcp_mx_add mxhost
config_foreach dhcp_add dhcp
config_foreach dhcp_cname_add cname
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel