Nemo 'send by email' option

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Zavonen
Level 1
Level 1
Posts: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Nemo 'send by email' option

Postby Zavonen » Tue Oct 07, 2014 1:58 am

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.

Zavonen
Level 1
Level 1
Posts: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Tue Oct 07, 2014 3:02 am

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: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Tue Oct 07, 2014 6:11 pm

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.

User avatar
anandrkris
Level 5
Level 5
Posts: 948
Joined: Fri Nov 16, 2012 1:13 am
Location: Chennai

Re: Nemo 'send by email' option

Postby anandrkris » Wed Oct 08, 2014 12:52 am

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
Cheers,
If there is a drive, there will be a path

Zavonen
Level 1
Level 1
Posts: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Wed Oct 08, 2014 2:57 am

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: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Wed Oct 08, 2014 4:15 am

The sample file provided didn't work.
BUT examples given in :
http://hatteras-blog.blogspot.com.es/2013/10/ejemplos-de-nuevas-acciones-en-el-menu.html
work perfectly !
Viva Espana !

User avatar
anandrkris
Level 5
Level 5
Posts: 948
Joined: Fri Nov 16, 2012 1:13 am
Location: Chennai

Re: Nemo 'send by email' option

Postby anandrkris » Wed Oct 08, 2014 4:26 am

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
Cheers,
If there is a drive, there will be a path

Zavonen
Level 1
Level 1
Posts: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Wed Oct 08, 2014 10:59 am

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: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Wed Oct 08, 2014 11:03 am

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.

User avatar
anandrkris
Level 5
Level 5
Posts: 948
Joined: Fri Nov 16, 2012 1:13 am
Location: Chennai

Re: Nemo 'send by email' option

Postby anandrkris » Wed Oct 08, 2014 11:13 pm

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.
Cheers,
If there is a drive, there will be a path

User avatar
Spearmint2
Level 13
Level 13
Posts: 4980
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: Nemo 'send by email' option

Postby Spearmint2 » Thu Oct 09, 2014 7:09 am

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,....

User avatar
anandrkris
Level 5
Level 5
Posts: 948
Joined: Fri Nov 16, 2012 1:13 am
Location: Chennai

Re: Nemo 'send by email' option

Postby anandrkris » Thu Oct 09, 2014 7:14 am

@Spearmint - Nemo has the application hard-coded as Thunderbid....so it doesnt pick up the default mail client...
Cheers,
If there is a drive, there will be a path

Zavonen
Level 1
Level 1
Posts: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Fri Oct 10, 2014 12:12 pm

.so it doesnt pick up the default mail client...

Yes, it's our problem.

User avatar
Spearmint2
Level 13
Level 13
Posts: 4980
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: Nemo 'send by email' option

Postby Spearmint2 » Fri Oct 10, 2014 1:17 pm

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.

You can use a caja (mate file manager) script to do this. Just create a text file in ~/.config/caja/scripts/ with the following:
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: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Sat Oct 11, 2014 6:29 pm

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.

User avatar
anandrkris
Level 5
Level 5
Posts: 948
Joined: Fri Nov 16, 2012 1:13 am
Location: Chennai

Re: Nemo 'send by email' option

Postby anandrkris » Sun Oct 12, 2014 1:14 am

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...
Cheers,
If there is a drive, there will be a path

Zavonen
Level 1
Level 1
Posts: 42
Joined: Wed Sep 17, 2014 7:54 am
Location: France

Re: Nemo 'send by email' option

Postby Zavonen » Sun Oct 12, 2014 4:58 am

I tested and it works for me. You could just delete it to...

Thank you very much !
It works for me too.

spsmyth
Level 1
Level 1
Posts: 2
Joined: Fri Aug 29, 2014 12:38 pm

Re: Nemo 'send by email' option

Postby spsmyth » Thu Dec 18, 2014 3:46 am

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
Level 1
Level 1
Posts: 1
Joined: Wed Apr 29, 2015 1:35 am

Re: Nemo 'send by email' option

Postby rkabelich » Wed Apr 29, 2015 2:10 am

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: 57
Joined: Tue Oct 04, 2011 5:47 pm

Re: Nemo 'send by email' option

Postby zerubbabel » Sat May 09, 2015 1:48 pm

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!


Return to “Newbie Questions”

Who is online

Users browsing this forum: Statik, stoffl and 14 guests