On Mon, Jul 28, 2008 at 02:22:18PM +0200, Martin Krafft wrote:
>also sprach Guido Günther <[EMAIL PROTECTED]> [2008.07.26.2115 +0200]:
>> > It would be nice if offlineimap could take new local folders and
>> > push them to the IMAP server, ideally controlled by an option.
>> I wonder if it isn't actually a bug that offlineimap ignores locally
>> created folders silently?
>
>Why? Does it promise that it does anywhere?
If it helps, I run the attached script regularly on my clients from
cron to warn me if I've created new folders and need to create them on
the server too.
--
Steve McIntyre, Cambridge, UK. [EMAIL PROTECTED]
"This dress doesn't reverse." -- Alden Spiess
#!/bin/sh
cd ~
HOST=mail.einval.com
LOC="/home/steve-mail/Home-mail/Inbox/."
MAILDIR="Home-mail"
for file in `find $MAILDIR -name cur -type d`
do
FOLDER=`echo $file | sed "s?/cur\\$??g;s?^$MAILDIR/??g;s?/?.?g"`
STATE=`find ~/.offlineimap/state -type f -name $FOLDER | wc -l`
if [ $STATE -eq 0 ] ; then
case $FOLDER in
*search-folder*|INBOX|Inbox)
# Ignore
;;
*)
LIST="$LIST $FOLDER"
;;
esac
fi
done
if [ "$LIST"x != ""x ] ; then
echo "New mail folders have been created locally."
echo "Please run the following to create them on the IMAP server now"
echo "and then sync a couple more times:"
echo
echo "ssh $HOST \""
for DIR in $LIST
do
echo "mkdir $LOC$DIR; \\"
echo "mkdir $LOC$DIR/cur; \\"
echo "mkdir $LOC$DIR/new; \\"
echo "mkdir $LOC$DIR/tmp; \\"
done
echo "\""
fi