blob: 6ead03352de105040fe632f22c361fbb0ab642d2 [file] [log] [blame]
mdm@chromium.org56df6d32010-08-31 18:16:49 +00001#!/bin/sh
dkegel@google.comf20da1f2009-06-30 19:16:32 +00002#---------------------------------------------
3# xdg-email
4#
5# Utility script to open the users favorite email program, using the
6# RFC 2368 mailto: URI spec
7#
8# Refer to the usage() function below for usage.
9#
mdm@chromium.org741e06f2011-03-30 22:51:57 +000010# Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
11# Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
dkegel@google.comf20da1f2009-06-30 19:16:32 +000012# Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
13# Copyright 2006, Jeremy White <jwhite@codeweavers.com>
14#
15# LICENSE:
16#
17# Permission is hereby granted, free of charge, to any person obtaining a
18# copy of this software and associated documentation files (the "Software"),
19# to deal in the Software without restriction, including without limitation
20# the rights to use, copy, modify, merge, publish, distribute, sublicense,
21# and/or sell copies of the Software, and to permit persons to whom the
22# Software is furnished to do so, subject to the following conditions:
23#
24# The above copyright notice and this permission notice shall be included
25# in all copies or substantial portions of the Software.
26#
27# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
28# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
30# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
31# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
32# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
33# OTHER DEALINGS IN THE SOFTWARE.
34#
35#---------------------------------------------
36
37manualpage()
38{
39cat << _MANUALPAGE
40Name
41
42xdg-email - command line tool for sending mail using the user's preferred
43e-mail composer
44
45Synopsis
46
47xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text
48] [--attach file] [ mailto-uri | address(es) ]
49
50xdg-email { --help | --manual | --version }
51
52Description
53
54xdg-email opens the user's preferred e-mail composer in order to send a mail to
55address(es) or mailto-uri. RFC2368 defines mailto: URIs. xdg-email limits
56support to, cc, subject and body fields in mailto-uri, all other fields are
57silently ignored. address(es) must follow the syntax of RFC822. Multiple
58addresses may be provided as separate arguments.
59
60All information provided on the command line is used to prefill corresponding
61fields in the user's e-mail composer. The user will have the opportunity to
62change any of this information before actually sending the e-mail.
63
64xdg-email is for use inside a desktop session only. It is not recommended to
65use xdg-email as root.
66
67See http://portland.freedesktop.org/EmailConfig for information on how the user
68can change the e-mail composer that is used.
69
70Options
71
72--utf8
73 Indicates that all command line options that follow are in utf8. Without
74 this option, command line options are expected to be encoded according to
75 locale. If the locale already specifies utf8 this option has no effect.
76 This option does not affect mailto URIs that are passed on the command
77 line.
78--cc address
79 Specify a recipient to be copied on the e-mail.
80--bcc address
81 Specify a recipient to be blindly copied on the e-mail.
82--subject text
83 Specify a subject for the e-mail.
84--body text
85 Specify a body for the e-mail. Since the user will be able to make changes
86 before actually sending the e-mail, this can be used to provide the user
87 with a template for the e-mail. text may contain linebreaks.
88--attach file
89
90 Specify an attachment for the e-mail. file must point to an existing file.
91
92 Some e-mail applications require the file to remain present after xdg-email
93 returns.
94
95--help
96 Show command synopsis.
97--manual
98 Show this manualpage.
99--version
100 Show the xdg-utils version information.
101
102Environment Variables
103
104xdg-email honours the following environment variables:
105
106XDG_UTILS_DEBUG_LEVEL
107 Setting this environment variable to a non-zero numerical value makes
108 xdg-email do more verbose reporting on stderr. Setting a higher value
109 increases the verbosity.
110
111Exit Codes
112
113An exit code of 0 indicates success while a non-zero exit code indicates
114failure. The following failure codes can be returned:
115
1161
117 Error in command line syntax.
1182
119 One of the files passed on the command line did not exist.
1203
121 A required tool could not be found.
1224
123 The action failed.
1245
125 No permission to read one of the files passed on the command line.
126
127Configuration
128
129Visit http://portland.freedesktop.org/EmailConfig for information how to
130configure xdg-email to use the email client of your choice.
131
132Examples
133
134xdg-email 'Jeremy White <jwhite@example.com>'
135
136xdg-email --attach /tmp/logo.png \
137 --subject 'Logo contest' \
138 --body 'Attached you find the logo for the contest.' \
139 'jwhite@example.com'
140
141xdg-email --subject 'Your password is about to expire' \
142 'jwhite@example.com' 'bastian@example.com' 'whipple@example.com'
143
144_MANUALPAGE
145}
146
147usage()
148{
149cat << _USAGE
150xdg-email - command line tool for sending mail using the user's preferred
151e-mail composer
152
153Synopsis
154
155xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text
156] [--attach file] [ mailto-uri | address(es) ]
157
158xdg-email { --help | --manual | --version }
159
160_USAGE
161}
162
163#@xdg-utils-common@
164
165#----------------------------------------------------------------------------
166# Common utility functions included in all XDG wrapper scripts
167#----------------------------------------------------------------------------
168
169DEBUG()
170{
171 [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0;
172 [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0;
173 shift
174 echo "$@" >&2
175}
176
177#-------------------------------------------------------------
178# Exit script on successfully completing the desired operation
179
180exit_success()
181{
182 if [ $# -gt 0 ]; then
183 echo "$@"
184 echo
185 fi
186
187 exit 0
188}
189
190
191#-----------------------------------------
192# Exit script on malformed arguments, not enough arguments
193# or missing required option.
194# prints usage information
195
196exit_failure_syntax()
197{
198 if [ $# -gt 0 ]; then
199 echo "xdg-email: $@" >&2
200 echo "Try 'xdg-email --help' for more information." >&2
201 else
202 usage
203 echo "Use 'man xdg-email' or 'xdg-email --manual' for additional info."
204 fi
205
206 exit 1
207}
208
209#-------------------------------------------------------------
210# Exit script on missing file specified on command line
211
212exit_failure_file_missing()
213{
214 if [ $# -gt 0 ]; then
215 echo "xdg-email: $@" >&2
216 fi
217
218 exit 2
219}
220
221#-------------------------------------------------------------
222# Exit script on failure to locate necessary tool applications
223
224exit_failure_operation_impossible()
225{
226 if [ $# -gt 0 ]; then
227 echo "xdg-email: $@" >&2
228 fi
229
230 exit 3
231}
232
233#-------------------------------------------------------------
234# Exit script on failure returned by a tool application
235
236exit_failure_operation_failed()
237{
238 if [ $# -gt 0 ]; then
239 echo "xdg-email: $@" >&2
240 fi
241
242 exit 4
243}
244
245#------------------------------------------------------------
246# Exit script on insufficient permission to read a specified file
247
248exit_failure_file_permission_read()
249{
250 if [ $# -gt 0 ]; then
251 echo "xdg-email: $@" >&2
252 fi
253
254 exit 5
255}
256
257#------------------------------------------------------------
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000258# Exit script on insufficient permission to write a specified file
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000259
260exit_failure_file_permission_write()
261{
262 if [ $# -gt 0 ]; then
263 echo "xdg-email: $@" >&2
264 fi
265
266 exit 6
267}
268
269check_input_file()
270{
271 if [ ! -e "$1" ]; then
272 exit_failure_file_missing "file '$1' does not exist"
273 fi
274 if [ ! -r "$1" ]; then
275 exit_failure_file_permission_read "no permission to read file '$1'"
276 fi
277}
278
279check_vendor_prefix()
280{
281 file_label="$2"
282 [ -n "$file_label" ] || file_label="filename"
283 file=`basename "$1"`
284 case "$file" in
285 [a-zA-Z]*-*)
286 return
287 ;;
288 esac
289
290 echo "xdg-email: $file_label '$file' does not have a proper vendor prefix" >&2
291 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2
292 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2
293 echo "Use --novendor to override or 'xdg-email --manual' for additional info." >&2
294 exit 1
295}
296
297check_output_file()
298{
299 # if the file exists, check if it is writeable
300 # if it does not exists, check if we are allowed to write on the directory
301 if [ -e "$1" ]; then
302 if [ ! -w "$1" ]; then
303 exit_failure_file_permission_write "no permission to write to file '$1'"
304 fi
305 else
306 DIR=`dirname "$1"`
307 if [ ! -w "$DIR" -o ! -x "$DIR" ]; then
308 exit_failure_file_permission_write "no permission to create file '$1'"
309 fi
310 fi
311}
312
313#----------------------------------------
314# Checks for shared commands, e.g. --help
315
316check_common_commands()
317{
318 while [ $# -gt 0 ] ; do
319 parm="$1"
320 shift
321
322 case "$parm" in
323 --help)
324 usage
325 echo "Use 'man xdg-email' or 'xdg-email --manual' for additional info."
326 exit_success
327 ;;
328
329 --manual)
330 manualpage
331 exit_success
332 ;;
333
334 --version)
mdm@chromium.org7bf13222011-03-30 23:20:46 +0000335 echo "xdg-email 1.1.0 rc1"
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000336 exit_success
337 ;;
338 esac
339 done
340}
341
342check_common_commands "$@"
343
344[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL;
345if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then
346 # Be silent
347 xdg_redirect_output=" > /dev/null 2> /dev/null"
348else
349 # All output to stderr
350 xdg_redirect_output=" >&2"
351fi
352
353#--------------------------------------
354# Checks for known desktop environments
355# set variable DE to the desktop environments name, lowercase
356
357detectDE()
358{
359 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
360 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000361 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
362 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
mdm@chromium.org7bf13222011-03-30 23:20:46 +0000363 elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
364 else DE=""
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000365 fi
366}
367
368#----------------------------------------------------------------------------
369# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4
370# It also always returns 1 in KDE 3.4 and earlier
371# Simply return 0 in such case
372
373kfmclient_fix_exit_code()
374{
mdm@chromium.org7bf13222011-03-30 23:20:46 +0000375 [ x"$KDE_SESSION_VERSION" = x"4" ] && return 0;
376 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'`
377 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'`
378 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'`
379 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'`
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000380 test "$major" -gt 3 && return $1
381 test "$minor" -gt 5 && return $1
382 test "$release" -gt 4 && return $1
383 return 0
384}
385
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000386run_thunderbird()
387{
388 local THUNDERBIRD MAILTO NEWMAILTO TO CC BCC SUBJECT BODY ATTACH
389 THUNDERBIRD="$1"
390 MAILTO=$(echo "$2" | sed 's/^mailto://')
391 echo "$MAILTO" | grep -qs "^?"
392 if [ "$?" = "0" ] ; then
393 MAILTO=$(echo "$MAILTO" | sed 's/^?//')
394 else
395 MAILTO=$(echo "$MAILTO" | sed 's/^/to=/' | sed 's/?/\&/')
396 fi
397
398 MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g')
399 TO=$(echo "$MAILTO" | grep '^to=' | sed 's/^to=//' | awk '{ printf "%s,",$0 }')
400 CC=$(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//' | awk '{ printf "%s,",$0 }')
401 BCC=$(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//' | awk '{ printf "%s,",$0 }')
402 SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1)
403 BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1)
mdm@chromium.org741e06f2011-03-30 22:51:57 +0000404 ATTACH=$(echo "$MAILTO" | sed 's/^attach=/\n\nfile:\/\//g' | awk '/^file:/ { printf "%s,",$0 }' | sed 's/,$//')
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000405
406 if [ -z "$TO" ] ; then
407 NEWMAILTO=
408 else
409 NEWMAILTO="to='$TO'"
410 fi
411 if [ -n "$CC" ] ; then
412 NEWMAILTO="${NEWMAILTO},cc='$CC'"
413 fi
414 if [ -n "$BCC" ] ; then
415 NEWMAILTO="${NEWMAILTO},bcc='$BCC'"
416 fi
417 if [ -n "$SUBJECT" ] ; then
418 NEWMAILTO="${NEWMAILTO},$SUBJECT"
419 fi
420 if [ -n "$BODY" ] ; then
421 NEWMAILTO="${NEWMAILTO},$BODY"
422 fi
423
424 if [ -n "$ATTACH" ] ; then
425 NEWMAILTO="${NEWMAILTO},attachment='${ATTACH}'"
426 fi
427
428 NEWMAILTO=$(echo "$NEWMAILTO" | sed 's/^,//')
429 DEBUG 1 "Running $THUNDERBIRD -compose \"$NEWMAILTO\""
430 "$THUNDERBIRD" -compose "$NEWMAILTO"
431 if [ $? -eq 0 ]; then
432 exit_success
433 else
434 exit_failure_operation_failed
435 fi
436}
437
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000438open_kde()
439{
mdm@chromium.org7bf13222011-03-30 23:20:46 +0000440 local client kde_email_profile_name
441 kde_email_profile_name=`kreadconfig --file emaildefaults --group Defaults --key Profile`
442 client=`kreadconfig --file emaildefaults --group PROFILE_"$kde_email_profile_name" --key EmailClient | cut -d ' ' -f 1`
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000443 echo $client | grep thunderbird > /dev/null 2>&1
444 if [ $? -eq 0 ] ; then
445 run_thunderbird "$client" "$1"
446 fi
447
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000448 if [ -f /etc/SuSE-release ] ; then
449 # Workaround for SUSE 10.0
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000450 [ -z "$client" ] && client="kmail"
451 if ! which "$client" > /dev/null 2> /dev/null; then
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000452 DEBUG 3 "KDE has $client configured as email client which isn't installed"
453 if which gnome-open > /dev/null 2> /dev/null && which evolution > /dev/null 2> /dev/null; then
454 DEBUG 3 "Try gnome-open instead"
455 open_gnome "$1"
456 fi
457 fi
458 fi
459 DEBUG 1 "Running kmailservice \"$1\""
mdm@chromium.orgad856b92009-07-27 21:50:25 +0000460 if [ x"$KDE_SESSION_VERSION" = x"4" ]; then
461 KMAILSERVICE=`kde4-config --locate kmailservice --path exe 2>/dev/null`
462 else
463 KMAILSERVICE=`which kmailservice 2>/dev/null`
464 fi
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000465 # KDE uses locale's encoding when decoding the URI, so set it to UTF-8
mdm@chromium.orgad856b92009-07-27 21:50:25 +0000466 LC_ALL=C.UTF-8 $KMAILSERVICE "$1"
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000467 kfmclient_fix_exit_code $?
468
469 if [ $? -eq 0 ]; then
470 exit_success
471 else
472 exit_failure_operation_failed
473 fi
474}
475
476open_gnome()
477{
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000478 local client
479 client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1` || ""
480 echo $client | grep thunderbird > /dev/null 2>&1
481 if [ $? -eq 0 ] ; then
482 run_thunderbird "$client" "$1"
483 fi
484
485 if gvfs-open --help 2>/dev/null 1>&2; then
486 DEBUG 1 "Running gvfs-open \"$1\""
487 gvfs-open "$1"
488 else
489 DEBUG 1 "Running gnome-open \"$1\""
490 gnome-open "$1"
491 fi
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000492
493 if [ $? -eq 0 ]; then
494 exit_success
495 else
496 exit_failure_operation_failed
497 fi
498}
499
500
501open_xfce()
502{
503 DEBUG 1 "Running exo-open \"$1\""
504 exo-open "$1"
505
506 if [ $? -eq 0 ]; then
507 exit_success
508 else
509 exit_failure_operation_failed
510 fi
511}
512
513open_generic()
514{
515 IFS=":"
516 for browser in $BROWSER; do
517 if [ x"$browser" != x"" ]; then
518
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000519 browser_with_arg=`printf "$browser" "$1" 2>/dev/null`
520 if [ $? -ne 0 ]; then browser_with_arg=$browser;
521 fi
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000522
523 if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1";
524 else $browser_with_arg;
525 fi
526
527 if [ $? -eq 0 ]; then exit_success;
528 fi
529 fi
530 done
531
532 exit_failure_operation_impossible "no method available for opening '$1'"
533}
534
535url_encode()
536{
537result=$(echo "$1" | $utf8 | awk '
538 BEGIN {
539 for ( i=1; i<=255; ++i ) ord [ sprintf ("%c", i) "" ] = i + 0
540 e = ""
541 linenr = 1
542 }
543 {
544 if ( linenr++ != 1 ) {
545 e = e "%0D%0A"
546 }
547 for ( i=1; i<=length ($0); ++i ) {
548 c = substr ($0, i, 1)
549 if ( ord [c] > 127 ) {
550 e = e "%" sprintf("%02X", ord [c])
mdm@chromium.org741e06f2011-03-30 22:51:57 +0000551 } else if ( c ~ /[@a-zA-Z0-9.-\\\/]/ ) {
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000552 e = e c
553 } else {
554 e = e "%" sprintf("%02X", ord [c])
555 }
556 }
557 }
558 END {
559 print e
560 }
561')
562}
563
564options=
565mailto=
566utf8="iconv -t utf8"
567while [ $# -gt 0 ] ; do
568 parm="$1"
569 shift
570
571 case "$parm" in
572 --utf8)
573 utf8="cat"
574 ;;
575
576 --to)
577 if [ -z "$1" ] ; then
578 exit_failure_syntax "email address argument missing for --to"
579 fi
580 url_encode "$1"
581 options="${options}to=${result}&"
582 shift
583 ;;
584
585 --cc)
586 if [ -z "$1" ] ; then
587 exit_failure_syntax "email address argument missing for --cc"
588 fi
589 url_encode "$1"
590 options="${options}cc=${result}&"
591 shift
592 ;;
593
594 --bcc)
595 if [ -z "$1" ] ; then
596 exit_failure_syntax "email address argument missing for --bcc"
597 fi
598 url_encode "$1"
599 options="${options}bcc=${result}&"
600 shift
601 ;;
602
603 --subject)
604 if [ -z "$1" ] ; then
605 exit_failure_syntax "text argument missing for --subject option"
606 fi
607 url_encode "$1"
608 options="${options}subject=${result}&"
609 shift
610 ;;
611
612 --body)
613 if [ -z "$1" ] ; then
614 exit_failure_syntax "text argument missing for --body option"
615 fi
616 url_encode "$1"
617 options="${options}body=${result}&"
618 shift
619 ;;
620
621 --attach)
622 if [ -z "$1" ] ; then
623 exit_failure_syntax "file argument missing for --attach option"
624 fi
625 check_input_file "$1"
626 file=`readlink -f "$1"` # Normalize path
627 if [ -z "$file" -o ! -f "$file" ] ; then
628 exit_failure_file_missing "file '$1' does not exist"
629 fi
630
631 url_encode "$file"
632 options="${options}attach=${result}&"
633 shift
634 ;;
635
636 -*)
637 exit_failure_syntax "unexpected option '$parm'"
638 ;;
639
640 mailto:*)
641 mailto="$parm"
642 ;;
643
644 *@*)
645 url_encode "$parm"
646 if [ -z "${mailto}" ] ; then
647 mailto="mailto:"${result}"?"
648 else
649 options="${options}to=${result}&"
650 fi
651 ;;
652
653 *)
654 exit_failure_syntax "unexpected argument '$parm'"
655 ;;
656 esac
657done
658
659if [ -z "${mailto}" ] ; then
660 # TO address is optional
661 mailto="mailto:?"
662fi
663
664case $mailto in
665 *\?)
666 mailto="${mailto}${options}"
667 ;;
668
669 *\?*)
670 mailto="${mailto}&${options}"
671 ;;
672
673 *)
674 mailto="${mailto}?${options}"
675 ;;
676esac
677
678# Strip trailing ? and &
679mailto=`echo "${mailto}"| sed 's/[?&]$//'`
680
681# Shouldn't happen
682[ x"${mailto}" != x"" ] || exit_failure_syntax
683
684if which xdg-email-hook.sh > /dev/null 2> /dev/null; then
685 xdg-email-hook.sh "${mailto}"
686 if [ $? -eq 0 ]; then
687 exit_success
688 else
689 exit_failure_operation_failed
690 fi
691fi
692
693detectDE
694
695if [ x"$DE" = x"" ]; then
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000696 DE=generic
697fi
698
mdm@chromium.org56df6d32010-08-31 18:16:49 +0000699# if BROWSER variable is not set, check some well known browsers instead
700if [ x"$BROWSER" = x"" ]; then
701 BROWSER=links2:links:lynx:w3m
702 if [ -n "$DISPLAY" ]; then
703 BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER
704 fi
705fi
706
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000707case "$DE" in
708 kde)
709 open_kde "${mailto}"
710 ;;
711
712 gnome)
713 open_gnome "${mailto}"
714 ;;
715
716 xfce)
717 open_xfce "${mailto}"
718 ;;
719
mdm@chromium.org7bf13222011-03-30 23:20:46 +0000720 generic|lxde)
dkegel@google.comf20da1f2009-06-30 19:16:32 +0000721 open_generic "${mailto}"
722 ;;
723
724 *)
725 exit_failure_operation_impossible "no method available for opening '${mailto}'"
726 ;;
727esac