IMAP4rev1 sample for python3.2 #!/usr/bin/env python3 # IMAP4rev1 # samples in python3. # select.select # LOGIN, LOGOUT, CREATE, LIST, LSUB # 11/22/2011 macken import getpass import socket import select import sys import fcntl import os HOST = 'your imap4 host' USER_NAME = 'your name' USER_PASSWORD = 'password' PORT = 143 BUFF_LEN = 1024 QUOTE = '"' BLANK = ' ' QUOTE_STAR_QUOTE = QUOTE+'*'+QUOTE QUOTE_QUOTE = QUOTE+QUOTE CRLF = '\r\n' current_index = 0 def next_index(): # For to use the GLOBAL version of current_index. global current_index index = current_index current_index+=1 return repr(index) + BLANK def create_folder(s, folder_name): str0 = next_index() + 'CREATE ' + QUOTE + folder_name + QUOTE + CRLF; data_send = bytearray(str0.encode()); print('data_send = ' + data_send.decode(), end='') s.send(data_send) line = s.recv(BUFF_LEN) pri...