Opened 15 years ago
Closed 14 years ago
#126 closed defect (duplicate)
sendmail with email2trac problem (resubmitted with proper formatting)
Reported by: | anonymous | Owned by: | bas |
---|---|---|---|
Priority: | blocker | Milestone: | Release 1.1.0 |
Component: | email2trac | Version: | trunk |
Keywords: | Cc: |
Description
Hi, I've been looking through the archives and have followed the instructions for setting up sendmail with email2trac. i'm still having problems though
Mar 8 14:57:58 columbia sendmail[12261]: n28LvwGd012261: to=tracproj, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31888, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n28LvwZD012262 Message accepted for delivery) Mar 8 14:57:58 columbia sendmail[12263]: n28LvwZD012262: alias <tracproj@columbia.icmethods.com> => "|run_email2trac - project=versicUserDocs_trac --ticket_prefix=vsc_trac" Mar 8 14:57:58 columbia sendmail[12263]: n28LvwZD012262: to="|run_email2trac --project=versicUserDocs_trac --ticket_prefix=vsc_trac", ctladdr=<tracproj@col umbia.icmethods.com> (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=32499, dsn=5.3.0, stat=unknown mailer error 254 Mar 8 14:57:58 columbia sendmail[12263]: n28LvwZD012262: n28LvwZC012263: DSN: unknown mailer error 254
i setup the smrsh dir as per the instructions:
[root@columbia smrsh]# pwd /etc/smrsh [root@columbia smrsh]# ll total 24 8 drwxr-xr-x 2 root root 4096 Mar 8 05:21 . 16 drwxr-xr-x 112 root root 12288 Mar 8 15:00 .. 0 lrwxrwxrwx 1 root root 25 Mar 8 05:21 email2trac -> /usr/local/bin/email2trac 0 lrwxrwxrwx 1 root root 29 Mar 8 04:34 run_email2trac -> /usr/local/bin/run_email2trac
the permissions seem to be correct
[root@columbia bin]# pwd /usr/local/bin [root@columbia bin]# ll run_email2trac 12 -rwxr-sr-x 1 root root 8497 Mar 8 00:27 run_email2trac [root@columbia bin]# ll email2trac 40 -rwxr-xr-x 1 root root 39807 Mar 8 00:27 email2trac
running email2trac from the commandline worked correctly and i got a new ticket created
[root@columbia smrsh]# email2trac --project=versicUserDocs_trac -ticket_prefix=vsc_trac < /opt/trac/email2trac/trunk/msg.txt
Anyone got this working with sendmail? Have i missed something?
Attachments (0)
Change History (14)
comment:1 Changed 15 years ago by anonymous
- Priority changed from major to blocker
- Version changed from 0.6 to trunk
comment:2 Changed 15 years ago by bas
- Status changed from new to assigned
it is a permission problem with sendmail if email2trac is working and run_email2trac not. You can right i script and log the user id of the sendmail user:
id >> /var/tmp/sendmail.id
I have a postfix setup, do not knwo musch about sendmail. There is wiki about MTA setups
comment:3 Changed 15 years ago by anonymous
you mentioned a wiki? can you give me the address??
comment:4 Changed 15 years ago by bas
just the email2trac trac pages:
comment:5 Changed 15 years ago by A
Is there any more info on this?
I have tried to get this working (CentOS 5, Sendmail, Trac 0.11) and can't. I'm not that well versed in linux.
When I type the command above "id >> /var/tmp/sendmail.id", nothing comes up. Is that wrong?
comment:6 Changed 15 years ago by bas
- Version changed from trunk to 0.80
Instead of running the id on the command line. I meant replace run_email2trac, with these commands to find out the id, so you make an new script run_email2trac:
vi run_email2trac }} {{{ #/bin/sh id >> /var/tmp/sendmail.id }}} {{{ chmod 755 run_email2trac }}} You can also choice another MTA, such as postfix.
comment:7 Changed 15 years ago by A
OOohhh, okay.
I created the file: test_email2trac with the contents you had above.
It created the symlink.
I executed mail tracproj < msg.txt.
And it created the file sendmail.id. Here are the contents:
uid=8(mail) gid=12(mail) groups=12(mail)
Email2trac is using a Trac user of apache and a MTA user of root. Should I be using an MTA user of "mail"?
comment:8 Changed 15 years ago by bas
yes, you must use for MTA user, mail.
comment:9 Changed 15 years ago by A
Alright, so I did that. MTA user = mail Trac user = apache
I then got an error saying
The original message was received at Wed, 6 May 2009 11:13:41 -0400 from localdev.localdomain [127.0.0.1] ----- The following addresses had permanent fatal errors ----- "|run_email2trac" (reason: 1) (expanded from: <tracproj@localdev.localdomain>) ----- Transcript of session follows ----- Traceback (most recent call last): File "/usr/local/bin/email2trac", line 103, in ? from trac import config as trac_config File "/usr/lib/python2.4/site-packages/Trac-0.11.3-py2.4.egg/trac/config.py", line 19, in ? from trac.util.compat import set, sorted File "/usr/lib/python2.4/site-packages/Trac-0.11.3-py2.4.egg/trac/util/__init__.py", line 33, in ? from trac.util.html import escape, unescape, Markup, Deuglifier File "/usr/lib/python2.4/site-packages/Trac-0.11.3-py2.4.egg/trac/util/html.py", line 16, in ? from genshi import Markup, escape, unescape File "/usr/lib/python2.4/site-packages/Genshi-0.5.1-py2.4-linux-i686.egg/genshi/__init__.py", line 32, in ? File "/usr/lib/python2.4/site-packages/Genshi-0.5.1-py2.4-linux-i686.egg/genshi/core.py", line 544, in ? File "/usr/lib/python2.4/site-packages/Genshi-0.5.1-py2.4-linux-i686.egg/genshi/_speedups.py", line 7, in ? File "/usr/lib/python2.4/site-packages/Genshi-0.5.1-py2.4-linux-i686.egg/genshi/_speedups.py", line 4, in __bootstrap__ File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 799, in resource_filename return get_provider(package_or_requirement).get_resource_filename( File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 1228, in get_resource_filename self._extract_resource(manager, self._eager_to_zip(name)) File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 1249, in _extract_resource real_path = manager.get_cache_path( File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 880, in get_cache_path self.extraction_error() File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 846, in extraction_error raise err pkg_resources.ExtractionError: Can't extract file(s) to egg cache The following error occurred while trying to extract file(s) to the Python egg cache: [Errno 13] Permission denied: '/var/www/.python-eggs' The Python egg cache directory is currently set to: /var/www/.python-eggs Perhaps your account does not have write access to this directory? You can change the cache directory by setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory. 554 5.3.0 unknown mailer error 1
The directory it was trying to set the cache did not exist so I created the directory and made it accessible to apache (777).
Now, I get a more obscure error
The original message was received at Wed, 6 May 2009 11:16:15 -0400 from localdev.localdomain [127.0.0.1] ----- The following addresses had permanent fatal errors ----- "|run_email2trac" (reason: 1) (expanded from: <tracproj@localdev.localdomain>) ----- Transcript of session follows ----- TD: saving email to /tmp/tmprw90Kc.email2trac 554 5.3.0 unknown mailer error 1
The files created are the msg.txt contents and have a chmod 777 and owner/group of apache.
What now?
comment:10 Changed 15 years ago by bas
The message is dumped in /tmp/tmprw90Kc.email2trac. Does email2trac creates the ticket properly:
email2trac < /tmp/tmprw90Kc.email2trac
Contains this mail attachments?
comment:11 Changed 15 years ago by hendra@…
I'm having the similar problem. I'm using CentOS 5.3 and I can run trac2email as well as run_trac2email from command line but not thru sendmail. I believe I've followed the instruction correctly, like building it with the correct user for trac (in my case apache)and mail (for sendmail), as well as the symlinks to /etc/smrsh etc. The run_email2trac returned error 1 to sendmail, whereas building with incorrect sendmail user will return error 254.
BTW, I have another server that runs CentOS 4 and the same code works fine there.
comment:12 Changed 15 years ago by hendra@…
after a bit of investigation, it turned out that this line
from trac import config as trac_config
needs to access /var/www/.python-eggs' even thou I've already set the python egg location in email2trac.conf to somewhere else, but parsing of the config file comes much later in the code.
So to avoid that "mailer error 1" you need to create /var/www/.python-eggs directory and use apache as the owner.
comment:13 Changed 15 years ago by bas
thanks a lot for a solution, maybe i must revert the code back to my own parser code instead of the trac one.
comment:14 Changed 14 years ago by bas
- Milestone set to Release 1.1.0
- Resolution set to duplicate
- Status changed from assigned to closed
- Version changed from 0.80 to trunk
The python egg cache problem is solved in another ticket, see #163. So this ticket will be closed as well
updated to correct version and set priority to blocker. i can't use email2trac at our site currently