comparison test/test_mailgw.py @ 4531:ddff9669361b

Fix matching of incoming email addresses to the alternate_addresses field... ...of a user -- this would match substrings, e.g. if the user has discuss-support@example.com as an alternate email and an incoming mail is addressed to support@example.com this would (wrongly) match. Note: I *think* I've seen this discussed somewhere but couldn't find it, neither in the tracker nor in recent discussions on the mailinglists. So if someone remembers an issue which now should be closed, please tell me :-)
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Wed, 24 Aug 2011 14:43:52 +0000
parents a00e0e73bb26
children bf67fed13ef9
comparison
equal deleted inserted replaced
4530:c1c395058dee 4531:ddff9669361b
2203 i = self.db.user.create(username='user1', address='user1@foo.com', 2203 i = self.db.user.create(username='user1', address='user1@foo.com',
2204 alternate_addresses='user1@bar.com') 2204 alternate_addresses='user1@bar.com')
2205 self.assertEqual(uidFromAddress(self.db, ('', 'user1@bar.com'), 0), i) 2205 self.assertEqual(uidFromAddress(self.db, ('', 'user1@bar.com'), 0), i)
2206 self.assertEqual(uidFromAddress(self.db, ('', 'USER1@bar.com'), 0), i) 2206 self.assertEqual(uidFromAddress(self.db, ('', 'USER1@bar.com'), 0), i)
2207 2207
2208 def testUserAlternateSubstringNomatch(self):
2209 i = self.db.user.create(username='user1', address='user1@foo.com',
2210 alternate_addresses='x-user1@bar.com')
2211 self.assertEqual(uidFromAddress(self.db, ('', 'user1@bar.com'), 0), 0)
2212 self.assertEqual(uidFromAddress(self.db, ('', 'USER1@bar.com'), 0), 0)
2213
2208 def testUserCreate(self): 2214 def testUserCreate(self):
2209 i = uidFromAddress(self.db, ('', 'user@foo.com'), 1) 2215 i = uidFromAddress(self.db, ('', 'user@foo.com'), 1)
2210 self.assertNotEqual(uidFromAddress(self.db, ('', 'user@bar.com'), 1), i) 2216 self.assertNotEqual(uidFromAddress(self.db, ('', 'user@bar.com'), 1), i)
2211 2217
2212 def testRFC2822(self): 2218 def testRFC2822(self):

Roundup Issue Tracker: http://roundup-tracker.org/