Nemo 'send by email' option

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Nemo 'send by email' option

Post by Zavonen »

Bonjour, Bonjour
Here's my new problem:
I successfully installed Evolution as the default email-client for Mint 17 Qiana Cinnamon.
So it means that when I click a 'mailto:' link in a web page Evolution starts with a new message opened to the correct receiver.
BUT .....
If I'm browsing an image directory on my local machine and after selection of a special graphic file I click the right button of mouse for a context menu I have the 'send by email' option. If I click this option, it's not my default email client Evolution which starts it is Thunderbird...
Don't know how to correct this behaviour.
Thanks you for your help.
Last edited by SMG on Thu Feb 10, 2022 4:28 pm, edited 1 time in total.
Reason: Locking old topic to prevent new questions from being added.
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

BTW I observed a similar illogical behaviour.
My Cinnamon favorite app. to view pictures is 'image viewer' (or something like this I know only French name 'Visionneuse d'images'.
If I click on a graphic file this 'image viewer' starts. Behaviour is as expected.
But if I right-click on a graphic file nemo propose to open with Gimp, Gthumb or Firefox ignoring Image Viewer.
So it seems that we have a conflict between Cinnamon priorities and Nemo (or Gnome) priorities.
It's Kalyk who suggested me such possibilities answering to my discussion about Nixnote, and I believe he's right.
How could we solve this ?
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

Additional information :
In every config file where such line:
x-scheme-handler/mailto ......
can be found (~/.local/share/ , /usr/share/ etc ...I have placed manually :
x-scheme-handler/mailto=evolution.desktop
and nowhere exists such line which thunderbird.
So I don't know where gnome/cinnamon picks up this association.
Of course it's possible to find a solution, which is not specially elegant because it ignores the cause of the problem.
This solution consists in placing a bash file "evolution.sh" with :
#!/bin/bash
evolution mailto:""?subject=Test\&body="Envoi d'un fichier"\&attach=$NEMO_SCRIPT_SELECTED_FILE_PATHS

in the directory ~/.gnome2/nemo-scripts.
After selecting a file to send just select the evolution.sh line in the nemo-scripts submenu, and it's done. It works !
But I don't even know how to remove the line 'send by email' from contextual menu.
anandrkris

Re: Nemo 'send by email' option

Post by anandrkris »

Right-click context options are controlled by Nemo Actions. By placing an action file in /usr/share/nemo/actions you can add items to Nemo’s right-click context menu.
Check here for send by mail nemo action. The below is used currently. I suppose, it is hard-coded to thunderbird as it is the default mail manager for Mint.

Code: Select all

Exec=thunderbird -compose to=,"attachment='%F'"
For more details check the sample action provided with Nemo Click here
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

Thank you anandrkris for your suggestion.
I tried to place an action file in ~/.local/share/nemo/actions
following all recommendations
Without any effect. Simply doesn't work, name doesn't appear in menu, etc...
although I tried active=true option.
So I don't know where is the problem.
BTW changes to /usr/share/nemo/actions have no effect too and the actual behaviour of nemo is not described by actions listed here. It seems that it is just examples without any effect.
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

The sample file provided didn't work.
BUT examples given in :
http://hatteras-blog.blogspot.com.es/20 ... -menu.html
work perfectly !
Viva Espana !
anandrkris

Re: Nemo 'send by email' option

Post by anandrkris »

Glad you got it working, at last. :D Sample file is primarily meant for illustration of the syntax of nemo actions.
I remember creating nemo actions in mentioned locations and it used to work. I am not in front of my Cinnamon PC now, so cant check it out now.
But, i believe, just commenting below line would make it show up, i think.
# Whether this action is active. For troubleshooting.
# Optional - if this field is omitted, the action will be active
Active=false
BTW, have asked Nemo developer on having a generic solution to handle all mail clients.
https://github.com/linuxmint/nemo/pull/78
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

Finally I was successful to write a nemo action with two files in ~/.local/share/nemo/actions
file evolution.nemo_action

Code: Select all

[Nemo Action]
Active=true
Name=Envoyer par Evolution 
Comment=Les fichiers selectionnes seront envoyés par courrier
#Exec=evolution mailto:""?subject="Envoi de fichier"\&body="fichier ci-joint"\&attach="%U" 
Exec=<myaction.py %P %F>
Icon-Name=evolution
Selection=Any
Extensions=any
file myaction.py (python script)

Code: Select all

#! /usr/bin/env python 
import sys 
import os
L=sys.argv[2:]
command='evolution mailto:""?subject="envoi de documents"\&body="fichiers joints"'
for f in L:
    command=command+'\&attach=\"'+f+"\""
os.system(command)   
IT works I can send several files together using my default mail-client evolution ( receiver to be chosen in contact list). Exactly what I wanted.
But a few things remain mysterious:
I cannot rename python script in 'anyname.py'
with corresponding modification of action file. only myaction.py is responding as if a link has been established once for ever.
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

But, i believe, just commenting below line would make it show up, i think.
No ! it doesn't work, I thought about it.
Starting from the example in doc I was unable to build an action.
With the 'spanish frame' it works but it's very sensitive to change, very capricious.
anandrkris

Re: Nemo 'send by email' option

Post by anandrkris »

Hmm...In my view it shouldn't need so much of tweaking / hacking. :)
I believe, it is best if you have a chat with someone in development team over IRC #linuxmint-dev. (preferable nemo developer mtwebster if he is available).
Particularly, if sample action instructions need any update.
User avatar
Spearmint2
Level 16
Level 16
Posts: 6900
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: Nemo 'send by email' option

Post by Spearmint2 »

wouldn't it be easier to just use the Preferred Applications from the Menu to change it from Thunderbird to Evolution?

Code: Select all

mate-default-applications-properties
for MATE

Code: Select all

mate-default-applications-properties
for Cinnamon
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
anandrkris

Re: Nemo 'send by email' option

Post by anandrkris »

@Spearmint - Nemo has the application hard-coded as Thunderbid....so it doesnt pick up the default mail client...
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

.so it doesnt pick up the default mail client...
Yes, it's our problem.
User avatar
Spearmint2
Level 16
Level 16
Posts: 6900
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: Nemo 'send by email' option

Post by Spearmint2 »

Yesterday I ran across this, but didn't link since I thought situation was different, but it might help figure out what you want to do in Nemo. Has instructions to set up another mail client to use with Nemo. It's for using gmail, but might work for setting up thunderbird to Nemo.


http://pclosmag.com/html/Issues/201404/page08.html

Under Cinnamon, the file manager is Nemo, which is a fork of Nautilus. You can set up the script to use Nemo's right-click context menu. Just place a copy of the send-mail.sh script in the ~/.gnome2/nemo-scripts folder, and mark the file as executable. Now, the send-gmail.sh script should show up under Nemo's right-click context menu, as an entry under the Scripts menu item. Select the file you want to send as an email attachment, right click on it, and select our new menu entry. Your selected file will be whisked off to your recipient(s).

Caja is a ripoff of Nemo. You could install it instead, or find how it calls to Thunderbird whereas Nemo doesn't.

Add a "mailto:" script to the scripts folder? What works for Nautilus, probably work for Nemo.

What works for Caja, probably work for Nemo.

Clk on quote for link.

There is a nemo-sendto that uses Evolution.

http://www.mirrorservice.org/sites/pack ... mo-sendto/

deprecated, but probably could still force previous version with it.
http://cinnamon.linuxmint.com/?p=233
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

Under Cinnamon, the file manager is Nemo, which is a fork of Nautilus. You can set up the script to use Nemo's right-click context menu. Just place a copy of the send-mail.sh script in the ~/.gnome2/nemo-scripts folder, and mark the file as executable. Now, the send-gmail.sh script should show up under Nemo's right-click context menu, as an entry under the Scripts menu item. Select the file you want to send as an email attachment, right click on it, and select our new menu entry. Your selected file will be whisked off to your recipient(s).
This works and I did it a lot of times for various operations (we can use ready-made 'libraries' of sh scripts for nautilus which work for nemo as well).
But my question was more precise and would be connected to:
How can I remove 'send by email' from main context menu ?
Never read anything about this.
anandrkris

Re: Nemo 'send by email' option

Post by anandrkris »

By setting the below property

Code: Select all

Active=false
for the file in this location. (Need root privileges)

Code: Select all

/usr/share/nemo/actions/mint-artwork-cinnamon-thunderbird.nemo_action
I tested and it works for me. You could just delete it to...
Zavonen
Level 1
Level 1
Posts: 46
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Post by Zavonen »

I tested and it works for me. You could just delete it to...
Thank you very much !
It works for me too.
spsmyth

Re: Nemo 'send by email' option

Post by spsmyth »

Zavonen wrote:Finally I was successful to write a nemo action with two files in ~/.local/share/nemo/actions
file evolution.nemo_action

Code: Select all

[Nemo Action]
Active=true
Name=Envoyer par Evolution 
Comment=Les fichiers selectionnes seront envoyés par courrier
#Exec=evolution mailto:""?subject="Envoi de fichier"\&body="fichier ci-joint"\&attach="%U" 
Exec=<myaction.py %P %F>
Icon-Name=evolution
Selection=Any
Extensions=any
file myaction.py (python script)

Code: Select all

#! /usr/bin/env python 
import sys 
import os
L=sys.argv[2:]
command='evolution mailto:""?subject="envoi de documents"\&body="fichiers joints"'
for f in L:
    command=command+'\&attach=\"'+f+"\""
os.system(command)   
IT works I can send several files together using my default mail-client evolution ( receiver to be chosen in contact list). Exactly what I wanted.
But a few things remain mysterious:
I cannot rename python script in 'anyname.py'
with corresponding modification of action file. only myaction.py is responding as if a link has been established once for ever.
Here's what I've discovered in Mint 17.1. When I use the Nemo action as described pointing to the python script, nothing happens. When I comment out the line that points to the python script, and uncomment the Evolution command, it will work for one file. if I try to select multiple files, it says it can't find any of the selected files. I have since removed the quotation marks from around %U and now when I select multiple files, the first file is selected, and none of the others are, but no error messages appear. I assume I put the python script in the root of my home folder, so it's in my path, and the Nemo action should refer to the script.

Here's my question to all, as I am (almost) a complete noob, but willing to learn. Is there an Evolution shell command that will select multiple files from the directory you're in at the time? Can we use this in the Nemo action? I have tried pretty much everything I can think of. Please tell me what I'm doing wrong so I can do it right.

In my testing I have changed the email address so you could use multiple action scripts to attach files to specific recipients or groups. Personally, I think the Send Mail action should be tied to the default mail client, as others have pointed out. My mail is IMAP so I could set up Thunderbird and use it only for sending from Nemo, but this is a bit of a kludge.

The reason why I want to use Evolution is it supports caldav and carddav and I use iCloud which supports both. T-bird is great for mail, and is almost instant set up when you know your parameters, but the address system can't use carddav. Deal breaker.

--Steve
rkabelich

Re: Nemo 'send by email' option

Post by rkabelich »

OS: Mint 17 Cinnamon 64-bit
Cinnamon: 2.2.16
Kernel: 3.13.0-24-generic

That's what I did:
- renamed mint-artwork-cinnamon-thunderbird.nemo_action to mint-artwork-cinnamon-thunderbird.nemo_action_
- created the file
evolution.nemo_action in /usr/share/nemo/actions with following content:

Code: Select all

[Nemo Action]
Name=Send file as email
Comment=Send a single file as email
Exec=evolution mailto:""?subject=""\&body=""\&attach="%U"
Icon-Name=evolution
Selection=Any
Extensions=any
Works without a separate myaction.py file. Well, for a single file only but it works. Who wants to send more files than one may drag&drop them into the opened attachment box.
zerubbabel
Level 2
Level 2
Posts: 72
Joined: Tue Oct 04, 2011 5:47 pm

Re: Nemo 'send by email' option

Post by zerubbabel »

This is all fine and good, but has anyone just reported this as a bug? Surely Nemo should just honor the Mail setting in Preferred Applications and not require tinkering!
Locked

Return to “Beginner Questions”