mailto: .. attach= is not working for firefox nor chrome, so can't email a .klm file from Google Earth?

I love having Google Earth on Debian, but when I try to email a .klm view file using File | Email | Email view... and select web browser mailto: handler:

enter image description here

I get the following error message:

enter image description here

I'm not seeing this error message in Windows 10. Instead it creates the email as expected with the attachment.

Here's what I've already tried to fix this:

1) Fixed the environment (a couple of places to be sure):

# cat /etc/environment 


# tail  -2 /etc/.bash.shared 
export BROWSER="/opt/firefox/firefox"

Now when I open terminal I get this:

$ env | grep BROWSER

2) Also I tested both Firefox and Chrome to see if the attach= worked in a mailto: URL, but so far I can't seem to this to work. I'm trying to browse to a URL something like these:


(where the URL encoding is %22 is for a double quote (") and %2f is for a slash (/)).

I've also tried @attachment= rather than @attach=.

Both Thunderbird and Chrome open a new email window, and the subject and body work as expected, but the attachment is not present.

So first, I think I need to get @attach= to work with Firefox (or Chrome), but how?

I'm using:

  • Debian 9.9 (x86-64) (Linux Kernel 4.9.0-9-amd64)
  • Cinnamon 3.2.7 with
  • Google Earth
  • Firefox Quantum 68.0.2 (64 bit) / Chrome 76.0.3809.100 (64-bit)

  • I don't think that including an attachment via a mailto: url works with any mailer program. Are you sure that's how GoogleEarth tries to pass it?
    – mosvy
    Aug 19 '19 at 5:54
  • Try running strace -s1024 -fe trace=execve -p [pid of google earth] in a separate window while trying to email that .kml, and that will tell you exactly what it's trying to run. A solution could be to point the BROWSER envvar to a wrapper script that handles it.
    – mosvy
    Aug 19 '19 at 6:11
  • @mosvy, I see two processes: google-earth and googleearth-bin. In a bash window I run: ps -C google-earth and ps -C googleearth-bin and this gives process ids 26862 and 26873. Then I run strace -s1024 -fe trace=execve -p 26862 and this gives, "strace: Process 26873 attached" and for ... -p 26873 ".. with 26 threads", and then in Google Earth, when I do File | Email | Email view... and select web browser mailto: handler nothing happens in the bash window. If I hit ^C one or a bunch of processes are detached & the bash prompt returns. Is there a system call other than execve to test for? Aug 20 '19 at 14:15
  • @mosvy, ... belay that question a little bit, I found the strace -c option and am busy trying to see what other calls might be related, but this will take some time for me to sort out... Aug 20 '19 at 14:36

Here's a workaround to get a *.kmz file from Google Earth in GMU/Linux for your current location:

  • Create a push pin in the view you're at.
    (The name doesn't matter, but if you name it your filename below will be that name.)
  • Then right click on this push pin and select 'Save Place As'.
  • Then you can attach this *.kmz file to an email to send it to someone.

(You can sometimes select File | Save, but this doesn't always work.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.