Random Projects: Imap Vacuum Python Module

These are a few random projects. They range from very useful to totally frivolous. Consider them all to be under the GPL.

This is a README file for the imapvaccum python module.  
It is copywrite Brian Hone 3/24/2002, and is distributed under the GNU Public License.

Overview:
========

The purpose of this module is to make it easy to copy an IMAP directory tree from one 
IMAP server to another.  It is pretty easy to use, albeit somewhat crude.  
If anyone is interested, perhaps it can be made more useful.

Example Code:
============

from imapvacuum import imapvacuum

a = imapvacuum()
a.server1Info = ['hostname1','bob','password']
a.server2Info = ['hostname2','bob','password']
a.login()

# Replicate the Directory Tree
a.getDirList()
a.createTree()

# Copy the messages
a.copyTree()

This is the most basic use.  You can also have a lot more fine-grained control if you want it.
 
 
imapvacuum
index
/Users/bhone/projects/imap_vacuum/imapvacuum.py

#####################################################################
# This is a script to replicate the directory tree from one IMAP    #
#  Server to another IMAP server                                    #
#                                                                   #
# It can be used for migration or for backup.                       #
# - If someone can think of a way to open many users' directories   #
#   without a password, it would be a great backup tool             #
#                                                                   #
# Written by Brian Hone 3/24/2002                                   #
# - This program is distributed under the GNU Public License        #
#####################################################################

 
Modules
            
imaplib
string
sys
time
 
Classes
            
imapvacuum
 
class imapvacuum
      This is a class designed to allow one to easily access imap directories for replication
 
   Methods defined here:
__init__(self)
Initialiazation method for imapvacuum
compareMailbox(self, mailbox)
check if a mailbox in Server1 exists in Server2.  if not, create one
compareMailboxes(mailbox, mailHandle1, mailHandle2)
compare the message id's of two mailboxes
copyTree(self)
copy all the messages in our tree
createTree(self)
get a list of directories, create a tree in a new mailhandle
getHeaderDict(message)
read the header of a message into a dictionary
getList(self)
get a list of directories to copy
getMessageList(mailbox, mailHandle)
read the message number and id into a dictionary
login(self)
Log into our imap servers.
moveMessage(self, msg_num, mailbox)
move a given message in a given mailbox
moveMessages(self, mailbox)
get all the messages in a mailbox

Data and non-method functions defined here:
__doc__ = '\n\tThis is a class designed to allow one to easily access imap directories for replication\n\t'
__module__ = 'imapvacuum'
 
Data
             __file__ = './imapvacuum.pyc'
__name__ = 'imapvacuum'