X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=test%2Ftest_mailgw.py;h=47b8eeb77607bb1f67ed1db103c203c9e0b3f651;hb=23fb31a22720e6e713eeb298b4eb72d4dfd8571e;hp=ca3419f90510d7bc361dc0fd6d2a000b0a181e21;hpb=3ccef2e446cbfa12748319b2bb09f27dc48296f4;p=roundup.git diff --git a/test/test_mailgw.py b/test/test_mailgw.py index ca3419f..47b8eeb 100644 --- a/test/test_mailgw.py +++ b/test/test_mailgw.py @@ -21,6 +21,7 @@ if not os.environ.has_key('SENDMAILDEBUG'): os.environ['SENDMAILDEBUG'] = 'mail-test.log' SENDMAILDEBUG = os.environ['SENDMAILDEBUG'] +from roundup import mailgw, i18n, roundupdb from roundup.mailgw import MailGW, Unauthorized, uidFromAddress, \ parseContent, IgnoreLoop, IgnoreBulk, MailUsageError, MailUsageHelp from roundup import init, instance, password, rfc2822, __version__ @@ -119,6 +120,8 @@ class MailgwTestCase(unittest.TestCase, DiffHelper): count = 0 schema = 'classic' def setUp(self): + self.old_translate_ = mailgw._ + roundupdb._ = mailgw._ = i18n.get_translation(language='C').gettext MailgwTestCase.count = MailgwTestCase.count + 1 # and open the database / "instance" @@ -137,14 +140,25 @@ class MailgwTestCase(unittest.TestCase, DiffHelper): self.john_id = self.db.user.create(username='john', address='john@test.test', roles='User', realname='John Doe', alternate_addresses='jondoe@test.test\njohn.doe@test.test') + self.rgg_id = self.db.user.create(username='rgg', + address='rgg@test.test', roles='User') def tearDown(self): + roundupdb._ = mailgw._ = self.old_translate_ if os.path.exists(SENDMAILDEBUG): os.remove(SENDMAILDEBUG) self.db.close() + def _create_mailgw(self, message): + class MailGW(self.instance.MailGW): + def handle_message(self, message): + return self._handle_message(message) + handler = MailGW(self.instance) + handler.db = self.db + return handler + def _handle_mail(self, message): - handler = self.instance.MailGW(self.instance) + handler = self._create_mailgw(message) handler.trapExceptions = 0 return handler.main(StringIO(message)) @@ -444,6 +458,29 @@ SnVzdCBhIHRlc3QK --bCsyhTFzCvuiizWF-- --bxyzzy-- +''' + + multipart_msg_latin1 = '''From: mary +To: issue_tracker@your.tracker.email.domain.example +Message-Id: +In-Reply-To: +Subject: [issue1] Testing... +Content-Type: multipart/alternative; boundary=001485f339f8f361fb049188dbba + + +--001485f339f8f361fb049188dbba +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable + +umlaut =E4=F6=FC=C4=D6=DC=DF + +--001485f339f8f361fb049188dbba +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable + +umlaut =E4=F6=FC=C4=D6=DC=DF + +--001485f339f8f361fb049188dbba-- ''' def testMultipartKeepAlternatives(self): @@ -481,6 +518,234 @@ SnVzdCBhIHRlc3QK self.assertEqual(f.content, content [n]) self.assertEqual(msg.content, 'test attachment second text/plain') + def testMultipartCharsetUTF8NoAttach(self): + c = 'umlaut \xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c\xc3\x9f' + self.doNewIssue() + self.db.config.NOSY_MAX_ATTACHMENT_SIZE = 0 + self._handle_mail(self.multipart_msg_latin1) + messages = self.db.issue.get('1', 'messages') + messages.sort() + msg = self.db.msg.getnode (messages[-1]) + assert(len(msg.files) == 1) + name = 'unnamed' + content = '' + c + '\n' + for n, id in enumerate (msg.files): + f = self.db.file.getnode (id) + self.assertEqual(f.name, name) + self.assertEqual(f.content, content) + self.assertEqual(msg.content, c) + self.compareMessages(self._get_mail(), +'''FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, richard@test.test +Content-Type: text/plain; charset="utf-8" +Subject: [issue1] Testing... +To: chef@bork.bork.bork, richard@test.test +From: "Contrary, Mary" +Reply-To: Roundup issue tracker + +MIME-Version: 1.0 +Message-Id: +In-Reply-To: +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: chatting +X-Roundup-Issue-Files: unnamed +Content-Transfer-Encoding: quoted-printable + + +Contrary, Mary added the comment: + +umlaut =C3=A4=C3=B6=C3=BC=C3=84=C3=96=C3=9C=C3=9F +File 'unnamed' not attached - you can download it from http://tracker.examp= +le/cgi-bin/roundup.cgi/bugs/file1. + +---------- +status: unread -> chatting + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ +''') + + def testMultipartCharsetLatin1NoAttach(self): + c = 'umlaut \xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c\xc3\x9f' + self.doNewIssue() + self.db.config.NOSY_MAX_ATTACHMENT_SIZE = 0 + self.db.config.MAIL_CHARSET = 'iso-8859-1' + self._handle_mail(self.multipart_msg_latin1) + messages = self.db.issue.get('1', 'messages') + messages.sort() + msg = self.db.msg.getnode (messages[-1]) + assert(len(msg.files) == 1) + name = 'unnamed' + content = '' + c + '\n' + for n, id in enumerate (msg.files): + f = self.db.file.getnode (id) + self.assertEqual(f.name, name) + self.assertEqual(f.content, content) + self.assertEqual(msg.content, c) + self.compareMessages(self._get_mail(), +'''FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, richard@test.test +Content-Type: text/plain; charset="iso-8859-1" +Subject: [issue1] Testing... +To: chef@bork.bork.bork, richard@test.test +From: "Contrary, Mary" +Reply-To: Roundup issue tracker + +MIME-Version: 1.0 +Message-Id: +In-Reply-To: +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: chatting +X-Roundup-Issue-Files: unnamed +Content-Transfer-Encoding: quoted-printable + + +Contrary, Mary added the comment: + +umlaut =E4=F6=FC=C4=D6=DC=DF +File 'unnamed' not attached - you can download it from http://tracker.examp= +le/cgi-bin/roundup.cgi/bugs/file1. + +---------- +status: unread -> chatting + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ +''') + + def testMultipartCharsetUTF8AttachFile(self): + c = 'umlaut \xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c\xc3\x9f' + self.doNewIssue() + self._handle_mail(self.multipart_msg_latin1) + messages = self.db.issue.get('1', 'messages') + messages.sort() + msg = self.db.msg.getnode (messages[-1]) + assert(len(msg.files) == 1) + name = 'unnamed' + content = '' + c + '\n' + for n, id in enumerate (msg.files): + f = self.db.file.getnode (id) + self.assertEqual(f.name, name) + self.assertEqual(f.content, content) + self.assertEqual(msg.content, c) + self.compareMessages(self._get_mail(), +'''FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, richard@test.test +Content-Type: multipart/mixed; boundary="utf-8" +Subject: [issue1] Testing... +To: chef@bork.bork.bork, richard@test.test +From: "Contrary, Mary" +Reply-To: Roundup issue tracker + +MIME-Version: 1.0 +Message-Id: +In-Reply-To: +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: chatting +X-Roundup-Issue-Files: unnamed +Content-Transfer-Encoding: quoted-printable + + +--utf-8 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: quoted-printable + + +Contrary, Mary added the comment: + +umlaut =C3=A4=C3=B6=C3=BC=C3=84=C3=96=C3=9C=C3=9F + +---------- +status: unread -> chatting + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ +--utf-8 +Content-Type: text/html +MIME-Version: 1.0 +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="unnamed" + +PGh0bWw+dW1sYXV0IMOkw7bDvMOEw5bDnMOfPC9odG1sPgo= + +--utf-8-- +''') + + def testMultipartCharsetLatin1AttachFile(self): + c = 'umlaut \xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c\xc3\x9f' + self.doNewIssue() + self.db.config.MAIL_CHARSET = 'iso-8859-1' + self._handle_mail(self.multipart_msg_latin1) + messages = self.db.issue.get('1', 'messages') + messages.sort() + msg = self.db.msg.getnode (messages[-1]) + assert(len(msg.files) == 1) + name = 'unnamed' + content = '' + c + '\n' + for n, id in enumerate (msg.files): + f = self.db.file.getnode (id) + self.assertEqual(f.name, name) + self.assertEqual(f.content, content) + self.assertEqual(msg.content, c) + self.compareMessages(self._get_mail(), +'''FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, richard@test.test +Content-Type: multipart/mixed; boundary="utf-8" +Subject: [issue1] Testing... +To: chef@bork.bork.bork, richard@test.test +From: "Contrary, Mary" +Reply-To: Roundup issue tracker + +MIME-Version: 1.0 +Message-Id: +In-Reply-To: +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: chatting +X-Roundup-Issue-Files: unnamed +Content-Transfer-Encoding: quoted-printable + + +--utf-8 +MIME-Version: 1.0 +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + +Contrary, Mary added the comment: + +umlaut =E4=F6=FC=C4=D6=DC=DF + +---------- +status: unread -> chatting + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ +--utf-8 +Content-Type: text/html +MIME-Version: 1.0 +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="unnamed" + +PGh0bWw+dW1sYXV0IMOkw7bDvMOEw5bDnMOfPC9odG1sPgo= + +--utf-8-- +''') + def testSimpleFollowup(self): self.doNewIssue() self._handle_mail('''Content-Type: text/plain; @@ -573,6 +838,154 @@ _______________________________________________________________________ Roundup issue tracker _______________________________________________________________________ +''') + + def testFollowupNoSubjectChange(self): + self.db.config.MAILGW_SUBJECT_UPDATES_TITLE = 'no' + self.doNewIssue() + + self._handle_mail('''Content-Type: text/plain; + charset="iso-8859-1" +From: richard +To: issue_tracker@your.tracker.email.domain.example +Message-Id: +In-Reply-To: +Subject: [issue1] Wrzlbrmft... [assignedto=mary; nosy=+john] + +This is a followup +''') + l = self.db.issue.get('1', 'nosy') + l.sort() + self.assertEqual(l, [self.chef_id, self.richard_id, self.mary_id, + self.john_id]) + + self.compareMessages(self._get_mail(), +'''FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, john@test.test, mary@test.test +Content-Type: text/plain; charset="utf-8" +Subject: [issue1] Testing... +To: chef@bork.bork.bork, john@test.test, mary@test.test +From: richard +Reply-To: Roundup issue tracker + +MIME-Version: 1.0 +Message-Id: +In-Reply-To: +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: chatting +Content-Transfer-Encoding: quoted-printable + + +richard added the comment: + +This is a followup + +---------- +assignedto: -> mary +nosy: +john, mary +status: unread -> chatting + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ +''') + self.assertEqual(self.db.issue.get('1','title'), 'Testing...') + + def testFollowupExplicitSubjectChange(self): + self.doNewIssue() + + self._handle_mail('''Content-Type: text/plain; + charset="iso-8859-1" +From: richard +To: issue_tracker@your.tracker.email.domain.example +Message-Id: +In-Reply-To: +Subject: [issue1] Wrzlbrmft... [assignedto=mary; nosy=+john; title=new title] + +This is a followup +''') + l = self.db.issue.get('1', 'nosy') + l.sort() + self.assertEqual(l, [self.chef_id, self.richard_id, self.mary_id, + self.john_id]) + + self.compareMessages(self._get_mail(), +'''FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, john@test.test, mary@test.test +Content-Type: text/plain; charset="utf-8" +Subject: [issue1] new title +To: chef@bork.bork.bork, john@test.test, mary@test.test +From: richard +Reply-To: Roundup issue tracker + +MIME-Version: 1.0 +Message-Id: +In-Reply-To: +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: chatting +Content-Transfer-Encoding: quoted-printable + + +richard added the comment: + +This is a followup + +---------- +assignedto: -> mary +nosy: +john, mary +status: unread -> chatting +title: Testing... -> new title + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ +''') + + def testNosyGeneration(self): + self.db.issue.create(title='test') + + # create a nosy message + msg = self.db.msg.create(content='This is a test', + author=self.richard_id, messageid='') + self.db.journaltag = 'richard' + l = self.db.issue.create(title='test', messages=[msg], + nosy=[self.chef_id, self.mary_id, self.john_id]) + + self.compareMessages(self._get_mail(), +'''FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, john@test.test, mary@test.test +Content-Type: text/plain; charset="utf-8" +Subject: [issue2] test +To: chef@bork.bork.bork, john@test.test, mary@test.test +From: richard +Reply-To: Roundup issue tracker + +MIME-Version: 1.0 +Message-Id: +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: unread +Content-Transfer-Encoding: quoted-printable + + +New submission from richard : + +This is a test + +---------- +messages: 1 +nosy: Chef, john, mary, richard +status: unread +title: test + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ ''') def testPropertyChangeOnly(self): @@ -582,7 +995,7 @@ _______________________________________________________________________ # reconstruct old behaviour: This would reuse the # database-handle from the doNewIssue above which has committed # as user "Chef". So we close and reopen the db as that user. - self.db.close() + #self.db.close() actually don't close 'cos this empties memorydb self.db = self.instance.open('Chef') self.db.issue.set('1', assignedto=self.chef_id) self.db.commit() @@ -607,6 +1020,7 @@ X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello X-Roundup-Issue-Status: unread X-Roundup-Version: 1.3.3 +In-Reply-To: MIME-Version: 1.0 Reply-To: Roundup issue tracker @@ -1032,6 +1446,7 @@ Subject: [issue1] Testing... [nosy=-richard] assert not os.path.exists(SENDMAILDEBUG) def testNewUserAuthor(self): + self.db.commit() l = self.db.user.list() l.sort() message = '''Content-Type: text/plain; @@ -1133,8 +1548,7 @@ Subject: [issue] Testing nonexisting user... This is a test submission of a new issue. ''' - self.db.close() - handler = self.instance.MailGW(self.instance) + handler = self._create_mailgw(message) # we want a bounce message: handler.trapExceptions = 1 ret = handler.main(StringIO(message)) @@ -1898,6 +2312,22 @@ Message-Id: assert not os.path.exists(SENDMAILDEBUG) self.assertEqual(self.db.keyword.get('1', 'name'), 'Bar') + def testOneCharSubject(self): + message = '''Content-Type: text/plain; + charset="iso-8859-1" +From: Chef +To: issue_tracker@your.tracker.email.domain.example +Subject: b +Cc: richard@test.test +Reply-To: chef@bork.bork.bork +Message-Id: + +''' + try: + self._handle_mail(message) + except MailUsageError: + self.fail('MailUsageError raised') + def testIssueidLast(self): nodeid1 = self.doNewIssue() nodeid2 = self._handle_mail('''Content-Type: text/plain; @@ -1927,7 +2357,7 @@ This is a second followup charset="iso-8859-1" From: Chef To: issue_tracker@your.tracker.email.domain.example -Message-Id: +Message-Id: Subject: [issue%(id)s] Testing... [nosy=+mary] Just a test reply @@ -1943,7 +2373,8 @@ From: "Bork, Chef" Reply-To: Roundup issue tracker MIME-Version: 1.0 -Message-Id: +Message-Id: +In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello X-Roundup-Issue-Status: chatting @@ -1964,6 +2395,239 @@ Roundup issue tracker _______________________________________________________________________ ''') + def testOutlookAttachment(self): + message = '''X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----_=_NextPart_001_01CACA65.40A51CBC" +Subject: Example of a failed outlook attachment e-mail +Date: Tue, 23 Mar 2010 01:43:44 -0700 +Message-ID: +X-MS-Has-Attach: yes +X-MS-TNEF-Correlator: +Thread-Topic: Example of a failed outlook attachment e-mail +Thread-Index: AcrKJo/t3pUBBwTpSwWNE3LE67UBDQ== +From: "Hugh" +To: +X-OriginalArrivalTime: 23 Mar 2010 08:45:57.0350 (UTC) FILETIME=[41893860:01CACA65] + +This is a multi-part message in MIME format. + +------_=_NextPart_001_01CACA65.40A51CBC +Content-Type: multipart/alternative; + boundary="----_=_NextPart_002_01CACA65.40A51CBC" + + +------_=_NextPart_002_01CACA65.40A51CBC +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + +Hi Richard, + +I suppose this isn't the exact message that was sent but is a resend of +one of my trial messages that failed. For your benefit I changed the +subject line and am adding these words to the message body. Should +still be as problematic, but if you like I can resend an exact copy of a +failed message changing nothing except putting your address instead of +our tracker. + +Thanks very much for taking time to look into this. Much appreciated. + + <>=20 + +------_=_NextPart_002_01CACA65.40A51CBC +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + + + +Example of a failed outlook attachment e-mail + + + +
+ +

