>>> header = 'subject'
>>> msg = email.message_from_string(raw_email)
>>> msg[header] = 'Test123'
>>> print msg[header]
=?UTF-8?B?UmU6IFtHQlMgU3lzdGVtYWRtaW5pc3RyYXRpb25dICMxMjogRS1NYWk=?=
=?UTF-8?B?bCBCZW5hY2hyaWNodHVuZyBmw7xyIG5ldWUgVGlja2V0cyBlaW5yaWNodGVu?=
Why doesn't msg[header]
contain 'Test123'
?