Modify

Opened 9 years ago

Closed 9 years ago

#263 closed setup (fixed)

fetchmail and email2trac: run email2trac as www-data

Reported by: variofox@… Owned by: bas
Priority: trivial Milestone:
Component: email2trac Version: 2.1.0
Keywords: attachment permission fetchmail email2trac Cc:

Description

I am running fetchmail on Ubuntu 8.04 with the following /etc/fetchmailrc

server mail.zzz.yy
proto pop3
user trac@somewhere.yy
pass mypassword
is www-data here
mda "email2trac"

Therefore, email2trac runs as user fetchmail.

Apache runs as www-data, the trac-directory is owend by www-data:wwwdata, ug+rwx.

As I expected, I get The user fetchmail requires read _and_ write permissions to the database file /yyy/trac/test/db/trac.db and the directory it is located in.

If I add the fetchmail-user to the www-data secondary group, tickets are created nicely. However, in the attachments directory, the subdirectories are owned by fetchmail:nogroup and as a result, I get Attachment ... not found errors.

Of course, I can "chown www-data -R /yyy/trac/" and then it works.

run_email2trac fails with an fetchmail: Query status=6 (IOERR) and is set to ---s--x--x 1 root root

How can I make email2trac run as www-data?

This is my /etc/email2trac.conf

[DEFAULT]
project: /yyy/trac/test
debug: 1
umask: 022
spam_level: 5
reply_all : 0
mailto_link: 0
umask: 022
email_header: 0
trac_version: 0.12
alternate_notify_template :
alternate_notify_template_update :
drop_spam : 0
verbatim_format: 1
strip_signature: 1
email_quote: >
strip_quotes: 0
ignore_trac_user_settings: 0
black_list: MAILER-DAEMON@
drop_alternative_html_version: 1
log_file: /tmp/email2trac.log
log_level: info
mta_user : fetchmail
trac_user : www-data

[test]
project: /yyy/trac/test
spam_level: 1

Attachments (0)

Change History (5)

comment:1 Changed 9 years ago by bas

  • Status changed from new to assigned

You must use run_email2trac this program switches user from fetchmail to www-data. See:

comment:2 Changed 9 years ago by variofox@…

Yes, I thought so and tried that, but it fails and syslog says fetchmail[...]: Query status=6 (IOERR) run_email2trac is set to ---s--x--x 1 root root

Thank you for the suggestion...

comment:3 Changed 9 years ago by bas

I am not a fetchmail expert. Did you specify the whole path for run_email2trac and is email2trac installed where run_email2trac expects to find it, eg:

  • ./configure
  • make install

Then all utilities are installed in /usr/local. It looks like it does not find run_email2trac or run_email2trac can not find email2trac.

comment:4 Changed 9 years ago by variofox@…

That (almost) did it. I ran

./configure --with-mta_user=fetchmail --with-trac_user=www-data
make install

My previous experiments ware based on the Debian Package Manager example which placed the files in /usr/bin/ and /etc/ respectively. https://subtrac.sara.nl/oss/email2trac/wiki/Email2tracInstallation

Now, I just had to set the egg-cache (which for some reason was /var/lib/fetchmail/.python-eggs) to something useful (/tmp) in email2trac.conf (which of course is located in /usr/local/etc/, not /etc/).

In the Ubuntu world, things apperently are located in /usr/bin and that is where the deb-package places it. email2trac is the only file in /usr/local/bin.

Could you change the run_email2trac so that it looks for email2trac in its own directory (whichever that may be)? I am no linux expert, but it would seem to make sense to me.

Or could we change the Debian Package Manager example to put the files in the right place?

But it is working for me now, may thanks. I am looking forward to "really" working with trac and email2trac.

comment:5 Changed 9 years ago by bas

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

Good to hear that everything is working for you

In the source tree there is a debian directory included. This is the one we use for our own installation and installs everything under /etc and /usr/bin. The debian build is default for postfix. So you have to adjust the configure command and then build the debian package.

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.