From a727e68c1f777ead7201fae6d5cd14ef18b2d064 Mon Sep 17 00:00:00 2001 From: jow Date: Fri, 23 Mar 2012 11:19:58 +0000 Subject: dnsmasq: add mx record support 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 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31057 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/dnsmasq/files/dnsmasq.init | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'package/dnsmasq/files/dnsmasq.init') diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init index 13f178384a..edd22ad3eb 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -370,6 +370,21 @@ dhcp_srv_add() { append args "-W $service" } +dhcp_mx_add() { + local cfg="$1" + + [ -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 @@ -404,6 +419,7 @@ start() { 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 -- cgit v1.2.3