#!/usr/bin/python

# Work around Evo's limitations with raw mailto: URIs

import sys
import os

if len(sys.argv) >= 2:
	email = sys.argv[1]
        email = email.replace('&subject','___subject')
        email = email.replace('&Body','___Body')
        email = email.replace('&','%26')
        email = email.replace('___subject','&subject')
        email = email.replace('___Body=','&Body=%0A%0A')
        email = email + '%0A%0A--%0A' + open('/home/jani/.evolution/signatures/signature-0', 'r').read()
else: email = False

os.execlp("evolution","",(email))

