Modify

Opened 5 years ago

Closed 5 years ago

#366 closed enhancement (fixed)

Test message errors with email2.8.8./ trac 1.1.4

Reported by: michela@… Owned by: bas
Priority: blocker Milestone:
Component: email2trac Version: 2.8.4
Keywords: Cc:

Description

Unable to get email2.8.8./ trac 1.1.4 working

Running default test message locally I'm getting the following error:

/usr/local/bin/email2trac --project anmm --virtualenv /srv/env/anmm < msg.txt

May 15 15:04:43 tgtwn email2trac anmm: Found trac version: 1.1
May 15 15:04:44 tgtwn email2trac anmm: Loading environment /srv/env/anmm/trac/anmm
May 15 15:04:44 tgtwn email2trac anmm: Main function parse
May 15 15:04:44 tgtwn email2trac anmm: saving email to /tmp/tmpmu3Phf.anmm.email2trac
May 15 15:04:44 tgtwn email2trac anmm: function get_message_parts()
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Main-Type: multipart
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Content-Type: multipart/mixed
May 15 15:04:44 tgtwn email2trac anmm: #011 Skipping multipart container
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Main-Type: text
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Content-Type: text/plain
May 15 15:04:44 tgtwn email2trac anmm: function inline_part()
May 15 15:04:44 tgtwn email2trac anmm: function email_to_unicode
May 15 15:04:44 tgtwn email2trac anmm: #011 repr:None type:<type 'NoneType'>
May 15 15:04:44 tgtwn email2trac anmm: #011 unicode filename: None
May 15 15:04:44 tgtwn email2trac anmm: #011 raw filename: None
May 15 15:04:44 tgtwn email2trac anmm: function strip_signature: ^-- $
May 15 15:04:44 tgtwn email2trac anmm: function inline_properties
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Main-Type: text
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Content-Type: text/plain
May 15 15:04:44 tgtwn email2trac anmm: function inline_part()
May 15 15:04:44 tgtwn email2trac anmm: function email_to_unicode
May 15 15:04:44 tgtwn email2trac anmm: #011 repr:'basje.txt' type:<type 'str'>
May 15 15:04:44 tgtwn email2trac anmm: #011 unicode filename: basje.txt
May 15 15:04:44 tgtwn email2trac anmm: #011 raw filename: 'basje.txt'
May 15 15:04:44 tgtwn email2trac anmm: function strip_signature: ^-- $
May 15 15:04:44 tgtwn email2trac anmm: function inline_properties
May 15 15:04:44 tgtwn email2trac anmm: function unique_attachment_names()
May 15 15:04:44 tgtwn email2trac anmm: function get_body_text()
May 15 15:04:44 tgtwn email2trac anmm: function debug_body:
May 15 15:04:44 tgtwn email2trac anmm: writing body to /tmp/tmpmu3Phf.anmm.email2trac.body
May 15 15:04:44 tgtwn email2trac anmm: function debug_attachments
May 15 15:04:44 tgtwn email2trac anmm: function get_sender_info
May 15 15:04:44 tgtwn email2trac anmm: function email_to_unicode
May 15 15:04:44 tgtwn email2trac anmm: #011 repr:'Bas van der Vlies' type:<type 'str'>
May 15 15:04:44 tgtwn email2trac anmm: #011 email name: Bas van der Vlies, email address: basv@sara.nl
May 15 15:04:44 tgtwn email2trac anmm: Traceback (most recent call last):
May 15 15:04:44 tgtwn email2trac anmm:   File "/usr/local/bin/email2trac", line 2915, in <module>#012    tktparser.parse(sys.stdin)
May 15 15:04:44 tgtwn email2trac anmm:   File "/usr/local/bin/email2trac", line 1782, in parse#012    self.get_sender_info(m)
May 15 15:04:44 tgtwn email2trac anmm:   File "/usr/local/bin/email2trac", line 376, in get_sender_info#012    users = [ (u,n,e) for (u, n, e) in self.env.get_known_users(self.db)
May 15 15:04:44 tgtwn email2trac anmm: TypeError: get_known_users() takes exactly 1 argument (2 given)
May 15 15:04:44 tgtwn email2trac anmm: saving email to /tmp/tmpDW8jmS.anmm.email2trac
May 15 15:04:44 tgtwn email2trac anmm: function get_message_parts()
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Main-Type: multipart
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Content-Type: multipart/mixed
May 15 15:04:44 tgtwn email2trac anmm: #011 Skipping multipart container
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Main-Type: text
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Content-Type: text/plain
May 15 15:04:44 tgtwn email2trac anmm: function inline_part()
May 15 15:04:44 tgtwn email2trac anmm: function email_to_unicode
May 15 15:04:44 tgtwn email2trac anmm: #011 repr:None type:<type 'NoneType'>
May 15 15:04:44 tgtwn email2trac anmm: #011 unicode filename: None
May 15 15:04:44 tgtwn email2trac anmm: #011 raw filename: None
May 15 15:04:44 tgtwn email2trac anmm: function strip_signature: ^-- $
May 15 15:04:44 tgtwn email2trac anmm: function inline_properties
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Main-Type: text
May 15 15:04:44 tgtwn email2trac anmm: #011 Message part: Content-Type: text/plain
May 15 15:04:44 tgtwn email2trac anmm: function inline_part()
May 15 15:04:44 tgtwn email2trac anmm: function email_to_unicode
May 15 15:04:44 tgtwn email2trac anmm: #011 repr:'basje.txt' type:<type 'str'>
May 15 15:04:44 tgtwn email2trac anmm: #011 unicode filename: basje.txt
May 15 15:04:44 tgtwn email2trac anmm: #011 raw filename: 'basje.txt'
May 15 15:04:44 tgtwn email2trac anmm: function strip_signature: ^-- $
May 15 15:04:44 tgtwn email2trac anmm: function inline_properties
May 15 15:04:44 tgtwn email2trac anmm: function unique_attachment_names()
May 15 15:04:44 tgtwn email2trac anmm: function get_body_text()
May 15 15:04:44 tgtwn email2trac anmm: function debug_body:
May 15 15:04:44 tgtwn email2trac anmm: writing body to /tmp/tmpDW8jmS.anmm.email2trac.body
May 15 15:04:44 tgtwn email2trac anmm: function debug_attachments

