summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-02-14 13:00:35 +1100
committerAmitay Isaacs <amitay@gmail.com>2012-02-21 18:24:30 +1100
commit1fc2fb5de1862de36235c896d1c7c4000e3c0349 (patch)
treeee66607d060fd225a166629c019ec034c4e709eb /source4/scripting/python
parent169db333033b72b6f9ac1e7b23f0f2c151218c1f (diff)
downloadsamba-1fc2fb5de1862de36235c896d1c7c4000e3c0349.tar.gz
samba-1fc2fb5de1862de36235c896d1c7c4000e3c0349.tar.bz2
samba-1fc2fb5de1862de36235c896d1c7c4000e3c0349.zip
samba-tool: dns: Add MXRecord type to add/update mx records
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/netcmd/dns.py14
1 files changed, 14 insertions, 0 deletions
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,