Modify

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#124 closed defect (fixed)

new ticket creation fails: AttributeError: 'NoneType' object has no attribute 'replace'

Reported by: gdh@… Owned by: anonymous
Priority: major Milestone:
Component: email2trac Version: 0.70
Keywords: Cc:

Description

Hi - I've used dpkg-buildpackage on Ubuntu hardy to build email2trac 0.70 with trac 0.11. Trying either run_email2trac in /etc/aliases, or email2trac in /etc/aliases.nobody (chowned + postalias'd) fails with this error when I run 'mail tracproj <msg.txt'

Feb 23 12:56:54 dev postfix/qmgr[25750]: F07E51F49FE: from=<root@…>, size=2214, nrcpt=1 (que ue active) Feb 23 12:56:55 dev email2trac: Traceback (most recent call last): Feb 23 12:56:55 dev email2trac: File "/usr/bin/email2trac", line 1466, in <module> tktparser.parse(sys .stdin) Feb 23 12:56:55 dev email2trac: File "/usr/bin/email2trac", line 835, in parse m.replace_header('Subje ct', mSubject?.replace('\r', ).replace('\n', )) Feb 23 12:56:55 dev email2trac: AttributeError?: 'NoneType?' object has no attribute 'replace' Feb 23 12:56:55 dev postfix/local[25758]: F07E51F49FE: to=<tracproj@…>, orig_to=<tracproj>, relay=local, delay=0.44, delays=0.02/0.01/0/0.42, dsn=5.3.0, status=bounced (Command died with status 1: "/usr/bin/email2trac ". Command output: TD: saving email to /tmp/tmpSOrsIb.email2trac )

If I run 'email2trac <msg.txt' manually from the commandline as root, then the new ticket is created OK :/

My /etc/aliases.nobody is this one line: tracproj: |"/usr/bin/email2trac "

Attachments (1)

tmpSOrsIb.email2trac (2.3 KB) - added by anonymous 15 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 15 years ago by anonymous

Arg, wiki quoting

Feb 23 12:56:54 dev postfix/qmgr[25750]: F07E51F49FE: from=<root@dev.laterooms.com>, size=2214, nrcpt=1 (que
ue active)
Feb 23 12:56:55 dev email2trac: Traceback (most recent call last): 
Feb 23 12:56:55 dev email2trac:   File "/usr/bin/email2trac", line 1466, in <module>     tktparser.parse(sys
.stdin) 
Feb 23 12:56:55 dev email2trac:   File "/usr/bin/email2trac", line 835, in parse     m.replace_header('Subject', m['Subject'].replace('\r', '').replace('\n', '')) 

Feb 23 12:56:55 dev email2trac: AttributeError: 'NoneType' object has no attribute 'replace' 

Feb 23 12:56:55 dev postfix/local[25758]: F07E51F49FE: to=<tracproj@dev.laterooms.com>, orig_to=<tracproj>, relay=local, delay=0.44, delays=0.02/0.01/0/0.42, dsn=5.3.0, status=bounced (Command died with status 1: "/usr/bin/email2trac ". Command output: TD: saving email to /tmp/tmpSOrsIb.email2trac )

comment:2 Changed 15 years ago by anonymous

  • Owner changed from bas to anonymous
  • Status changed from new to assigned
  • Type changed from setup to defect

Did you send an email with an empty Subject?

comment:3 Changed 15 years ago by anonymous

Hi.

No, as described above I have been using the test 'msg.txt' that comes in the email2trac tarball

comment:4 Changed 15 years ago by anonymous

That is weird. Is the message correctly dumped in /tmp/tmpSOrsIb.email2trac?

comment:5 Changed 15 years ago by anonymous

Yes. I just did a 'diff -u' between the /tmp one and msg.txt.. and the only difference is the extra header block from my local MTA

Interestingly, if I comment out line 835, the script runs without error, although it just dumps the whole raw RFC822 message into a new ticket without setting the title or picking attachments out from the body text

Also interestingly, that line seems to be a hack in itself!

# Work around lack of header folding in Python; see http://bugs.python.org/issue4696 # m.replace_header('Subject', mSubject?.replace('\r', ).replace('\n', ))

The version of Python on my system is 2.5.2

comment:6 Changed 15 years ago by anonymous

So for email2trac it is not a valid message if it dumps the complete email message. So we must generate a more sensible error message. So it must be in the extra header that your local MTA inserts.

comment:7 Changed 15 years ago by anonymous

Hm, I just have Postfix with an utterly standard 'Internet system' config.. here's the output from the 'diff -u' I mentioned above:

diff -u tmpzmtgPw.email2trac /home/gdh/email2trac-0.70/msg.txt 
--- tmpzmtgPw.email2trac	2009-02-23 14:44:41.000000000 +0000
+++ /home/gdh/email2trac-0.70/msg.txt	2006-05-22 10:44:59.000000000 +0100
@@ -1,15 +1,4 @@
-From root@dev.laterooms.com  Mon Feb 23 14:44:41 2009
-Return-Path: <root@dev.laterooms.com>
-X-Original-To: tracproj
-Delivered-To: tracproj@dev.laterooms.com
-Received: by dev.laterooms.com (Postfix, from userid 0)
-	id 1FE451F49FE; Mon, 23 Feb 2009 14:44:41 +0000 (GMT)
-To: tracproj@dev.laterooms.com
-Message-Id: <20090223144441.1FE451F49FE@dev.laterooms.com>
-Date: Mon, 23 Feb 2009 14:44:41 +0000 (GMT)
-From: root@dev.laterooms.com (root)
-
->From basv@sara.nl  Wed Mar  8 15:29:17 2006
+From basv@sara.nl  Wed Mar  8 15:29:17 2006
 Return-Path: <basv@sara.nl>
 X-Original-To: test@subtrac.sara.nl
 Delivered-To: test@subtrac.sara.nl

I can't see anything wrong with that ...

comment:8 Changed 15 years ago by anonymous

Can you attach the dumped message. Then i can test it with:

  • email2trac < dump.msg

I suspect that the following line:

->From basv@sara.nl  Wed Mar  8 15:29:17 2006
+From basv@sara.nl  Wed Mar  8 15:29:17 2006

Changed 15 years ago by anonymous

comment:9 Changed 15 years ago by anonymous

OK I just tried generating a real email using mutt with attachments and it's worked absolutely fine.. so looks like I wasted a ton of time because of a malformed sample file in the tarball. grrrrr.

Thanks for your time all the same - now I have to make the replies work gracefully. :)

comment:10 Changed 15 years ago by anonymous

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

The msg.txt is just fine it is just for testing email2trac standalone without the MTA.

comment:11 Changed 14 years ago by anonymous

Yes I can confirm the msg.txt test email will not work with postfix. I'm usinfg email2trac 0.80 greetz alvaro

comment:12 Changed 14 years ago by bas

huh, did you read the docs? It just for testing email2trac not postfix!

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain anonymous.
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.