ma
changeset 6 c853cc971b78
parent 0 2a5f2464f8c6
child 8 5e9d46863588
equal deleted inserted replaced
5:6cb38b11a354 6:c853cc971b78
     3 # © 2005 Heiko Schlittermann <hs@schlittermann.de>
     3 # © 2005 Heiko Schlittermann <hs@schlittermann.de>
     4 # $URL$
     4 # $URL$
     5 # $Id$
     5 # $Id$
     6 #
     6 #
     7 use constant USAGE => <<'#';
     7 use constant USAGE => <<'#';
     8 Usage: !ME! account|alias --add|--list|--modify|--delete [options] [user|alias]
     8 Usage: !ME! account|alias --add|--list|--modify|--delete [options] [user|alias|shared mbox]
     9        * common options *
     9        * common options *
    10        --ldap_server=s	LDAP-Server	[!$Cf->ldap_server!]
    10        --ldap_server=s	LDAP-Server	[!$Cf->ldap_server!]
    11        --ldap_base=s	LDAP-Basis	[!$Cf->ldap_base!]
    11        --ldap_base=s	LDAP-Basis	[!$Cf->ldap_base!]
    12        --ldap_admin=s	LDAP BIND DN	[!$Cf->ldap_admin!]
    12        --ldap_admin=s	LDAP BIND DN	[!$Cf->ldap_admin!]
    13        --ldap_password=s		[!$Cf->ldap_password!]
    13        --ldap_password=s		[!$Cf->ldap_password!]
    27        --fullname=s	Real Name	[!$Cf->fullname!]
    27        --fullname=s	Real Name	[!$Cf->fullname!]
    28        --password=s	Passwort	[!$Cf->password!]
    28        --password=s	Passwort	[!$Cf->password!]
    29 
    29 
    30        * alias options *
    30        * alias options *
    31        --members=s	List of Members	[!$Cf->members!]
    31        --members=s	List of Members	[!$Cf->members!]
       
    32 
       
    33        * shared mailbox options *
       
    34        # --access=s	List of users having access 
       
    35 					[!$Cf->access!]
    32 
    36 
    33 Passwords for LDAP and IMAP can be read from environment LDAP_PASS resp. IMAP_PASS.
    37 Passwords for LDAP and IMAP can be read from environment LDAP_PASS resp. IMAP_PASS.
    34 Options can be read from config file named in $MA_CONF [!$ENV{MA_CONF}!].
    38 Options can be read from config file named in $MA_CONF [!$ENV{MA_CONF}!].
    35 
    39 
    36 $Id$
    40 $Id$
    87     address =>	    { ARGS => "=s", ALIAS => "primary" },
    91     address =>	    { ARGS => "=s", ALIAS => "primary" },
    88 
    92 
    89     # * alias *
    93     # * alias *
    90     members =>	    { ARGS => ":s" },
    94     members =>	    { ARGS => ":s" },
    91 
    95 
       
    96     # * shared *
       
    97     #access =>	    { ARGS => ":s" },
       
    98 
    92     # * ldap intern *
    99     # * ldap intern *
    93     ldap_ou_aliases =>	    { ARGS => "=s", DEFAULT => "ou=MailAliases" },
   100     ldap_ou_aliases =>	    { ARGS => "=s", DEFAULT => "ou=MailAliases" },
    94     ldap_ou_accounts =>	    { ARGS => "=s", DEFAULT => "ou=MailAccounts" },
   101     ldap_ou_accounts =>	    { ARGS => "=s", DEFAULT => "ou=MailAccounts" },
    95 
   102 
    96     ldap_oc_alias =>	    { ARGS => "=s", DEFAULT => "XXXmailAlias" },
   103     ldap_oc_alias =>	    { ARGS => "=s", DEFAULT => "XXXmailAlias" },
   131 	$Cf->ldap_admin($Cf->ldap_admin . "," . $Cf->ldap_base);
   138 	$Cf->ldap_admin($Cf->ldap_admin . "," . $Cf->ldap_base);
   132     }
   139     }
   133 
   140 
   134     print help() and exit 0 if $Cf->help;
   141     print help() and exit 0 if $Cf->help;
   135 
   142 
   136     @_ = grep { $_ =~ /^\Q$Module\E/ } qw/account alias/;
   143     @_ = grep { $_ =~ /^\Q$Module\E/ } qw/account alias shared/;
   137     die "Need module.  Try --help\n" if @_ == 0;
   144     die "Need module.  Try --help\n" if @_ == 0;
   138     die "Module ambigous. (@_)\n" if @_ > 1;
   145     die "Module ambigous. (@_)\n" if @_ > 1;
   139 
   146 
   140     if ($_[0] eq 'account') {
   147     if ($_[0] eq 'account') {
   141 	require account;
   148 	require account;
   143 	account::run();
   150 	account::run();
   144     } elsif ($_[0] eq 'alias') {
   151     } elsif ($_[0] eq 'alias') {
   145 	require alias;
   152 	require alias;
   146 	alias::import($Cf);
   153 	alias::import($Cf);
   147 	alias::run();
   154 	alias::run();
       
   155     } elsif ($_[0] eq 'shared') {
       
   156 	require shared;
       
   157 	shared::import($Cf);
       
   158 	shared::run();
   148     } else {
   159     } else {
   149 	die "Shit";
   160 	die "Shit";
   150     }
   161     }
   151 
   162 
   152 }
   163 }