17 r# Read message number #
21 username
= raw_input("Username: ")
22 ms
= SecureInbox
.SecureInbox(username
, getpass
.getpass())
26 line
= raw_input(">> ")
29 if len(line
.strip()) == 0:
35 print "Fetching messages..."
38 print i
, m
["sender"], m
["subject"]
43 to
= raw_input("To: ")
44 subject
= raw_input("Subject: ")
45 print "Enter body, ending with '.' on a line by itself."
52 print "Sending %s bytes" % (len(body
,))
53 print ms
.send(to
, subject
, body
)
59 print "Bad message: %s" % (msg
,)
60 print "Are you sure it is listed with 'l'?"
61 print "Message count: %s" % (len(msgs
),)
64 print "From: %s" % (msg
["sender"],)
65 print "Subject: %s" % (msg
["subject"],)
68 print cotp
.decode(msg
["body"])
70 print "Exception when decoding", sys
.exc_info()
72 print "Unknown command, type h for help"
74 if __name__
== "__main__":