Remove unnecessary X-GPG headers (after use)
This commit is contained in:
parent
5acd15836f
commit
c6f902abc3
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from ConfigParser import RawConfigParser
|
||||
from email.mime.base import MIMEBase
|
||||
import email
|
||||
import email.message
|
||||
import re
|
||||
|
@ -36,8 +37,10 @@ if raw_message.has_key('X-GPG-Encrypt-To'):
|
|||
for eaddr in encrypted_to_addrs:
|
||||
if eaddr in to_addrs:
|
||||
to_addrs.remove( eaddr )
|
||||
del raw_message['X-GPG-Encrypt-To']
|
||||
if raw_message.has_key('X-GPG-Encrypt-Cc'):
|
||||
encrypted_to_addrs.extend( [e[1] for e in email.utils.getaddresses([raw_message['X-GPG-Encrypt-Cc']])] )
|
||||
del raw_message['X-GPG-Encrypt-Cc']
|
||||
|
||||
def send_msg( message, recipients = None ):
|
||||
if recipients == None:
|
||||
|
|
Loading…
Reference in New Issue