My email2trac.conf section for this trac is

[anmm] project: /srv/env/anmm/trac/anmm debug: 1 virtualenv: /srv/env/anmm spam_level: 1 strip_signature: 1 inline_properties: 1

Attachments (0)

Change History (8)

comment:1 Changed 5 years ago by michela@…

Also not working against trunk Revision: 668

comment:2 Changed 5 years ago by Michela Ledwidge <michela@…>

Got test message working with this

l376:

  • users = [ (u,n,e) for (u, n, e) in self.env.get_known_users(self.db)

+ users = [ (u,n,e) for (u, n, e) in self.env.get_known_users()

comment:3 follow-up: Changed 5 years ago by bas

  • Status changed from new to assigned
  • Type changed from defect to enhancement

Thanks. I did not test the 1.1.X version. So maybe there are some api changes. With this fix everything else works as expected?

comment:4 Changed 5 years ago by Michela Ledwidge <michela@…>

Patch for Trac 1.1.4 below:

Index: email2trac.py.in
===================================================================
--- email2trac.py.in	(revision 668)
+++ email2trac.py.in	(working copy)
@@ -373,7 +373,7 @@
         #   n : Name that the user has set in the settings tab
         #   e : email address that the user has set in the settings tab 
         #
-        users = [ (u,n,e) for (u, n, e) in self.env.get_known_users(self.db)
+        users = [ (u,n,e) for (u, n, e) in self.env.get_known_users()
             if ( 
                 (e and (e.lower() == self.email_addr.lower())) or
                 (u and (u.lower() + '@' + self.smtp_default_domain.lower() == self.email_addr.lower()))
@@ -1029,7 +1029,7 @@
 
         ## How many changes has this ticket
         #
-        grouped = TicketModule(self.env).grouped_changelog_entries(tkt, self.db)
+        grouped = TicketModule(self.env).grouped_changelog_entries(tkt)
         cnum = sum(1 for e in grouped) + 1

comment:5 Changed 5 years ago by bas

Thanks for the patch

comment:6 in reply to: ↑ 3 ; follow-up: Changed 5 years ago by Michela Ledwidge <michela@…>

Replying to bas:

Thanks. I did not test the 1.1.X version. So maybe there are some api changes. With this fix everything else works as expected?

New ticket and replies seem ok with and without attachments seem ok with the patch below. Anything else I should test?

comment:7 in reply to: ↑ 6 Changed 5 years ago by bas

Replying to Michela Ledwidge <michela@…>:

Replying to bas:

Thanks. I did not test the 1.1.X version. So maybe there are some api changes. With this fix everything else works as expected?

New ticket and replies seem ok with and without attachments seem ok with the patch below. Anything else I should test?

That is the basic functionality. maybe this patch also works for trac version 1.0. I will test this in our environment.

comment:8 Changed 5 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

Committed patch see:

and dropped support for trac version 0.11 and 0.12

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.