Hi Richard, +

+ +

I suppose this isn't the exact message = +that was sent but is a resend of one of my trial messages that = +failed.  For your benefit I changed the subject line and am adding = +these words to the message body.  Should still be as problematic, = +but if you like I can resend an exact copy of a failed message changing = +nothing except putting your address instead of our tracker.

+ +

Thanks very much for taking time to = +look into this.  Much appreciated. +

+
+ +

<<battery = +backup>> +

+ + + +------_=_NextPart_002_01CACA65.40A51CBC-- + +------_=_NextPart_001_01CACA65.40A51CBC +Content-Type: message/rfc822 +Content-Transfer-Encoding: 7bit + +X-MimeOLE: Produced By Microsoft Exchange V6.5 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----_=_NextPart_003_01CAC15A.29717800" +X-OriginalArrivalTime: 11 Mar 2010 20:33:51.0249 (UTC) FILETIME=[28FEE010:01CAC15A] +Content-class: urn:content-classes:message +Subject: battery backup +Date: Thu, 11 Mar 2010 13:33:43 -0700 +Message-ID: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: battery backup +Thread-Index: AcrBWimtulTrSvBdQ2CcfZ8lyQdxmQ== +From: "Jerry" +To: "Hugh" + +This is a multi-part message in MIME format. + +------_=_NextPart_003_01CAC15A.29717800 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Dear Hugh, + A car batter has an energy capacity of ~ 500Wh. A UPS=20 +battery is worse than this. + +if we need to provied 100kW for 30 minutes that will take 100 car=20 +batteries. This seems like an awful lot of batteries. + +Of course I like your idea of making the time 1 minute, so we get to=20 +a more modest number of batteries + +Jerry + + +------_=_NextPart_003_01CAC15A.29717800 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + +battery backup + + + + +

