Email with Upper Case causes Bug message
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Systers-mailman |
Fix Committed
|
Undecided
|
kanika vats |
Bug Description
Seems like members with upper case characters in their subscribed email address causes a "bug" message when trying to access their options page. The "bug" message also appears when trying to access the member's option page via the Admin page. Below is the traceback:
admin(10092): Traceback (most recent call last):
admin(10092): File "/usr/local/
admin(10092): main()
admin(10092): File "/usr/local/
admin(10092): options_page(mlist, doc, user, cpuser, userlang)
admin(10092): File "/usr/local/
admin(10092): subscriber_id = subscriber.
admin(10092): File "/usr/local/
admin(10092): raise ErrorsDlist.
admin(10092): InternalError
Changed in systers: | |
assignee: | nobody → Robin J (robin-jeffries) |
Changed in systers: | |
assignee: | Robin J (robin-jeffries) → kanika vats (kanika-krikan) |
Changed in systers: | |
status: | New → Fix Committed |
Response from Kanika on 5/19/10:
I tried to subscribe a user with One letter of his email address in capital (locally on my system) and I am getting same error.That is when I try to log in to the membership configuration page I get Mailman has hit a bug.I compared the lines of code with Old DlistUtils.py (before STORM implementation) and they were as follows:
def getSubscriber_ id_raw( mlist, addr): id_raw called with addr=None')
["SELECT subscriber_id \
FROM subscriber \
WHERE mailman_key = '%s'" % addr.lower()])
if addr == None:
# syslog('info', 'getSubscriber_
return None
return executeSQL(mlist,
As you see 'addr.lower()' is being used since long time before.I wonder why no such bug hit since then.The storm implementation is the exact replica of the above lines.
I printed out the value of 'addr' on the info log and found that addr contains the email address all in lower case letters.If you look at the error log then it mentions about line 865 in Mailman/ Cgi/option. py before mentioning about DlistUtils.py which is:
subscriber_id = subscriber. getSubscriber_ id_raw_ or_die( user)
The user here is again email address all in small letters.
So I made a minor change:
I changed the line:
result = self.store. find(Subscriber ,Subscriber. mailman_ key == unicode( addr.lower( ),"utf- 8"))
to
result = self.store. find(Subscriber ,Subscriber. mailman_ key.lower( ) == unicode( addr,"utf- 8"))
and then the bug was resolved for the moment.
But when I tried to change the membership option and hit 'submit my changes' button then again Mailman hit a bug.After reading the bug report I found that the line in DlistUtils.py that was giving the error was the one in red below:
"
"""Disable/ enable delivery based on mm_cfg. DisableDelivery """ find(Subscriber ,Subscriber. mailman_ key == unicode( member, 'utf-8' ))\noldval = [(subscriber. suppress) for subscriber in result]\n"
syslog( 'info', 'DlistUtils( setDisable) :Executing query:\n%s\n Member whoes suppress value is to be found \n %s', command,member) find(Subscriber ,Subscriber. mailman_ key == unicode( member, "utf-8" )) suppress) for subscriber in result]
syslog( 'info', 'oldval is an empty list.\nThis can happen either because of\n 1)Permission issues (Do a: bin/check_perms)\n 2)Inconsistency between database and pickle files (A user is in the database but not in pickle files or vice versa,Do a bin/find_ problems. py)')"
def setDisable(self, member, flag):
command = "result = self.store.
if DEBUG_MODE:
result = self.store.
oldval = [(subscriber.
if oldval == []:
if DEBUG_MODE:
Again on priniting the value of 'member' in the info log I found that member also gives the email address of a subscriber all in lowercase.
So shall we make changes in the code such that whenever the email address of a subscriber is added(or changed) in the database it is added in lowercase(As everwhere email is being used in lowercase) or shall I just give a call to lower() function wherever Susbcriber. mailman_ key is called to be on a safer side?
...