procmail
[Top] [All Lists]

Re: MAILDIR and VIRTUAL

2000-11-23 01:26:40
Linux <gcocchi(_dot_)master(_at_)tiscalinet(_dot_)it> writes:
I give you all information about this problem....
This server now use Postfix as MTA, procmail as MDA, cucipop as POP3 and Cyrus
as IMAP and manage about 800 users and virtual domains (the users are all
authenticated via passwd/shadow file with PAM).
Since this server must manage over 5000 mailbox, i need to upgrade
authentication scheme and create my own passwd database for virtual users.
One real user should own all mailbox, or at least one real user for each 
domain.  
Procmail should delivery to /$VIRTUALHOME/$VIRTUALDOMAIN/$USER/Maildir/, where
$VIRTUALHOME is the base home directory of all the mailbox
$VIRTUALDOMAIN is the home directory that contains all mailbox for that domain.
$USER is the username.
Ex. /homemailbox/domain1.com/josh/Maildir/

Sorry for the delay in responding.

There are two ways to do this:

1) Write replacement cgetpwnam() and cgetpwuid() functions for the
   src/authenticate.c file with versions that look in your 'virtual
   user' passwd database to verify the presense of the user and choose
   what virtual domain they're in, returning the correct uid, gid,
   homedir, and mailbox name for that user.  If two or more virtual
   domains can contain the same username (i.e., bob(_at_)virt-domain1 and
   bob(_at_)virt-domain2), then you'll need to pass into procmail enough
   info to select a domain, probably by adding a new command line
   argument.

2) Invoke procmail in mailfilter mode (-m) instead of delivery mode
   (-d) and use one rcfile per virtual domain.  The rcfile would be
   located in /etc/procmailrcs/ and owned by the virtual domain's
   user.  That rcfile then checks the username passed to it and sets
   DEFAULT to point to the correct maildir.  You could even place all
   the 'real' rcfile code into one rcfile and then have each domain's
   rcfile in /etc/procmailrcs/ simply set the appropriate variables and
   then INCLUDERC the 'real' rcfile.


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Re: MAILDIR and VIRTUAL, Philip Guenther <=