25 r# Read message number #
28 # Problem: computer needs to be online to fill channel!
29 class FillingThread(threading
.Thread
):
33 if FILL_INTERVAL
is None:
34 print "Channel filling disabled - messages will send immediately"
39 item
= sendq
.get_nowait()
41 print "Sending filler message"
42 enc_body
= cotp
.encode(body
)
44 print ms
.send(to
, subject
, enc_body
)
46 print "Sending queued message"
47 to
, subject
, body
= item
48 enc_body
= cotp
.encode(body
)
49 print ms
.send(to
, subject
, enc_body
)
51 time
.sleep(FILL_INTERVAL
)
55 ms
= SecureMail
.SecureMail()
58 FillingThread().start()
62 line
= raw_input(">> ")
65 if len(line
.strip()) == 0:
71 print "Fetching messages..."
74 print i
, m
["sender"], m
["subject"]
79 to
= raw_input("To: ")
80 subject
= raw_input("Subject: ")
81 print "Enter body, ending with '.' on a line by itself."
89 if FILL_INTERVAL
is None:
90 print "Sending %s bytes now" % (len(body
,))
91 print ms
.send(to
, subject
, body
)
93 sendq
.put((to
, subject
, body
))
94 print "Enqueued to send at next interval, pending: %s" % (sendq
.qsize(),)
105 print "Bad message number: %s" % (num
,)
106 print "Are you sure it is listed with 'l'?"
107 print "Message count: %s" % (len(msgs
),)
110 print "From: %s" % (msg
["sender"],)
111 print "Subject: %s" % (msg
["subject"],)
114 print "Unknown command, type h for help"
116 if __name__
== "__main__":