#!/usr/bin/python from imaplib import IMAP4 conn = IMAP4('127.0.0.1', port=4567) conn.noop() conn.logout()