Modify

Opened 12 years ago

Closed 10 years ago

#279 closed setup (wontfix)

email2trac 2.4.5 with sendmail 8.14.4-8 and 0.12.1-4 on CentOS 6.0

Reported by: anonymous Owned by: bas
Priority: major Milestone:
Component: run_emailtrac Version: 2.4.5
Keywords: Cc: andreas.nitsche@…

Description (last modified by bas)

Hello,

I'd like to use email2trac with my trac installation but sendmail gives only this error:

to="|run_email2trac", ctladdr=<mail@example.com> (8/0), delay=00:00:01, xdelay=00:00:00, mailer=prog, pri=30840, dsn=5.3.0, stat=unknown mailer error 254

I tried to turn off selinux. The message does not change.

I had a look at the source. Is the problem that caller is not the same user as mta is running?

  if ( caller !=  MTA->pw_uid ) {    if ( DEBUG ) printf("Invalid caller UID (%d)\n",caller);
    return -2;     /* 254 : Invalid caller */
  }

cheers Andi

Attachments (0)

Change History (6)

comment:1 Changed 12 years ago by anonymous

I'm getting a bit further, there are new error. ;)

I built my email2trac with these options

./configure --with-mta_user=mail --with-trac_user=apache
make
make install

The files email2trac and run_email2trac are placed in /usr/local/bin/. From further installations I rechecked the correct path:

# which run_email2trac 
/usr/bin/run_email2trac

/etc/aliases was configured like this:

trac:           "|run_email2trac --project=myproject --ticket_prefix=ideas"

When sending a Mail to user trac maillog says the following:

Nov 15 08:40:17 myhost sendmail[27358]: pAF7eDcq027357: to="|run_email2trac --project=myproject --ticket_prefix=ideas", ctladdr=<ideas@example.com> (8/0), delay=00:00:04, xdelay=00:00:04, mailer=prog, pri=30837, dsn=2.0.0, stat=Sent

before that the MTA user was wrong therefore I got this message:

Nov 14 20:37:22 myhost sendmail[13288]: pAEJbMXc013286: to="|run_email2trac", ctladdr=<ideas@example.com> (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=30975, dsn=5.3.0, stat=unknown mailer error 254

This looks really good since I changed the MTA user to "mail".

When executing run_email2trac from console the ticket gets created. Before testing this command I copied the msg.txt from the source code directory to /tmp.

su - mail -c "run_email2trac --project=myroject < /tmp/msg.txt" --shell=/bin/bash

When sending a mail I get this error in syslog:

Nov 15 08:40:17 myhost email2trac myproject: trac error: [Errno 13] Permission denied: u'/opt/myproject/VERSION'

Can somebody tell me what's wrong here? The whole directory belongs to apache at the moment, here an example:

-rw-r--r--. 1 apache apache   27 25. Okt 23:43 VERSION

Any idea would be great!

comment:2 Changed 12 years ago by anonymous

I got it run by setup SELinux properly.

grep email2trac /var/log/audit.log | audit2allow -m email2trac

shows which changes will be made.

grep email2trac /var/log/audit.log | audit2allow -M email2trac

This command will create a module which can be loaded by

semodule -i email2trac.pp

cheers Andi

comment:3 Changed 12 years ago by bas

  • Status changed from new to assigned

I am currently in Seattle to attend Sc11 conference. THE question is what MTA do you use and you van easily check the uid of your MTA with a simple shell script:

#!/bin/sh

id >  /var/tmp/mail.id

Use this as run_emailtrac script

comment:4 Changed 12 years ago by anonymous

SELinux was turned off. When turning SELinux on email2trac does not work anymore. :(

Nov 20 19:04:52 host <15>email2trac project: Found trac version: 0.12
Nov 20 19:04:53 host <15>email2trac project: Loading environment /opt/project
Nov 20 19:04:53 host <11>email2trac project: trac error: [Errno 13] Permission denied: u'/opt/project/VERSION'

In audit.log I do not get any errors.

When executing from console everything works fine.

# su - mail -c "run_email2trac --project=inbaz20 < /tmp/msg.txt" --shell=/bin/bash

Can somebody tell me what's wrong?

cheers Andi

comment:5 Changed 12 years ago by bas

Sorry Andi, i am not familiar with SELinux. Just a remark, Maybe you must add a rule for he mail users to allow an suid program.

comment:6 Changed 10 years ago by bas

  • Description modified (diff)
  • Resolution set to wontfix
  • Status changed from assigned to closed

No answer and i do not have clue what is wrong.

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.