Skip to content

Instantly share code, notes, and snippets.

@indrora

indrora/gist:1709261

Created Jan 31, 2012
Embed
What would you like to do?
Claws python script for auto-re-from
#!/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 = {
'wat_list@pingas.tld':'herpderp@immpaperp.tld'
}
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
You can’t perform that action at this time.