#! /bin/bash
#
# if thunderbird is allready running, send it a command

# needed to remove the mailto: tag, which would go to the To: field otherwise
args=`echo $1 | cut -f 2- -d ":"`

if mozilla-thunderbird -a thunderbird -remote "ping()" 2> /dev/null ; then
	mozilla-thunderbird -a thunderbird -remote "mailto($args)"
else
    mozilla-thunderbird $1 &
fi
