to den 10.08.2006 Klokka 00:49 (+0300) skreiv Reinis Rozitis:

> probably this question has been asked few times in the past still I couldnt 
> find any real and neat solution to this.

This posting is for the maildrop list, not the imap list; however ...

> Is it possible to automatically create maildirs when using maildrop as 
> transport (in Postfix) without manually doing the maildirmake on mailserver
> (as 'virtual' does)?

Yes, we do that at this site.

> I've seen some posts which offer to put something like this in maildroprc
> 
> `test -e $HOME`
>  if ($RETURNCODE != 0)
>  {
>         `mkdir -p $HOME`
>         `rmdir $HOME`
>         `maildirmake $HOME`

What on earth is this code supposed to do, and why? It wouldn't do
whatever the author intends.

>  }
> 
> still it seems that it's not executed before the users Maildir check.

It's not possible for maildrop (certainly not for IMAP) to make a user's
or virtual user's $HOME directory. That has to exist first, mkdir or
siblings in one form or another is used for this - both for shell users
and virtual users. maildirmake can not be used for this. maildirmake
makes structural Maildirs and populates them with certain info (files
and a directory) necessary for Courier IMAP.

It is possible for maildrop to make $HOME/Mailbox - and subfolders -
using maildirmake, if they don't exist. 

> I've also found http://www.commedia.it/ccontavalli/ but I don't like the 
> idea about patching courier-imap itself and also the maildir is created 
> after first login and not on when first mail arrives.

Use pam_mkhomedir for shell users or a script for virtual or Samba users
to create $HOME, then use maildirmake:

`test -d $HOME/Maildir/`
  if( $RETURNCODE == 1 )
  {
   `/usr/bin/maildirmake $HOME/Maildir/`
  }

or, if $HOME is set to /home/vmail/$OU/$UID (in authldaprc or whatever):

OU=`echo $HOME | cut -d/ -f4`
UID=`echo $HOME | cut -d/ -f5`
VHOME="/home/vmail/$OU/$UID"

`test -d $VHOME/Maildir/`
  if( $RETURNCODE == 1 )
  {
   `/usr/bin/maildirmake $VHOME/Maildir/`
  }

> Any ideas or other solutions / patches for maildrop?

No patches are necessary. maildrop can do a lot bore besides, the
maildrop list is the correct place for this.

--Tonni

-- 
Tony Earnshaw
tonni at barlaeus.nl


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to