Dear Hugh, + +
        A car = +batter has an energy capacity of ~ 500Wh.  A UPS + +
battery is worse than this. +

+ +

if we need to provied 100kW for 30 minutes that will = +take 100 car + +
batteries.  This seems like an awful lot of = +batteries. +

+ +

Of course I like your idea of making the time 1 = +minute, so we get to + +
a more modest number of batteries +

+ +

Jerry +

+ + + +------_=_NextPart_003_01CAC15A.29717800-- + +------_=_NextPart_001_01CACA65.40A51CBC-- +''' + nodeid = self._handle_mail(message) + assert not os.path.exists(SENDMAILDEBUG) + msgid = self.db.issue.get(nodeid, 'messages')[0] + self.assert_(self.db.msg.get(msgid, 'content').startswith('Hi Richard')) + self.assertEqual(self.db.msg.get(msgid, 'files'), ['1', '2']) + fileid = self.db.msg.get(msgid, 'files')[0] + self.assertEqual(self.db.file.get(fileid, 'type'), 'text/html') + fileid = self.db.msg.get(msgid, 'files')[1] + self.assertEqual(self.db.file.get(fileid, 'type'), 'message/rfc822') + + def testForwardedMessageAttachment(self): + message = '''Return-Path: +Received: from localhost(127.0.0.1), claiming to be "[115.130.26.69]" +via SMTP by localhost, id smtpdAAApLaWrq; Tue Apr 13 23:10:05 2010 +Message-ID: <4BC4F9C7.50409@test.test> +Date: Wed, 14 Apr 2010 09:09:59 +1000 +From: Rupert Goldie +User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) +MIME-Version: 1.0 +To: ekit issues +Subject: [Fwd: PHP ERROR (fb)] post limit reached +Content-Type: multipart/mixed; boundary="------------000807090608060304010403" + +This is a multi-part message in MIME format. +--------------000807090608060304010403 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit + +Catch this exception and log it without emailing. + +--------------000807090608060304010403 +Content-Type: message/rfc822; name="PHP ERROR (fb).eml" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline; filename="PHP ERROR (fb).eml" + +Return-Path: +X-Sieve: CMU Sieve 2.2 +via SMTP by crown.off.ekorp.com, id smtpdAAA1JaW1o; Tue Apr 13 23:01:04 2010 +X-Virus-Scanned: by amavisd-new at ekit.com +To: facebook-errors@test.test +From: ektravj@test.test +Subject: PHP ERROR (fb) +Message-Id: <20100413230100.D601D27E84@mail2.elax3.ekorp.com> +Date: Tue, 13 Apr 2010 23:01:00 +0000 (UTC) + +[13-Apr-2010 22:49:02] PHP Fatal error: Uncaught exception 'Exception' with message 'Facebook Error Message: Feed action request limit reached' in /app/01/www/virtual/fb.ekit.com/htdocs/includes/functions.php:280 +Stack trace: +#0 /app/01/www/virtual/fb.ekit.com/htdocs/gateway/ekit/feed/index.php(178): fb_exceptions(Object(FacebookRestClientException)) +#1 {main} + thrown in /app/01/www/virtual/fb.ekit.com/htdocs/includes/functions.php on line 280 + + +--------------000807090608060304010403-- +''' + nodeid = self._handle_mail(message) + assert not os.path.exists(SENDMAILDEBUG) + msgid = self.db.issue.get(nodeid, 'messages')[0] + self.assertEqual(self.db.msg.get(msgid, 'content'), + 'Catch this exception and log it without emailing.') + self.assertEqual(self.db.msg.get(msgid, 'files'), ['1']) + fileid = self.db.msg.get(msgid, 'files')[0] + self.assertEqual(self.db.file.get(fileid, 'type'), 'message/rfc822') def test_suite(): suite = unittest.TestSuite() @@ -1975,3 +2639,7 @@ if __name__ == '__main__': unittest.main(testRunner=runner) # vim: set filetype=python sts=4 sw=4 et si : + + + +