From 1fc2fb5de1862de36235c896d1c7c4000e3c0349 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Tue, 14 Feb 2012 13:00:35 +1100 Subject: samba-tool: dns: Add MXRecord type to add/update mx records --- source4/scripting/python/samba/netcmd/dns.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/netcmd/dns.py b/source4/scripting/python/samba/netcmd/dns.py index 6d07db4d85..9607cd92fd 100644 --- a/source4/scripting/python/samba/netcmd/dns.py +++ b/source4/scripting/python/samba/netcmd/dns.py @@ -421,6 +421,20 @@ class NSRecord(dnsserver.DNS_RPC_RECORD): ns.len = len(dns_server) self.data = ns +class MXRecord(dnsserver.DNS_RPC_RECORD): + def __init__(self, mail_server, preference, serial=1, ttl=900, + rank=dnsp.DNS_RANK_ZONE, node_flag=0): + super(MXRecord, self).__init__() + self.wType = dnsp.DNS_TYPE_MX + self.dwFlags = rank | node_flag + self.dwSerial = serial + self.dwTtlSeconds = ttl + mx = dnsserver.DNS_RPC_RECORD_NAME_PREFERENCE() + mx.wPreference = preference + mx.nameExchange.str = mail_server + mx.nameExchange.len = len(mail_server) + self.data = mx + class SOARecord(dnsserver.DNS_RPC_RECORD): def __init__(self, mname, rname, serial=1, refresh=900, retry=600, expire=86400, minimum=3600, ttl=3600, rank=dnsp.DNS_RANK_ZONE, -- cgit