Modify

Opened 12 years ago

Closed 12 years ago

#158 closed setup (fixed)

Need Help:Struggling to get Email2Trac working on Debian

Reported by: roshan_shankar@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 1.0.0
Keywords: Cc:

Description

Hi,
I have Debian with exim4 installed and I am trying to use Email2Trac
to email tickets into Trac.

I have confirmed that emails can be sent and received by the Debian
box - emails to root@mydebainbox.mycompany.com get to it and likewise
emails I send from there get to external email addresses.

I have two projects - a project called test whose email is
test@mydebianbox.mycompany.com and a project called "real" whose email
is real@mydebianbox.mycompany.com

The projects are all under /var/lib/trac - in test and real folder,
respectively.

A few issues I have are

1. I do not know how to configure Email2Trac.conf for multiple
projects. An example would help. I, for now, changed the project
entry's value on the [default] to point to my test project.

2. Per the MTA configuration page, I am not supposed to enter entries
in /etc/aliases but use the router and transport files to set up the
forward to email2trac. The problem is I do not understand router/
transport files well enough. I copied the example on the page and that
did not work.

So, I went ahead and created the aliases in /etc/aliases. And, tested
it from the box using  - mail test < msg.txt and that did create a
ticket on the test project.

Then, I tried to email to test@mydebianbox.mycompany.com and I get a
message after a few hours saying

This message was created automatically by mail delivery software.

A message that you sent has not yet been delivered to one or more of
its recipients after more than 24 hours on the queue on
stastepagl01.dillonkane.com.



The message identifier is:     1N3ui2-0001J3-LH

The date of the message is:    Fri, 30 Oct 2009 11:52:18 -0500

The subject of the message is: test



The address to which the message has not yet been delivered is:



  pipe to |"/usr/bin/email2trac --project=test --ticket_prefix=test"

    generated by test@mydebianbox.mycompany.com



No action is required on your part. Delivery attempts will continue
for some time, and this warning may be repeated at intervals if the
message remains undelivered. Eventually the mail delivery software
will give up, and when that happens, the message will be returned to
you.



Please help me to get the Email2Trac working either using
router/transport or using aliases.



TIA

Roshan

Attachments (0)

Change History (7)

comment:1 Changed 12 years ago by roshan_shankar@…

This message has 0 attachment(s)

comment:2 Changed 12 years ago by roshan_shankar@…

Hi,
    Please note, I have tried

test: |"/usr/local/bin/run_email2trac --project=test
--ticket_prefix=test",
in /etc/aliases, too.

I should clarify that

mail test < msg.txt does not result in a ticket on the site but
email2trac --project=test < msg.txt results in a ticket

I also found that in Debian invoking pipes /etc/aliases is disabled by
default/ deprecated.

So, I guess I need to get the router/ transport option working

My router file: 101_exim4-config_trac_gw is as follows
trac_router:
  driver = accept
  require_files = /usr/local/bin/email2trac
  local_parts = support
  transport = trac_transport

My transport file: 30_exim4-config_trac

trac_transport:

  driver = pipe

  command = /usr/local/bin/email2trac

  current_directory = /tmp

  home_directory =  /tmp

  user = www-data

  group = www-data

This issue is similar to ticket 50 - reported
https://subtrac.sara.nl/oss/email2trac/ticket/50 and solved by the
user who
reported it

I have updated the conf.template and regenerated the configuration.
But, the
problem still exists.

Thanks



--------------------------------------------------
From: "email2trac" <email2trac@sara.nl>
Sent: Saturday, October 31, 2009 3:41 PM
Cc: <basv@sara.nl>
Subject: [email2trac] #158: Need Help:Struggling to get Email2Trac
working
on Debian

comment:3 Changed 12 years ago by bas

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

i will provide an example, here is the one i use, note no project defined

  • email2trac.conf
    DEFAULT]
    debug: 0
    spam_level: 4
    reply_address: 0
    mailto_link: 0
    umask: 022
    email_comment: >
    email_header: 0
    trac_version: 0.11
    ticket_update: 1
    enable_syslog: 1
    alternate_notify_template :
    drop_spam : 0
    use_textwrap: 70
    email_quote: >
    strip_quotes: 0
    ignore_trac_user_settings: 0
    black_list: MAILER-DAEMON@
    drop_alternative_html_version: 1
    
    [hic]
    project: /data/trac/hpcv/project/hic
    spam_level: 5
    
    [beowulf]
    project: /data/trac/hpcv/project/beowulf
    strip_quotes: 1
    

Now you can test it with:

  • email2trac --project beowulf < msg.txt

Edit /etc/aliases: (i use postfi, you do not need run_email2trac, depends on your setup)

  • beowulf: |"/usr/bin/run_email2trac --project beowulf"
  • hic : |"/usr/bin/run_email2trac --project hic"

comment:4 Changed 12 years ago by roshan_shankar@…

Hi,
Thanks for the response. Yes, email2trac works if invoked from command
line,
directly.

