Re: Home directory owned by wrong user

Sam Varshavchik <[email protected]> Thu, 02 Nov 2017 07:08:08 -0400
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
Norbert Harrer writes:

> « HTML content follows »
>
> Hi Sam.
>
> Thank you for your reply. And yes, you are right there has been a change in  
> Debian. But it seems like the the other way around. Package courier-maildrop  
> was replaced by the regular maildrop. I should have mentioned that. This was  
> the message regarding it during upgrade:  
> <URL:https://i.imgur.com/NZ3BsJy.png>https://i.imgur.com/NZ3BsJy.png

That doesn't look right.

> I followed those instructions (adding parameter -d "" and enabling  
> DEFAULT="$HOME/Maildir" in /etc/maildroprc). But even if I take those changes  
> back I have the same problem.

If that package is the non-Courier version of maildrop, this cannot work.

> Calling maildrop without -d gives the same error:
>
> > su daemon -s /bin/bash -c 'export HOME=/var/courier/nharrer; echo  
> HOME=$HOME; maildrop -V5' < mail
> HOME=/var/courier/nharrer
> maildrop: Changing to /usr/sbin
> maildrop: Home directory owned by wrong user.

Correct. Only the Courier version of maildrop will trust the contents of  
$HOME. Anything can set $HOME in the environment, so it cannot be used to  
determine the destination account's home directory. The non-Courier version  
of maildrop uses its userid to look up the purported account's home  
directory, and since it's /usr/sbin, and not owned by daemon, it bails out.

The standalone version of maildrop doesn't know anything about Courier's  
virtual accounts. It's a generic, non mail-server specific, mail delivery  
agent.

Now, if it has been compiled with courier-authlib separately, the -d option  
can be used to look up the same virtual account that Courier used to deliver  
the mail. But the same mailbox name must be passed to -d, not an empty  
string, and maildrop needs to be invoked as root so that it can drop root  
privileges and run under the correct virtual userid.

------------------------------------------------------------------------------
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
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAABAgAGBQJZ+vyYAAoJEGs6Yr4nnb8lLrsQAIwJ0AcBOcyNwxIAoC/oFgwP
3Jg/GpPgeOM0vI8fAJZaoNlkEVz6nmj/7EBrKCuoZ3jI4BNkPvpADl5+pnKfF+BR
+T/wYtFFsuYl00xamJg4qFDr9oaSV3n97ZvHc+tlwwcQnRyBD5Ts3sEdv3Vfx1A3
t0BuqL/Q1zD91mcl5Ty6+7nNSbnpNwUPvl1sxNvkJNg1u3041i9bMY0KOo1RGY8t
+Tsp+fpSW9oadbPa4YbPbmey+FB8a9hBv6059TB8alyUNtouQN6K82ye4YVlYu3b
9Zasf9Vj3neLYu1viSI2SRSONF5xyRaCNBp51iV9RZbdwJh6+CHVMWgKiTF4u4YO
7t7JqIA6U2PHXTYHBOJhWBzCyUcbHNpLK570vpqPMj3CrR8WK8VYjwg8NsUc3kcj
o+zIUOkoi6SsC1jvyNZlF51FtIWy0iNIJveZPZBju0YcIkfxlZzOjen1WhUOBc4W
Xlo/gmR9ZkVx/iQ+69GteKlsZgl1Rd/wGq4CipTPdElCrdmI5FXRbSEwBhavbF2T
x58EErhoBIlnsAm0lqCHVoiVa1HWl5lgjbD9hC6ZNg+gGrlCN/Ji38eeyxxoq+hG
byT5Qc7W6wC+AD1uxO6B6qWIVWQq0OC7UzX95Pp4k1Hn5d6mQUEYkFV1uIIrAih9
JrG91C0eAyixm7KcvJ84
=Ls5+
-----END PGP SIGNATURE-----