VirtualMailManager/EmailAddress.py
changeset 87 f9090d1a0730
parent 76 14c0a092d7d2
child 102 485d3f7d6981
equal deleted inserted replaced
86:e43e4e7e9ec0 87:f9090d1a0730
    73             raise VMMEAE(_(u'No localpart specified.'),
    73             raise VMMEAE(_(u'No localpart specified.'),
    74                 ERR.LOCALPART_INVALID)
    74                 ERR.LOCALPART_INVALID)
    75         if len(localpart) > 64:
    75         if len(localpart) > 64:
    76             raise VMMEAE(_(u'The local part »%s« is too long') %
    76             raise VMMEAE(_(u'The local part »%s« is too long') %
    77                 localpart, ERR.LOCALPART_TOO_LONG)
    77                 localpart, ERR.LOCALPART_TOO_LONG)
    78         ic = re.compile(RE_LOCALPART).findall(localpart)
    78         ic = set(re.findall(RE_LOCALPART, localpart))
    79         if len(ic):
    79         if len(ic):
    80             ichrs = ''
    80             ichrs = ''
    81             for c in set(ic):
    81             for c in ic:
    82                 ichrs += u"»%s« " % c
    82                 ichrs += u"»%s« " % c
    83             raise VMMEAE(_(u"The local part »%(lpart)s« contains invalid\
    83             raise VMMEAE(_(u"The local part »%(lpart)s« contains invalid\
    84  characters: %(ichrs)s") % {'lpart': localpart, 'ichrs': ichrs},
    84  characters: %(ichrs)s") % {'lpart': localpart, 'ichrs': ichrs},
    85                 ERR.LOCALPART_INVALID)
    85                 ERR.LOCALPART_INVALID)
    86         return localpart
    86         return localpart