diff options
Diffstat (limited to 'scripts/tomaildir++.pl')
-rwxr-xr-x | scripts/tomaildir++.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/tomaildir++.pl b/scripts/tomaildir++.pl new file mode 100755 index 0000000..9e3c824 --- /dev/null +++ b/scripts/tomaildir++.pl @@ -0,0 +1,31 @@ +#! /usr/bin/perl + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, +# USA. + +# This file is a part of Binc IMAP. + +# Convert file entries to corresponding IMAPdir mailbox names. +# Use this script like this to add all IMAPdir entries to the +# subscription file: +# +# ls -a Maildir | tomaildir++.pl > Maildir/.subscribed + +while (<>) { + unless (/^[^\.]/ or /^\.$/ or /\.\./) { + chomp; + s|\.|/|g; + s|\\\.|\.|g; + s|\\\\|\\|g; + s|^/|\.|; + s|^\.(.*)|INBOX/$1|; + print "$_\n"; + } +} |