diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-22 07:33:40 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-22 07:33:40 -0400 |
commit | e201c7e1a551247ac76e9d281a91b723b7912b69 (patch) | |
tree | 90f78189020fbdc2063f053532c750169ccdb316 | |
parent | 2900cbc2d7bdf3175b345456f9da0c5d298edcb0 (diff) | |
download | askbot-e201c7e1a551247ac76e9d281a91b723b7912b69.tar.gz askbot-e201c7e1a551247ac76e9d281a91b723b7912b69.tar.bz2 askbot-e201c7e1a551247ac76e9d281a91b723b7912b69.zip |
fixed two bugs in the signature detection code
-rw-r--r-- | askbot/lamson_handlers.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/askbot/lamson_handlers.py b/askbot/lamson_handlers.py index f6b6b752..13797752 100644 --- a/askbot/lamson_handlers.py +++ b/askbot/lamson_handlers.py @@ -203,7 +203,7 @@ def ASK(message, host = None, addr = None): except Tag.MultipleObjectsReturned: return -@route('welcome-(address)@host', address='.+') +@route('welcome-(address)@(host)', address='.+') @stateless @process_reply def VALIDATE_EMAIL( @@ -222,10 +222,16 @@ def VALIDATE_EMAIL( #extract the signature tail = list() for line in reversed(content.splitlines()): + #scan backwards from the end until the magic line if reply_code in line: break - tail.append(line) - signature = '\n'.join(reversed(tail)) + tail.insert(0, line) + + #strip off the leading quoted lines, there could be one or two + while tail[0].startswith('>'): + line.pop(0) + + signature = '\n'.join(tail) #save the signature and mark email as valid user = reply_address_object.user |