Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (20 sloc) 520 Bytes
#!/bin/bash
# NoSuck.org
# Mutt Mailto Handler for XDG Environment
if [[ "$1" == mailto:* ]] ; then
sStart="${1%%\?*}"
sEnd="&${1##*\?}"
# The whitelist.
sValidAttributes=( "Subject" )
for sAttribute in "${sValidAttributes[@]}" ; do
sHit="$( echo "$sEnd" | sed "s/^.*&$sAttribute=\([^&]*\).*/$sAttribute=\1/" )"
if [[ "$sEndNew" ]] ; then
sEndNew="$sEndNew&$sHit"
else
sEndNew="?$sHit"
fi
done
fi
sNewMailto="$sStart$sEndNew"
# Modify as necessary.
$TERM -e "mutt${sNewMailto:+ \"$sNewMailto\"}" &