Created
January 31, 2012 06:39
-
-
Save indrora/1709261 to your computer and use it in GitHub Desktop.
Claws python script for auto-re-from
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Script run by Claws-mail | |
# save this as ~/.claws-mail/python-scripts/auto/compose_any | |
# Makes sure right-side is set as From: if any To: match left-side | |
replacements = { | |
'[email protected]':'[email protected]' | |
} | |
to_addresses = [ x[1] for x in clawsmail.compose_window.get_header_list() if x[0] == "To:"] | |
def mangle_names(): | |
for name in to_addresses: | |
for possible_replacement in replacements.keys(): | |
if(name in possible_replacement): | |
clawsmail.compose_window.set_from(replacements[name]) | |
break | |
mangle_names() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment