Since I am using dovecot I do not have courier installed, but Courier had a very handy tool for making maildir folders called `maildirmake` which I used in some automated backup scripts. How do I duplicate maildirmake in dovecot? for example: #!/bin/bash # v1.2a Testing for new dovecot install # Archive mail from folders without [0-9]{4} Maildirs # after they are 21 days old to a yearly folder MDIR="$HOME/Maildir" MDM="/usr/local/bin/maildirmake" YEAR=`/usr/local/bin/gdate -d "last month" '+%Y'` echo "The Year is $YEAR..." OIFS=$IFS IFS=" " for I in `find $MDIR -maxdepth 1 -mindepth 1 -type d| egrep -v "[0-9][0-9][0-9][0-9]"`; do MYDIR="${I}" TBASE=`basename $MYDIR` # if [ ! $TBASE == "Maildir" ]; then TDIR=`dirname $MYDIR` TARGET="${TDIR}/.zz${TBASE}.${YEAR}" # echo "$MYDIR $TARGET" if [ -d "$MYDIR/cur" ]; then echo -n "Processing ${MYDIR} => ${TARGET}..." if [ ! -d "${TARGET}" ]; then echo "" echo -n "WARNING ${TARGET} does not exist. invoking $MDM ${TARGET}..." $MDM "${TARGET}" fi if [ -d "${TARGET}" ]; then # echo "$TARGET does exist, moving files" find ${MYDIR}/cur -type f -ctime +21 -exec mv {} ${TARGET}/cur/ \; echo "done." else echo "$TARGET does not exist" fi fi # fi done IFS=$OIFS -- Forever was over. All the sands had fallen. The great race between entropy and energy had been run, and the favourite had been the winner after all. Perhaps he ought to sharpen the blade again? No. Not much point, really.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 15 Aug 2013, LuKreme wrote:> Since I am using dovecot I do not have courier installed, but Courier > had a very handy tool for making maildir folders called `maildirmake` > which I used in some automated backup scripts. How do I duplicate > maildirmake in dovecot?To replace the inner find, you could look at doveadm move -u <user> savedbefore ... To replace maildirmake -f, look at doveadm mailbox create -u <user> But you seem to create a new Maildir with each invokation of $MDM (no -f option). IMHO it seems to be easier to make a small script, that creates new/cur/tmp and, if not INBOX, touches maildirfolder. Kind regards, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEVAwUBUg3DSV3r2wJMiz2NAQJWqQf6AhVbFjyIT5wMwdT6liGI/5NI1K81c5qM N7p0kfvivCgaDM0is8DiL+eKINsL76Bk07iJfAMiRuNuIb2cAcOgJwNCEIjVtwEN 7bSvX66NmO0Fzjob5SmbBe6LNtMylpEMa7vPdQGeuN+Jm+Btx7btsuAN+wvekJ+2 NwhR+rxt0fm6wT8+jtuUkyg05FzneL5pUEt/+P+KjBdNeJ82tCwD7AFyrWICKajT br6vTS2AA9/jqh9P1dHtYg6ztkaRtqGbX5YKewmaqJQ3eu+NUo1wO0sxaRtaKdfj /hjiOs9KPpmq8iRYiKPMiihOXjoI2wVGI4HuG7j0Wv93kBhCkfFgsg==TLXx -----END PGP SIGNATURE-----
On 08/16/2013 06:53 AM, LuKreme wrote:> Since I am using dovecot I do not have courier installed, but Courier had a very handy > tool for making maildir folders called `maildirmake` which I used in some automated > backup scripts. How do I duplicate maildirmake in dovecot?Dovecot can autocreate mailboxes. Is that something you can use? http://wiki2.dovecot.org/MailboxSettings http://dovecot.2317879.n4.nabble.com/dovecot-2-2-Warning-autocreate-plugin-is-deprecated-use-mailbox-auto-setting-instead-td41673.html -- Rob