[Mailman-Developers] How to validate mailing list-id?

Andrew Stuart andrew.stuart at supercoders.com.au
Sat Apr 4 05:30:45 CEST 2015


I’ve read RFC2919 https://www.ietf.org/rfc/rfc2919.txt which says:
"The list header fields are subject to the encoding and character restrictions for mail headers as described in [RFC822]."

RFC822 http://www.w3.org/Protocols/rfc822/ says:
"The field-body may be composed of any ASCII characters, except CR or LF. (While CR and/or LF may be present in the actual text, they are removed by the action of unfolding the field.)"

Am I correct in understanding then that a mailing list-id may be composed of any ASCII characters?

Thus this is a valid mailing list-id: ///*/etc/pw.txt

Is this function an accurate validator for a mailing list-id?

def is_valid_list_id(list_id):
    try:
        list_id.decode('ASCII')
    except UnicodeDecodeError:
        return False
    else:
        return True







More information about the Mailman-Developers mailing list