Change in list name validation error.
I think this should work. But suggestions are always welcome.
Merge request reports
Activity
Please don't close merge requests and then open new ones. You can simply push the branch again to update your merge request. If you want to rewrite the history editing or removing previous commits you should be able to force push the branch.
It makes it much harder to follow if someone wants to track your changes...178 178 try: 179 179 validate_email(self.cleaned_data['listname'] + '@example.net') 180 180 except: 181 raise forms.ValidationError(_("Please enter a valid listname")) 181 raise forms.ValidationError(_("Please enter a valid listname. Listname " 182 "will be the list posting email address so make sure " 183 "that the listname has no other character than, " 184 "Uppercase and lowercase English letters (a-z, A-Z), " 185 "Digits 0 to 9, Characters ! # $ % & ' * + - / = ? ^ _ . ` { | } ~")) AFAIK special characters are also allowed but not recommended. @warsaw what does Mailman accept/ what should we accept?
I'm pretty sure there also is some limit regarding the length of addresses. I'm not sure if it's possible to find out what exactly is wrong with the address and tell the user that.The ultimate restriction is the listname must be a valid, unquoted local-part of an email address. RFCs notwithstanding, this means it must pass
mailman.email.validate.Validate.is_valid()
which is essentially as above without|
or^
._valid_local = re.compile("[-0-9a-z!#$%&'*+./=?@_`{}~]", re.IGNORECASE) # Strictly speaking, both ^ and | are allowed and others are allowed in quoted # local parts, but this can open the door to certain web exploits so we don't # allow them.
Thanks for the patch, @tech0! Since this is running through the Django email validator, the description should reflect both what the
EmailValidator
class andmailman.email.validate.Validate.is_valid()
do.Here's the link to Django's EmailValidator class: https://docs.djangoproject.com/en/1.10/_modules/django/core/validators/#EmailValidator
There are actually 4 MRs addressing #139 of which !204 (closed) is the most up to date. The work on #139 and the various MRs have revealed the fact that validating that the list posting address, i.e. listname@list.domain, is a valid email address is not restrictive enough. It allows
/
and other characters like?
and#
that break Postorius URLs that include the list ID. As a result, there is now core issue mailman#311 (closed) and MR mailman!248 (merged), and any validation that Postorius does should take that into account. !204 (closed) has more on this.
added 29 commits
-
b02d2da6...6ffddf55 - 28 commits from branch
mailman:master
- 194df654 - Update validation error message
-
b02d2da6...6ffddf55 - 28 commits from branch