ie. email2trac --project beowulf < msg.txt works

but, mail beowulf < msg.txt does not work
even if /etc/aliases has

beowulf: |"/usr/bin/run_email2trac --project beowulf"

I believe this is because that with exim4 on Debian pipe to programs
using
/etc/aliases is not allowed. See this link,
http://pkg-
exim4.alioth.debian.org/README/README.Debian.etch.html#id224380

exim4 on Debian requires use of a router/ transport. I have one setup
based
on the information on
https://subtrac.sara.nl/oss/email2trac/wiki/Email2tracMta (see Exim
setup).

Issue is that it does not work for me - emails do not get delivered/
appear
as tickets.

I do not see anywhere in the router/ transport an entry for the
project
name.

any ideas?

thanks


--------------------------------------------------
From: "email2trac" <email2trac@sara.nl>
Sent: Monday, November 02, 2009 4:33 AM
Cc: <basv@sara.nl>
Subject: Re: [email2trac] #158: Need Help:Struggling to get Email2Trac
working on Debian

comment:5 Changed 12 years ago by roshan_shankar@…

After some further debugging I have confirmed that postfix is running
as
nobody.

As mentioned earlier

sudo email2trac --project=test < msg.txt works

But,
run_email2trac --project=test < msg.txt does not

Neither does
sudo run_email2trac --project=test < msg.txt

I have deleted /usr/local/bin/email2trac and run_email2trac and
installed
again using

./configure, make, make install. Still get the same results

I can't get to build the .deb package even though my operating system
is
debian.

I get some /usr/share/cdbs... no such file or directory errors. I
think this
is related to a debian bug

Any ideas on how to get run_email2trac to work or to by pass it ( I
guess
the alternate config mentioned. I would like an example, please).

Thanks


--------------------------------------------------
From: "Roshan Shankar" <roshan_shankar@hotmail.com>
Sent: Monday, November 02, 2009 4:44 PM
To: <email2trac@sara.nl>
Cc: <basv@sara.nl>
Subject: Re: [email2trac] #158: Need Help:Struggling to get Email2Trac
working on Debian

comment:6 Changed 12 years ago by roshan_shankar@…

The Syslog has the following entries when I try to mail test < msg.txt

Nov 3 10:27:59 stastepagl01 postfix/qmgr[10180]: 2F6A8B431: from=<agilo@…>, size=2283, nrcpt=1 (queue active) Nov 3 10:27:59 stastepagl01 postfix/local[10210]: 2F6A8B431: to=<test@…>, orig_to=<test>, relay=local, delay=0.22, delays=0.07/0.01/0/0.14, dsn=5.3.0, status=bounced (Command died with status 1: "/usr/local/bin/email2trac --project=test". Command output: Traceback (most recent call last): File "/usr/local/bin/email2trac", line 87, in <module> from trac import config as trac_config File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/config.py", line 20, in <module> from trac.util.compat import set, sorted File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/util/init.py", line 33, in <module> from trac.util.html import escape, unescape, Markup, Deuglifier File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/util/html.py", line 16, in <module> from genshi import Markup, escape, unescape File "/usr/lib/python2.5/site-packages/PIL/init.py", line 32, in <module> File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 544, in <module> File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/_speedups.py", line 7, in <module> File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/_speedups.py", line 4, in bootstrap File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 882, in resource_filename """ % (old_exc, cache_path) File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1352, in get_resource_filename stat = os.stat(real_path) File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1373, in _extract_resource if self.has_metadata(name): File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 962, in get_cache_path os.chmod(tempname, mode) File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 928, in extraction_error pkg_resources.ExtractionError?: Can't extract file(s) to egg cache The following error occurred while trying to extract file(s) t Nov 3 10:27:59 stastepagl01 postfix/cleanup[10208]: 57EFCB435: message-id=<20091103162759.57EFCB435@…> Nov 3 10:27:59 stastepagl01 postfix/qmgr[10180]: 57EFCB435: from=<>, size=8770, nrcpt=1 (queue active) Nov 3 10:27:59 stastepagl01 postfix/bounce[10212]: 2F6A8B431: sender non-delivery notification: 57EFCB435 Nov 3 10:27:59 stastepagl01 postfix/qmgr[10180]: 2F6A8B431: removed

comment:7 Changed 12 years ago by roshan_shankar@…

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

Finally, I got this working for most part.

Turns out it was failing because of some issues with PYTHON_EGG_CACHE directory. I am not sure why and where it is being used. I did see an old thread about providing a python_egg_cache option in Email2trac.conf. I went ahead and added that to Email2Trac.conf and that did not make any difference.

So, I finally changed my alias pipe command to include setting the PYTHON_EGG_CACHE and exporting it before doing the run_email2trac.

so, the entry in my aliases (/usr/local/etc/aliases) file looks like test:|"PYTHON_EGG_CACHE=/var/cache/python; export PYTHON_EGG_CACHE; /usr/local$/local/bin/run_email2trac --project=test"

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.