[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Two-part question



> I hoped to solve this problem by using pam_mkhomedir.so as a session
> module for Courier, but it seems to be disregarding it.

IIRC, Courier tries to change into the home directory before calling the pam_mkhomedir.so module. (Or somesuch.)


> Does anyone have a suggestion for where I can go from here? It looks
> like I may be running out of options.

I looked at the Courier code, and decided to script home directory creation with a cron job instead of fixing the PAM routines.

Alternatively, you could wrap your local delivery agent with a script like this:

  #!/bin/ash
  if [ ! -e "$HOME" ]
  then
    # With an appropriate sudo configuration...
    sudo cp -r /etc/skel "$HOME"
    maildirmake "$HOME/Maildir"
  fi
  exec MyLDA "$@"
  # eof

If you use a lightweight shell like ash, then the overhead will be tolerable. YMMV.


Stephen Touset wrote:

I'm trying to set up a new email server for my company. We've got
significant LDAP infrastructure that we wish to use for this purpose,
but I'm having a few problems with the implementation.

First of which, users' home directories cannot be relied upon to exist.
I hoped to solve this problem by using pam_mkhomedir.so as a session
module for Courier, but it seems to be disregarding it. My intent was to
have the user's home directory created for them when they log in over
POP3 or IMAP.

Another problems stems from the fact that Postfix drops mail in
/var/spool/mail by default, and Courier expects them in the home
directory. I'd have no qualms with reconfiguring Postfix to drop mail in
the user's home directory in Maildir format, except once again I run
into the problem that users' home directories cannot be relied upon to
already exist.

My preferred solution would be to have Postfix drop new mails into
/var/spool/mail, as usual. Upon login, Courier creates the user's home
directory if need be. From there, it would feed out the user's emails
much like uw-imapd does: show messages from the mail directory in the
user's home directory, and if there are mails in the spool copy them
into the home directory mailbox as well.

I'd accept using uw-imapd, except that it doesn't seem to respect PAM's
session component either (with regard to creating the home directory via
pam_mkhomedir.so), although I've determined that it does follow PAM auth
and PAM account chains.

I've considered just having all emails stored permanently in
/var/spool/mail, under a maildir like Courier expects, but then I run
into the problem that Courier looks at the user's home directory, which
is specified in our LDAP database. We cannot remap every user's home
directory to /var/spool/mail/username.

Does anyone have a suggestion for where I can go from here? It looks
like I may be running out of options.




Reply to: