Add "Received:" header to email msg in correct position?

Steven D'Aprano steve at pearwood.info
Tue May 6 04:22:10 EDT 2014


On Tue, 06 May 2014 02:13:09 +0000, Grant Edwards wrote:

> There's is a somewhat messy way to do it by calling msg.items() to
> retrieve all the current headers, removing all of them, and then adding
> them all back (includeing the new one) in the order I want them.

Does msg.items() return the actual message header list, or a copy? 
Because if it returns the list itself, you can just insert directly into 
the list using the insert method.


-- 
Steven



More information about the Python-list mailing list