Dave Platt wrote:
I'm in the process of trying to bring up Courier, to replace an
old and much-patched qmail installation that I'm sorta tired of
trying to maintain.

Good, good.

I'm running Debian stable (Sarge), and have installed the courier-mta
and courier-maildrop packages from that distribution.  Both have a
version number of 0.47-somethingorother.  [I'm not clear on the
distinction between Debian's courier-maildrop package, and the
standalone maildrop package... I picked courier-maildrop on the
assumption that's a better choice for embedded use with courier :-]

Debian is using a rather old version. I'd recommend grabbing the latest 0.52.2 along with Courier-authlib 0.58 and building them for yourself. I believe your assumption about courier-maildrop is correct, the maildrop package would likely be if you were using Postfix as your MTA and maildrop for LDA or such...

Courier itself seems to be functional.  However, I cannot get the
maildrop-based rcptfilters to run.  During an SMTP session, the
filter script is never invoked at all.

What are the contents of /etc/courier/enablefiltering? If the file doesn't exist try:

echo "esmtp" > /etc/courier/enablefiltering

and restart courier.  Note that the path of your config files may vary.

I installed a wrapper script around the /usr/bin/maildrop executable
and logged its environment and invocation parameters.  They seem
to be reasonable - the -D uid/gid option gives the correct uid/gid
and the -M option gives the correct recipient rcptfilter name.

If I run /usr/bin/maildrop manually, with the specified options, it
exits immediately complaining about a permissions problem on the home
directory... a "world writeable" situation.

Well what are the rights?

I rechecked the permissions every way I could, and it didn't fix the
problem.

I then ran maildrop under "strace", and it appears that the error is
caused by a logic problem.  It looks as if maildrop:

[1] Finds its home directory, based on the uid it's running under.
    Since it's suid-root, it chooses "/root'.
[2] Switches to the uid/gid specified in the -D option.

[3] chdir's to the home directory found in [1] - to "/root".

[4] stats the directory.

[5] Performs several sanity checks.  I believe the one which fails
    is the "Is this directory owned by me?" test.  It fails because
    /root is owned by maildrop's original (root) uid, but it's
    running as the delivery user by now.
If I make /root inaccessible by non-root users, the chdir() fails and
maildrop quits.

If I remove maildir's suid permission, it (rightfully) rejects the
-D option as it cannot possibly change user-IDs.

I pulled down the source code to the Debian build, and the code flow
seems to correspond with what strace is showing me.  I don't currently
see how maildrop can function in -D mode at all.

So... what am I missing here?  Is this particular version of maildrop
broken to the extent that it can't run with the -D option, or is there
some (obvious or subtle) configuration error that I should be looking
for?
[Hoping very much that the problem is a me-stupid, and not a
 code-is-not-quite-right!]

Jay
--
Jay Lee
Network / Systems Administrator
Information Technology Dept.
Philadelphia Biblical University
--


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to