Wrong email ids passing validation during mass subscription

Bug #1441314 reported by Pavan Koli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Postorius
Fix Committed
Undecided
Pavan Koli

Bug Description

While using the mass subscription option to subscribe many email ids, email ids such as @gmail.com are passing through. The line responsible for validation of email ids(http://bazaar.launchpad.net/~mailman-coders/postorius/trunk/view/head:/src/postorius/views/list.py#L253) doesn't check if the len(parts[0])>0, hence email ids like @gmail.com are getting through.

One way to fix this would be to make the following change
if len(parts) != 2 or '.' not in parts[1] or len(parts[0])==0:

I've attached a patch, it takes help of django for email validation(I think this would be better than the earlier suggested way to validate email ids).

Tags: postorius

Related branches

Revision history for this message
Pavan Koli (pskoli93) wrote :
Changed in postorius:
assignee: nobody → Pavan Koli (pskoli93)
Revision history for this message
Bhavesh Goyal (bhavesh-goyal093) wrote :

While the patch would successfully reject addresses like @gmail.com but other invalid addresses such as '..@gmail.com' , '...<email address hidden>' would still get accepted. To Ensure a perfectly valid address get accepted everytime, some regex matching needs to be done based on the format standards (like RFC - 5322) or better using Django validators which can save the cost of making a regular expression for an absolutely valid email

Revision history for this message
Bhavesh Goyal (bhavesh-goyal093) wrote :
Pavan Koli (pskoli93)
Changed in postorius:
status: New → In Progress
Pavan Koli (pskoli93)
Changed in postorius:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.