id summary reporter owner description type status priority milestone component version resolution keywords cc 334 run_email2trac crashes intermittently bsilverman@… bas "I'm running run_email2trac with the following command in /etc/aliases: {{{ sw: ""|/usr/local/bin/run_email2trac -d -f /usr/local/etc/email2trac.conf"" }}} Unfortunately, it crashes in the email2trac script. If I run the email to trac script directly (but as root), using: {{{ cat foo | sudo /usr/local/bin/email2trac -d -f /usr/local/etc/email2trac.conf"" }}} (where foo is a saved email of mine), then the program runs fully without error, and I get a new ticket in the trac database. The error I get in /var/log/mail.log shows the command failing, but doesn't print enough output to show all the debug info: {{{ Jan 13 11:17:19 iv-eng-vm postfix/smtpd[24168]: connect from wisrv001.westonlan.com[10.0.20.20] Jan 13 11:17:20 iv-eng-vm postfix/smtpd[24168]: C7EAD2B28BA: client=wisrv001.westonlan.com[10.0.20.20] Jan 13 11:17:20 iv-eng-vm postfix/cleanup[24172]: C7EAD2B28BA: message-id=<98EC3A86-C519-4774-A868-BBD063036E9B@iveia.com> Jan 13 11:17:20 iv-eng-vm postfix/qmgr[3160]: C7EAD2B28BA: from=, size=24112, nrcpt=1 (queue active) Jan 13 11:17:20 iv-eng-vm postfix/smtpd[24168]: disconnect from wisrv001.westonlan.com[10.0.20.20] Jan 13 11:17:21 iv-eng-vm postfix/local[24173]: C7EAD2B28BA: to=, relay=local, delay=1.5, delays=0.35/0.01/0/1.2, dsn=5.3.0, status=bounced (Command died with status 1: ""/usr/local/bin/run_email2trac -d -f /usr/local/etc/email2trac.conf"". Command output: 2014-01-13 11:17:20,573 email2trac titan: Found trac version: 1.0 2014-01-13 11:17:20,730 email2trac titan: Loading environment /var/local/trac/titan 2014-01-13 11:17:21,163 email2trac titan: Main function parse 2014-01-13 11:17:21,167 email2trac titan: saving email to /tmp/tmp6GecYV.titan.email2trac 2014-01-13 11:17:21,172 email2trac titan: function get_message_parts() 2014-01-13 11:17:21,172 email2trac titan: Message part: Main-Type: multipart 2014-01-13 11:17:21,172 email2trac titan: Message part: Content-Type: multipart/alternative 2014-01-13 11:17:21,172 email2trac titan: Message part: Main-Type: text 2014-01-13 11:17:21,172 email2trac titan: Message part: Content-Type: text/plain 2014-01-13 11:17:21,172 email2trac titan: function Jan 13 11:17:21 iv-eng-vm postfix/cleanup[24172]: 5603A2B2904: message-id=<20140113161721.5603A2B2904@trac.iveia.com> Jan 13 11:17:21 iv-eng-vm postfix/qmgr[3160]: 5603A2B2904: from=<>, size=34660, nrcpt=1 (queue active) Jan 13 11:17:21 iv-eng-vm postfix/bounce[24176]: C7EAD2B28BA: sender non-delivery notification: 5603A2B2904 Jan 13 11:17:21 iv-eng-vm postfix/qmgr[3160]: C7EAD2B28BA: removed Jan 13 11:17:21 iv-eng-vm postfix/smtp[24177]: 5603A2B2904: to=, relay=iveia.com[10.0.20.20]:25, delay=0.13, delays=0.01/0.01/0.01/0.11, dsn=2.6.0, status=sent (250 2.6.0 <20140113161721.5603A2B2904@trac.iveia.com> Queued mail for delivery) Jan 13 11:17:21 iv-eng-vm postfix/qmgr[3160]: 5603A2B2904: removed }}} However, I added the following just after ""logger"" is instantiated so that I can see all the debug info: {{{ fh = logging.FileHandler('/tmp/spam.log') fh.setLevel(logging.DEBUG) logger.addHandler(fh) }}} when I do that, I see more info - and email2trac appears to just exit. For example: {{{ Found trac version: 1.0 Loading environment /var/local/trac/titan Main function parse saving email to /tmp/tmptnqS54.titan.email2trac function get_message_parts() Message part: Main-Type: multipart Message part: Content-Type: multipart/alternative Message part: Main-Type: text Message part: Content-Type: text/plain function inline_part() unicode filename: None raw filename: None function check_filename_length: function inline_properties Message part: Main-Type: text Message part: Content-Type: text/html function inline_part() Skipping alternative HTML message function unique_attachment_names() function get_body_text() function debug_body: writing body to /tmp/tmptnqS54.titan.email2trac.body function debug_attachments function get_sender_info function email_to_unicode email name: Brian Silverman, email address: bsilverman@iveia.com get_sender_info: found registered user: bsilverman function email_header_acl: white_list white_list not defined, all messages are allowed. function email_header_acl: black_list function email_header_acl: recipient_list recipient_list not defined, all messages are allowed. function spam function spam function email_to_unicode subject: u'test23' function ticket_update_by_subject function new_ticket function set_cc_fields function set_ticket_fields before trac[summary] = after before trac[reporter] = after before trac[owner] = < default > after used owner = < default > before trac[description] = after before trac[type] = defect after used type = defect before trac[status] = after before trac[priority] = none Traceback (most recent call last): }}} The file doesn't include a traceback. Note: the ""before"" and ""after"" were added by me as debug messages. Finally, when adding/removing debug messages, I have once seen the command work and actually insert a ticket in the trac database. More info - I am using: * Trac 1.0, * email2trac {{{ SVN Info: $Id: email2trac.py.in 628 2013-06-18 10:05:30Z bas $ }}} * Ubuntu: {{{ bri@iv-eng-vm:~/e2t/email2trac-2.7.0$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 9.04 Release: 9.04 Codename: jaunty }}} " setup closed major email2trac 2.7.0 fixed bsilverman@… mplamer@…