title: Save an email.Message object into a file
body: <p>I am trying to modify emails stored as text files. I first import a message like this :</p>
  
  <pre><code>import email
  f = open('filename')
  msg = email.message_from_file(f)
  </code></pre>
  
  <p>Then, I make all the modifications I want, using the features of the email module.</p>
  
  <p>The last step is to save the Message object (msg) in a file. What is the piece of code that does this ? There seems not to be any simple function like "message_to_file()"...</p>
  
  <p>Many thanks.</p>