checkin of code & license from https://github.com/ryancoleman/imap-upload.git