I have been searching the archive messages for a script to create
mailbox, but I have found it only in TCL.
Does anyone has the following script in Perl ?
Thanks a lot
Sandra
su first
cyradm -file adduser.tcl
if {$argc != 1} {
puts "usage: No user list specifiled."
exit 1
}
set infile [lindex $argv 0 ]
set quota 512
eval cyradm connect cyr_conn host
eval cyr_conn authenticate -pwcommand {{
set hostname "myhost"
set adminid "cyrus"
set adminpw "the password"
list $adminid $adminpw
}
}
if [catch {open $infile} IN] {
puts stderr "Can not open file $infile: $IN"
exit 1
}
while {[gets $IN mailbox] >= 0} {
exec /usr/sbin/adduser -batch $mailbox email $mailbox $mailbox
cyr_conn createmailbox user.$mailbox
cyr_conn setquota user.$mailbox storage $quota
cyr_conn createmailbox user.$mailbox.sentmail
}
close $IN