summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDavid Steele <dsteele@gmail.com>2012-10-16 19:11:37 -0400
committerPetr Mladek <pmladek@suse.cz>2012-10-18 14:20:12 +0200
commit8e7a3669dd86f86325b3012abc657b5d4665374d (patch)
treeb1fab34fee30b0c56d9b034ae0fce4998118cc89 /shell
parent64dc5a0c6d7ef1169fe09a0377106e98f71ce6f7 (diff)
Combine senddoc null and default cases for better mailer selection.
Diffstat (limited to 'shell')
-rw-r--r--shell/source/unix/misc/senddoc.sh60
1 files changed, 8 insertions, 52 deletions
diff --git a/shell/source/unix/misc/senddoc.sh b/shell/source/unix/misc/senddoc.sh
index 5a755d7042c5..0ff15943d6ce 100644
--- a/shell/source/unix/misc/senddoc.sh
+++ b/shell/source/unix/misc/senddoc.sh
@@ -369,62 +369,18 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
/usr/bin/open -a "${MAILER}" ${ATTACH}
;;
- "")
-
- # DESKTOP_LAUNCH, see http://freedesktop.org/pipermail/xdg/2004-August/004489.html
- if [ -n "$DESKTOP_LAUNCH" ]; then
- while [ "$1" != "" ]; do
- case $1 in
- --to)
- if [ "${TO}" != "" ]; then
- MAILTO="${MAILTO:-}${MAILTO:+&}to=$2"
- else
- TO="$2"
- fi
- shift
- ;;
- --cc)
- MAILTO="${MAILTO:-}${MAILTO:+&}cc="`echo "$2" | ${URI_ENCODE}`
- shift
- ;;
- --bcc)
- MAILTO="${MAILTO:-}${MAILTO:+&}bcc="`echo "$2" | ${URI_ENCODE}`
- shift
- ;;
- --subject)
- MAILTO="${MAILTO:-}${MAILTO:+&}subject="`echo "$2" | ${URI_ENCODE}`
- shift
- ;;
- --body)
- MAILTO="${MAILTO:-}${MAILTO:+&}body="`echo "$2" | ${URI_ENCODE}`
- shift
- ;;
- --attach)
- MAILTO="${MAILTO:-}${MAILTO:+&}attachment="`echo "$2" | ${URI_ENCODE}`
- shift
- ;;
- *)
- ;;
- esac
- shift;
- done
-
- MAILTO="mailto:${TO}?${MAILTO}"
- ${DESKTOP_LAUNCH} "${MAILTO}" &
- else
- echo "Could not determine a mail client to use."
- exit 2
- fi
- ;;
-
*)
- # LO is configured to use something we do not recognize.
+
+ # LO is configured to use something we do not recognize, or is not configured.
# Try to be smart, and send the mail anyway, if we have the
# possibility to do so.
- if [ -n "$KDE_FULL_SESSION" -a -x /usr/bin/kde-open ] ; then
+ if [ -n "$DESKTOP_LAUNCH" ]; then
+ # http://lists.freedesktop.org/pipermail/xdg/2004-August/002873.html
+ MAILER=${DESKTOP_LAUNCH}
+ elif [ -n "$KDE_FULL_SESSION" -a -x /usr/bin/kde-open ] ; then
MAILER=/usr/bin/kde-open
- elif [ -x /usr/bin/gnome-open ] ; then
+ elif [ -n "$GNOME_DESKTOP_SESSION_ID" -a -x /usr/bin/gnome-open ] ; then
MAILER=/usr/bin/gnome-open
elif [ -x /usr/bin/xdg-open ] ; then
MAILER=/usr/bin/xdg-open
@@ -460,7 +416,7 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
shift
;;
--attach)
- MAILTO="${MAILTO:-}${MAILTO:+&}attach="`echo "file://$2" | ${URI_ENCODE}`
+ MAILTO="${MAILTO:-}${MAILTO:+&}attachment="`echo "file://$2" | ${URI_ENCODE}`
shift
;;
*)