Hi,

> is there way, to remove all quota from all accounts? I don't know why,
> but it seems, that quota works not correct. If i increase the 
> max quota
> from domain and user, after a while, tb says, out of quota :-/
> 
> cu denny

you could do that with an expect-script:

#!/usr/bin/expect

set force_conservative 1  ;# set to 1 to force conservative mode even if
              ;# script wasn't run conservatively originally
if {$force_conservative} {
    set send_slow {1 .1}
    proc send {ignore arg} {
        sleep .1
        exp_send -s -- $arg
    }
}

set username [lrange $argv 0 0]

set timeout 2

# Start the program.
spawn /usr/bin/cyradm --user cyrus --server localhost
match_max 100000

# Look for the Password: line and send the password.
expect -exact "IMAP Password: "
send -- "Password\r"
expect -exact "\r
localhost.localdomain> "

# Create the mailbox user.$username.
send -- "sq user/$username none"
expect -exact "sq user/$username none
localhost.localdomain> "

send -- "quit\r"
expect eof

######################################################

This script works with unixhierarchysep: yes and namespace "/"
Now when you execute "./scriptname root" it would remove quota
for user root. When you have a list of users you could do a:

#!/bin/bash

userlist=`cat userlist.txt`
for i in $userlist
do
 /path/to/script $i
done

Thats all ... 


Michael
_______________________________________________
This mailing list is hosted and supported
by bit-heads GmbH | http://www.bit-heads.ch

_______________________________________________
Web-cyradm mailing list
[email protected]
http://www.web-cyradm.org/mailman/listinfo/web-cyradm

Reply via email to