Re: Batch mailbox creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This isn't thoroughly tested or anything, but you could use something like the following to generate a "command list" to be fed to cyradm, no?

It doesn't check for things like the user already having a Spam mailboox, but... that wouldn't be hard to add. Is "-c" appropriate to prevent mailbox deletions by the user?

--- snip ~/mkmailboxes ---
#!/bin/sh
pushd /var/spool/imap/domain >/dev/nul
for domLtr in *; do
  pushd $domLtr >/dev/nul
  for domain in *; do
     pushd $domain >/dev/nul

     for usrltr in *; do
        pushd $usrltr/user >/dev/nul
        for email in *; do
           echo cm user.$email@$domain.Spam
           echo sam user.$email@$domain.Spam cyrus a
           echo sam user.$email@$domain.Spam anyone p
           echo sam user.$email@$domain.Spam $email@$domain -c
           echo -n "\n"
        done
        popd >/dev/nul
     done

     popd >/dev/nul
  done
  popd >/dev/nul
done
popd >/dev/nul
--- Snip ---


----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux