2013-12-17 | Paul Boddie | raw annotate files changeset graph | Fixed the recipient dictionary format so that different recipient types can be represented properly. Introduced filtering to avoid showing irrelevant recipients for certain operations. Tidied up the HTTP responses when certain operations cannot be performed. |
1 #!/usr/bin/env python 2 3 from email import message_from_string 4 import sys 5 6 if __name__ == "__main__": 7 to = sys.argv[1] 8 text = sys.stdin.read() 9 10 message = message_from_string(text) 11 message["To"] = to 12 13 # Show the resulting message text. 14 15 text = message.as_string() 16 print text 17 18 # vim: tabstop=4 expandtab shiftwidth=4