HowTo use Mozilla Thunderbird in Nautilus’ Send To… instead of Evolution (for Attachments)

Menu Screenshot Nautilus Script SendtoIf you want to send an E-Mail quickly per Mozilla Thunderbird in Nautilus like the Send To Feature you have to write a little script. (I found a .deb for replacing Evolution with Thunderbird, but it did not work. Instead it killed the whole feature. At the end you will get a menu like the one in the screenshot on the right.

  1. Because I do not need Evolution in Nautilus I removed the nautilus-sento app. To do this execute the following: sudo apt-get remove nautilus-sendto.
  2. Create a file in ~/.gnome2/nautilus-scripts named sendto.
  3. Make it executable with chmod a+x sendto
  4. Paste the following one-liner into the file and save it
    thunderbird -compose attachment="file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
    Note
    : If you have Thunderbird 1.5 (or minor?) you must replace “thunderbird” with “mozilla-thunderbird”.
  5. Restart Nautilus with killall nautilus

Now you can right click on a file and select Scripts -> sendto to send a file as an attachment in Thunderbird.

For more scripts you can goto Nautilus File Manager Scripts.

Advertisements

24 Responses to “HowTo use Mozilla Thunderbird in Nautilus’ Send To… instead of Evolution (for Attachments)”


  1. 1 Jim September 27, 2007 at 9:48 am

    Thanks, works great. Only problem was getting the full one line text string … it got truncated when I tried to copy it a couple of times … I’m viewing with thunderbird on ubuntu linux which might be the problem, might be better to include it as regular text rather than the html or whaterver it is?

    Thanks again.

    J

  2. 2 ataub2qf October 1, 2007 at 12:14 pm

    @Jim
    I don’t know how to get it in one line. I only used the code-tag to highlight it.

  3. 3 Alex October 3, 2007 at 4:51 am

    I am getting and error message when trying to send an attachment this way.

    Message reads:
    Sending of message failed.
    Unable to open the temporary file /home/myname/data/filename.txt
    Check your ‘Temporary Directory’ setting.

    The file shows up in the attachments box of the compose dialog and the path to the file is correct.

    Re-attaching the file using the GUI provisions allows it to work.

    Got a clue?

    Alex

  4. 4 ataub2qf October 3, 2007 at 8:40 am

    @Alex Seems to be a thunderbird-problem…
    For Windows this trick seems to work:
    Maybe it works for you if you empty /tmp and ~/.Trash ?

  5. 5 Alex October 4, 2007 at 3:08 am

    ataub2qf,
    I did not know that Nautilus ran on Windows?
    When was that release made? 😮

    Can’t empty /tmp while the system is running.

  6. 6 Elad Tabak October 14, 2007 at 2:31 pm

    I’m having the same issue with the attachments (using Linux).
    Empty /tmp is not an option.
    Any idea?

  7. 7 tech January 3, 2008 at 4:59 pm

    I am having this same temp file problem. Is there a solution for this? This thread just seems to stop.

  8. 8 ataub2qf January 4, 2008 at 12:20 pm

    Hmm on Feisty it works with nautilus-sendto:
    Just click on the file you want to send with the right mouse button and select >Send to<, then choose Thunderbird as “Send as”

  9. 9 Gow May 10, 2008 at 4:48 pm

    To solve the temporary directory problem, simply get rid of the quotation mark.

    i.e. thunderbird -compose attachment=file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS

    It works for me 🙂

  10. 10 Phil March 11, 2009 at 3:57 pm

    When I used apt-get to remove nautilus-sendto, it also removed ubuntu-desktop. When I reinstalled ubunut-desktop, it reinstall nautilus-sendto. I am in a continous loop.

    Also, what if I want to use Gmail instead of Thunderbird.
    Can I use the following line in the sendto script :

    firefox https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ‘s/mailto://’`

  11. 11 ataub2qf April 1, 2009 at 4:09 pm

    @Phil:
    Maybe you can set firefox as your preferred E-Mail application and set firefox to use gmail as default.

  12. 12 Douglas April 20, 2009 at 3:55 am

    Just wanted to say Thank You for the script. I was doing some work on my free time and decided to install Thunderbird and was just thinking how nice it would be to have a “Sendto” option…

    Nice to see people willing to share there scripts.

    Doug!

  13. 13 petr August 3, 2009 at 7:45 am

    Thanks, nice script. But, how to send more than 1 file in 1 email?

  14. 14 Brian November 5, 2009 at 6:26 am

    Yeah, a second on sending more than one file (highlighted multiple).

    Thanks though.

  15. 15 Alex November 10, 2009 at 8:08 pm

    I did this w/ “nautilus actions” …

    and created a send to thunderbird context menu item with the parameter

    -compose attachment=file://%M

    it works so far, I had tried it without success but then realized that I had to include the “file://” before the %M

  16. 16 razer November 20, 2009 at 6:47 pm

    You can use this application I’ve made to have full features sending nautilus selection as email :
    http://sourceforge.net/projects/mailpictures

  17. 18 Olivier June 3, 2010 at 1:14 pm

    another one.
    Change the onliner with the more advanced script that handle several files

    #!/bin/bash
    set -x
    #thunderbird -compose attachment=file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
    # attach multiple files thunderbird.sh
    #thunderbird -compose “attachment=’file:////home/will/newfile,file:////home/will/newfile2′”
    #-compose subject=Emailing %m,attachment=%u

    if [ $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS = “” ] ;then echo “no files given” ; exit 1 ;fi &>/dev/null
    Y=`echo file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | sed ‘s/ \//,file:\/\/\//g’ | sed ‘s/ /^^/g’` #this sed replaces all spaces with a ^^.
    X=`echo $Y | sed ‘s/\^^/ /g’` #this sed replaces all ^^’s with a space
    Z=`echo $Y | sed ‘s/,file:\/\// /g’`
    ii=1 #that sed (below)replaces all ^^’s with a space
    BODY=$(for file in $Z ;do C=`basename “$(echo $file | sed ‘s/\^^/ /g’)”` ; echo ; echo -n “$ii) $C” ; ii=$(($ii+1)) ; done)
    thunderbird -compose “attachment=’$X'”,body=”P.S. – Attached Files: $BODY”,subject=”attached files”

  18. 19 cape October 23, 2010 at 4:59 pm

    multiple attachment doenst work for me…

    single attachment does work, but when i select multiple files the contextmenu doesn’t show the option anymore. UBUNTU 10.10 here

  19. 20 colan April 11, 2011 at 8:48 pm

    I’ve created an Ubuntu bug for this problem. Please confirm or add additional comments over at https://bugs.launchpad.net/ubuntu/+source/nautilus-sendto/+bug/757976

  20. 21 Anonymous June 26, 2011 at 1:45 pm

    Does anybody have any idea as to when/if the thunderbird email send to option will be implemented?

  21. 22 Anonymous July 7, 2012 at 5:43 pm

    Excellent, really happy with this cheers 🙂


  1. 1 Nautilus'ta sağ tuş menüsüne "eposta ile gönder" ekleme | Murat Özalp Trackback on December 31, 2010 at 6:15 pm
  2. 2 How to add new item on right click menu for linux (KDE and Gnome)? | BlogoSfera Trackback on April 24, 2013 at 8:02 pm
Comments are currently closed.




%d bloggers like this: