Home directory owned by wrong user

Norbert Harrer <[email protected]> Thu, 2 Nov 2017 00:09:50 +0100
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
Hi.

I am using courier and maildrop on Debian. I just upgraded to Debian 
Strech with following packages among others:

maildrop 2.8.4-2
courier-mta 0.76.3-5

After the upgrade, mails stopped being delivered all of a sudden. I am 
getting following errors in the mail.log:

Nov  1 23:34:21 stargate courierlocal: 
id=000000000078000B.59FA29EF.00007114,from=<[email protected]>,addr=<removed>: 
/usr/bin/maildrop: Home directory owned by wrong user.

In my setup the mail accounts are not real system users. They are 
authenticated via "authmysql". For each mail-user the home directory is 
defined like /var/courier/<user>. uid/gid are set to user daemon (uid=1, 
gid=1). All directories /var/courier/<user> are owned by daemon.

/etc/maildroprc contains only one line: DEFAULT="$HOME/Maildir"

The maildirs are therefore located at /var/courier/<user>/Maildir.

authtest for mail account nharrer:

 > authtest nharrer
Authentication succeeded.

      Authenticated: nharrer  (uid 1, gid 1)
     Home Directory: /var/courier/nharrer
            Maildir: (none)
              Quota: (none)
Encrypted Password: <removed>
Cleartext Password: (none)
            Options: (none)

I replaced /usr/bin/maildrop with a script which logs the current user 
and environment variables. maildrop is executed as user daemon with 
parameter '-d ""' and environment variable HOME is set to 
'/var/courier/nharrer'.

So I can reproduce the problem like that:

 > su daemon -s /bin/bash -c 'export HOME=/var/courier/nharrer; echo 
$HOME; maildrop -V5 -d ""' < somemail
/var/courier/nharrer
maildrop: Changing to /usr/sbin
/usr/bin/maildrop: Home directory owned by wrong user.

It seems like maildrop is ignoring $HOME and is only using what is set 
in /etc/passwd which is /usr/bin.

What could I do to fix the problem? The weird thing is that I am using 
this setup since many years.

Thanks and regards,
Norbert


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Courier-maildrop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop