Skip to content
Snippets Groups Projects

Change in list name validation error.

Closed Sayak Sen requested to merge tech0/postorius:issue#139 into master
1 unresolved thread

I think this should work. But suggestions are always welcome.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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.

  • just checked what gmail does (I know that doesn't necessarily mean it's good practice)

    "Please use only letters (a-z), numbers, and periods."

    and it cuts of entry after a number of characters

  • 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 and mailman.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.

  • Please register or sign in to reply
  • Sayak Sen added 1 commit

    added 1 commit

    • 78189148 - Update validation error message

    Compare with previous version

  • Sayak Sen added 1 commit

    added 1 commit

    Compare with previous version

  • Sayak Sen added 1 commit

    added 1 commit

    • b02d2da6 - Validation of List Name error

    Compare with previous version

  • Sayak Sen added 29 commits

    added 29 commits

    Compare with previous version

  • Sayak Sen added 1 commit

    added 1 commit

    • 95bb90fc - Validation of list name error.

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading