X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-mailgate;fp=ud-mailgate;h=baaf08ae8dc7906fd28aef0495f5e97a34613a40;hp=0d6d330212a14d9fc29ae4c6fc82eaa8e51294da;hb=8c7672a550946d7e2554381a195048ab8c8e20bc;hpb=8a552664fb81b23f7e6ad23864f1b031a2592b47 diff --git a/ud-mailgate b/ud-mailgate index 0d6d330..baaf08a 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -371,6 +371,10 @@ def DoDNS(Str, Attrs, DnRecord): aaaarecord is None: return None + # Check for punycode. We ought to validate it before we allow it in our zone. + if Str.lower().startswith('xn--') and Str.lower() != 'xn--mnchen-3ya': + return "Punycode not allowed: " + Str + # Check if the name is already taken G = re.match(r'^([-\w+]+)\s', Str) if G is None: