18 r# Read message number #
22 ms
= SecureMail
.SecureMail()
28 line
= raw_input(">> ")
31 if len(line
.strip()) == 0:
37 print "Fetching messages..."
40 print i
, m
["sender"], m
["subject"]
45 to
= raw_input("To: ")
46 subject
= raw_input("Subject: ")
47 print "Enter body, ending with '.' on a line by itself."
54 print "Sending %s bytes" % (len(body
,))
55 enc_body
= cotp
.encode(body
)
56 print ms
.send(to
, subject
, enc_body
)
66 print "Bad message number: %s" % (num
,)
67 print "Are you sure it is listed with 'l'?"
68 print "Message count: %s" % (len(msgs
),)
71 print "From: %s" % (msg
["sender"],)
72 print "Subject: %s" % (msg
["subject"],)
75 print cotp
.decode(msg
["body"])
77 print "Exception when decoding", sys
.exc_info()
79 print "Unknown command, type h for help"
81 if __name__
== "__main__":