Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#8488 - [courier-mta] webmail - cron job failure

Attached to Project: Arch Linux
Opened by Gerhard Brauer (GerBra) - Friday, 02 November 2007, 18:07 GMT
Last edited by Tobias Kieslich (tobias) - Monday, 11 February 2008, 22:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tobias Kieslich (tobias)
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The courier-webmail job in /etc/cron.hourly should not use su.

su -c "/usr/share/sqwebmail/cleancache.pl" bin

First i think user(id) bin is not the proberly user for running cleancache.pl.
Then - cause bin has /bin/false as shell - the su comand failed an produce a cron mail like this:

You are required to change your password immediately (root enforced)
(current) UNIX password: Changing password for bin.
su: incorrect password

My solution ist to let root do this job:
/usr/share/sqwebmail/cleancache.pl

This task depends upon

Closed by  Tobias Kieslich (tobias)
Monday, 11 February 2008, 22:18 GMT
Reason for closing:  Fixed
Additional comments about closing:  removed the cronjob in testing
Comment by Tobias Kieslich (tobias) - Friday, 16 November 2007, 21:42 GMT
giving root simply access doing that might work, but without further thinking through it will open security issues. courier explicitly recommends bin, when you read their docs. I guess they have a reason why it shouldn't be root
Comment by Gerhard Brauer (GerBra) - Saturday, 17 November 2007, 09:34 GMT
Ok, root maybe only a temporary solution. But bin (in ArchLinux) doesn't work. You could test ist on command line with a root shell:
su -c "/usr/share/sqwebmail/cleancache.pl" bin
You a prompted to change your password. This is cause bin in /etc/shadow is created without the password expire fields (and not while the user has /bin/false as shell i mentioned first). It's the missing expire fields. Most other system user (daemon.mail,ftp) which are created during installation have the same behavior.

So we must either change bin user entry. Or took another user. I would prefer courier (uid 72). This user AFAIK
is created during courier installation and has correct shadow entries.

I'm not running the sqwebmail from courier, so i could'nt test it in real. But as i see the cleancache.pl
script would fail in any case, either started as bin or courier. The script does removing files in the dir /var/spool/courier/webmail-logincache. But this dir in my installation has ownership root.root and writeable
rights only for the owner. So neither bin nor courier could remove entires in this dir, even when the files or subdirs are writeable by one of them.

At my point i would say:
We must definitely change the cron job enry - under default Arch installation it couldn't work (shadow).
The only result is a failure mail to root.

I would prefer to run the perl script as courier:
su -c "/usr/share/sqwebmail/cleancache.pl" courier
This would not result in an error mail, but it still does nothing usefull (no write rights in affected dir)
So we should change ownership of /var/spool/courier/webmail-logincache to courier.courier.
If then sqwebmail works? I don't know, I'm not using it.
Some processes of courier-mta run under uid corier, some under root. When login-cache-files in above dir are
owned by root then the script maybe would fail although it started correctly.
Comment by Roman Kyrylych (Romashka) - Saturday, 09 February 2008, 19:43 GMT
@Tobias: so what is the decission here?
Comment by Tobias Kieslich (tobias) - Sunday, 10 February 2008, 07:40 GMT
courier is a complicated beast. The documentation is both excessive and confusing. I don't use webmail either and I would like to have some input from a person that actually uses it. But that is hart to find. I think the best intermediate solution is to not install the cron job at all, people using webmail shall do that manually, they also know the correct permissions this task requires in their particular configuration.
Comment by Tobias Kieslich (tobias) - Monday, 11 February 2008, 21:02 GMT
will be fixed in testing

Loading...