With this script you can easy add a new mailbox.

You need to change "secret" into your Cyrus password. Don't forget to make the script executable and unreadable for others.

I give the script the name "mb" (mailbox). "mb jan" will add a mailbox "user.jan". When something goes wrong, you can see the output like "Mailbox already exists".

With regards, Paul ( paul@vandervlis.nl )


#!/usr/bin/expect -f

# execute command
spawn -noecho cyradm -u cyrus localhost

# log in
log_user 0
expect "*assword: " {send "secret\r"}

# make mailbox
expect "*> " {send "cm user.[lindex $argv 0] \n"}
log_user 1

# log out
expect "*> " {log_user 0; send "exit\n"}
expect eof




NOTE: remember, in order to use this script you need Expect in your system.
Topic revision: r6 - 07 Nov 2005 - 16:50:59 - TWikiGuest
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback