Modify

Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#220 closed defect (fixed)

ImportError: No module named Notify

Reported by: tacker Owned by: bas
Priority: normal Component: EmailtoTracScript
Severity: normal Keywords:
Cc: jrh18@… Trac Release: 0.10

Description

echo test | /usr/bin/email2trac
Traceback (most recent call last):
  File "/usr/bin/email2trac", line 632, in ?
    from trac.Notify import TicketNotifyEmail
ImportError: No module named Notify
# ./configure --with-mta_user=nobody --with-trac_user=apache --prefix=/usr ----sysconfdir=/etc
configure: error: unrecognized option: ----sysconfdir=/etc
Try `./configure --help' for more information.
nuphp5 trunk # ./configure --with-mta_user=nobody --with-trac_user=apache --prefix=/usr --sysconfdir=/etc
checking for python... /usr/bin/python
checking for python version... 2.4
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.4/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.4/site-packages
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating email2trac.py
config.status: creating delete_spam.py

# make
gcc -DMTA_USER=\"nobody\" -DTRAC_USER=\"apache\" -DTRAC_SCRIPT_NAME=\"email2trac\" -DTRAC_SCRIPT_PATH=\"/usr/bin\" -DDEBUG=0 -o run_email2trac run_email2trac.c

# make install
install -d /usr/bin
install --mode=4111 --owner=root run_email2trac /usr/bin
for script in delete_spam.py email2trac.py ; \
do \
          name=`basename $script '.py'` ;\
  install --mode=755 --owner=root $script  /usr/bin/$name ;\
done

Attachments (1)

email2trac.py.in.0.10-patch (2.7 KB) - added by bas 8 years ago.
Patch for 0.10 version

Download all attachments as: .zip

Change History (23)

comment:1 Changed 8 years ago by bas

  • Status changed from new to assigned

This error is from svn trunk version. The notify module is changed. Tacker has emailed me a patch. When i have applied the patch i will close the ticket.

This change cause the problem, thanks to Tacker:

comment:2 Changed 8 years ago by greg.deakyne@…

  • Trac Release set to 0.8

Any patch yet?

comment:3 Changed 8 years ago by anonymous

  • Trac Release changed from 0.8 to 0.10

It does not work for version 0.10!

comment:4 Changed 8 years ago by anonymous

OK, I just setup a blank trac env that is 0.9.3 and I can't get it to work either. It's on solaris 9 and it is showing an error in the syslog: Any help would be great, I like the idea of this functionality.

Apr 4 16:06:56 frigg sendmail[7089]: [ID 801593 mail.info] k34L6ufE007089: from =<Greg.DeaKyne@…>, size=1484, class=0, nrcpts=1, msgid=<17A6CC0E704B A04AAD16FA0BBBED7409DFB395@…>, proto=ESMTP, daemon=MTA-v 4, relay=peach.etap.etapestry.com [192.168.0.36]

Apr 4 16:06:56 frigg sendmail[7090]: [ID 801593 mail.info] k34L6ufE007089: to=| /usr/local/bin/run_email2trac, ctladdr=<tracproj@…> (1/0), del ay=00:00:00, xdelay=00:00:00, mailer=prog, pri=31709, dsn=5.3.0, stat=unknown ma iler error 254

Apr 4 16:06:56 frigg sendmail[7090]: [ID 801593 mail.info] k34L6ufE007089: k34L
6ufE007090: DSN: unknown mailer error 254

Apr 4 16:06:57 frigg sendmail[7090]: [ID 801593 mail.info] k34L6ufE007090: to=< Greg.DeaKyne@…>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri= 32733, relay=bowser.etap.etapestry.com. [192.168.1.27], dsn=2.0.0, stat=Sent ( < 200604042106.k34L6ufE007090@…> Queued mail for delivery)

comment:5 Changed 8 years ago by greg.deakyne@…

I can setup a new ticket, if that would help. Last comment was mine.

Changed 8 years ago by bas

Patch for 0.10 version

comment:6 Changed 8 years ago by bas

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

Fixed in new version and trunk

comment:7 Changed 7 years ago by anonymous

  • Cc ryan@… added

Am I patching this correctly?

[root@xylose /tmp/email2trac-0.9]# patch -f < email2trac.py.in.0.10-patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:


|Index: email2trac.py.in
|===================================================================

email2trac.py.in (Revision 492)

|+++ email2trac.py.in (Arbeitskopie)


Patching file email2trac.py.in using Plan A...
Hunk #1 failed at 99.
Hunk #2 failed at 250.
Hunk #3 failed at 311.
Hunk #4 failed at 357.
patch: malformed patch at line 66: @@ -625,10 +627,19 @@
[root@xylose /tmp/email2trac-0.9]#

comment:8 Changed 7 years ago by ryan@…

I did try the previous post without the -f option first.

comment:9 Changed 7 years ago by anonymous

This was a pacth for an old version of email2trac. I newer versions this patch is included and no need to install it. At our site we have trac version 0.10.3 and email2trac version: 0.9 and everything is working.

Did you edit /etc/email2trac.conf and set trac_version: 0.10?

Else you trac install is wrong.

comment:10 Changed 7 years ago by jrh18@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

I am still recieving this error as above. I have trac 0.10.4 and email2trac 0.9.5 my config is
[DEFAULT]
project: /storage/trac/cdc/
debug: 2
umask: 022
spam_level: 4
reply_all : 1
mailto_link: 0
umask: 022
email_comment: >
email_header: 0
trac_version: 0.10
enable_syslog : 1
alternate_notify_template :
drop_spam : 0
verbatim_format: 1
strip_signature: 1
use_textwrap: 70

[cdc]
project: /storage/trac/cdc/
spam_level: 1

my alias is:
tracproj: "|run_email2trac"

this is my /etc/smrsh:
lrwxrwxrwx 1 root root 19 May 2 12:18 email2trac -> /usr/bin/email2trac
lrwxrwxrwx 1 root root 23 May 1 22:16 run_email2trac -> /usr/bin/run_email2trac

my trac.ini is:

-*- coding: utf-8 -*-

[account-manager]
password_file = /storage/trac/trac.htpasswd
password_store = HtPasswdStore

[attachment]
max_size = 262144
render_unsafe_content = false

[browser]
downloadable_paths = /trunk, /branches/*, /tags/*
hide_properties = svk:merge

[changeset]
max_diff_bytes = 10000000
max_diff_files = 0
wiki_format_messages = true

[components]
acct_mgr.api.accountmanager = enabled
acct_mgr.htfile.abstractpasswordfilestore = enabled
acct_mgr.htfile.htdigeststore = enabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
acct_mgr.web_ui.registrationmodule = enabled

[header_logo]
alt =
height = -1
link = http://edtech.humboldt.edu/
src = common/trac_banner.png
width = -1

[logging]
log_file = trac.log
log_level = DEBUG
log_type = syslog

[mimeviewer]
enscript_modes = text/x-dylan:dylan:4
enscript_path = enscript
max_preview_size = 262144
mime_map = text/x-dylan:dylan,text/x-idl:ice,text/x-ada:ads:adb
php_path = php
silvercity_modes =
tab_width = 8

[notification]
always_notify_owner = true
always_notify_reporter = false
always_notify_updater = true
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =edtech.humboldt.edu
smtp_enabled = true
smtp_from = trac@…
smtp_password =
smtp_port = 25
smtp_replyto = trac@…
smtp_server = localhost
smtp_user =
use_public_cc = false
use_short_addr = false
use_tls = false

[project]
descr = My example project
footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>
icon = common/trac.ico
name = Courseware Development
url = http://edtech.humboldt.edu/cgi-bin/trac.cgi

[search]
min_query_length = 3

[ticket]
default_component = Moodle Fall 2007
default_milestone = Moodle Rollout Fall 2007
default_priority = major
default_type = Bug
default_version =
restrict_owner = true

[timeline]
changeset_long_messages = false
changeset_show_files = 0
default_daysback = 30
ticket_show_details = false

[trac]
authz_file =
authz_module_name =
base_url =
check_auth_ip = true
database = sqlite:db/trac.db
default_charset = iso-8859-15
default_handler = WikiModule
htdocs_location =
ignore_auth_case = false
mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
metanav = login,logout,settings,help,about
permission_store = DefaultPermissionStore
repository_dir = /storage/svn
repository_type = svn
templates_dir = /usr/share/trac/templates

[wiki]
ignore_missing_pages = false
split_page_names = false

my config to install email2trac was:
./configure --prefix=/usr --with-mta_user=root --with-trac_user=root

I am running fedora core 6.

My sendmail log is:
May 2 17:06:18 edtech sendmail[11115]: l4306Iot011115: 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 (l4306IHF011116 Message accepted for delivery)
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: SYSERR(root): putbody: write error: Broken pipe
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 0: fl=0x8000, mode=20666: CHR: dev=0/15, ino=1909, nlink=1, u/gid=0/0, size=0
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 1: fl=0x8001, mode=20666: CHR: dev=0/15, ino=1909, nlink=1, u/gid=0/0, size=0
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 2: fl=0x8001, mode=20666: CHR: dev=0/15, ino=1909, nlink=1, u/gid=0/0, size=0
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 3: fl=0x2, mode=140777: SOCK localhost->[[UNIX: /dev/log]]
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 5: fl=0x8000, mode=100600: dev=3/1, ino=13816435, nlink=1, u/gid=0/51, size=1874
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 6: fl=0x8000, mode=100640: dev=3/1, ino=15714287, nlink=1, u/gid=0/0, size=12288
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 7: fl=0x8000, mode=100640: dev=3/1, ino=15714287, nlink=1, u/gid=0/0, size=12288
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 8: fl=0x8000, mode=100640: dev=3/1, ino=15714286, nlink=1, u/gid=0/51, size=12288
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 9: fl=0x8000, mode=100640: dev=3/1, ino=15714286, nlink=1, u/gid=0/51, size=12288
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 10: fl=0x8001, mode=100600: dev=3/1, ino=13816437, nlink=1, u/gid=0/51, size=865
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 11: fl=0x1, mode=10600: FIFO: dev=0/5, ino=16829759, nlink=1, u/gid=0/51, size=0
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: 12: fl=0x0, mode=10600: FIFO: dev=0/5, ino=16829760, nlink=1, u/gid=0/51, size=0
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: MCI@0x0: NULL
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: MCI@0x0: NULL
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: to="|run_email2trac", ctladdr=<tracproj@…> (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=32421, dsn=5.3.0, stat=unknown mailer error 254
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: l4306IHF011117: DSN: unknown mailer error 254
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011117: to=<root@edtech.humboldt.edu>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=33445, dsn=2.0.0, stat=Sent

any help would be appreciateed i have been banging my head aginst this for a day now.

comment:11 Changed 7 years ago by bas

Can run the test, eg:

If this succeed then there must be something wrong in the sendmail/run_email2trac setup.

comment:12 Changed 7 years ago by jrh18@…

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

I can run the test with email2trac and cat msg.txt | run_email2trac as root.

Is there a forum or discussion somewhere I can post for assitance on how to correct the sendmail to run_email2trac? I have followed everythign I could find here and in the installation direction and nothing is fixing the problem I get.

comment:13 Changed 7 years ago by jrh18@…

When i modify the sendmail aliases to use
tracproj: " | run_email2trac"

I get the error in my above statement without the bad pipe section so like:

May 2 17:06:18 edtech sendmail[11115]: l4306Iot011115: 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 (l4306IHF011116 Message accepted for delivery)
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: to="|run_email2trac", ctladdr≤tracproj@…> (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=32421, dsn=5.3.0, stat=unknown mailer error 254
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011116: l4306IHF011117: DSN: unknown mailer error 254
May 2 17:06:18 edtech sendmail[11117]: l4306IHF011117: to≤root@edtech.humboldt.edu>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=33445, dsn=2.0.0, stat=Sent

comment:14 Changed 7 years ago by bas

  • Cc jrh18@… added; ryan@… removed

I have reread your email and you do not need run_email2trac:

my config to install email2trac was: ./configure —prefix=/usr —with-mta_user=root —with-trac_user=root

You run your MTA (sendmail) under userid root and the same is true for the trac_user. The programm is only needed if your MTA and TRAC uses aother userid then root. For our siite the mta-user is postfix and trac-user is www-data.

comment:15 Changed 7 years ago by jrh18@…

Technically our trac_user I belevie is apache. I assume trac_user is the same as what the web server starts up as. Sendmail is running as root. My assumption was that root would have access to place files in the web directories so I compiled with root and root to check that my errors weren't a problem with the user's permissions.

I also did a check with root and root changing the alias to "|email2trac" and I received no errors in the sendmail log but no ticket was created either.

when configured with the mta_user being root and the trac_user being apache this is the errors in the maillog, alias is still "|run_email2trac"
May 4 07:53:00 edtech sendmail[26175]: l44Er015026175: from=root, size=1888, class=0, nrcpts=1, msgid=<200705041453.l44Er015026175@…>, relay=root@localhost

May 4 07:53:00 edtech sendmail[26176]: l44Er0kQ026176: from=<root@edtech.humboldt.edu>, size=2188, class=0, nrcpts=1, msgid=<200705041453.l44Er015026175@…>, proto=ESMTP, daemon=MTA, relay=edtech.humboldt.edu [127.0.0.1]

May 4 07:53:00 edtech sendmail[26175]: l44Er015026175: 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 (l44Er0kQ026176 Message accepted for delivery)

May 4 07:53:00 edtech sendmail[26177]: l44Er0kQ026176: to="|run_email2trac", ctladdr=<tracproj@…> (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=32421, dsn=5.3.0, stat=unknown mailer error 254

May 4 07:53:00 edtech sendmail[26177]: l44Er0kQ026176: l44Er0kQ026177: DSN: unknown mailer error 254

May 4 07:53:00 edtech sendmail[26177]: l44Er0kQ026177: to=<root@edtech.humboldt.edu>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=33445, dsn=2.0.0, stat=Sent

comment:16 Changed 7 years ago by anonymous

  • Cc ecommerce@… added

comment:17 Changed 7 years ago by anonymous

Are there any errors in the syslog?

I do not know much about sendmail, can you setup other aliases that run a program?

comment:18 Changed 7 years ago by jrh18@…

I can get /usr/bin/procmail root to work. I did an ln -s /usr/bin/procmail in /etc/smrsh and it executed just fine.

There is nothing in syslog about sendmail it is all sshd stuff.

comment:19 Changed 7 years ago by anonymous

  • Cc ecommerce@… removed

comment:20 Changed 7 years ago by anonymous

Are all scripts executed in a chrooted environment with this kind of setup?

comment:21 Changed 7 years ago by anonymous

I don't know. I symlinked the programs because that is what the note on the documentation about mail setup stated to do with sendmail.

comment:22 Changed 7 years ago by bas

The note on the wiki is made by someone else. I do not know much about the sendmail setup. At our site we use postfix. So maybe we can find some info about this issue in the sendmail docs or via google.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from bas. Next status will be 'closed'.
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.