Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates Email in Draft but no attachment #73

Open
dkebler opened this issue Jan 15, 2019 · 3 comments
Open

Creates Email in Draft but no attachment #73

dkebler opened this issue Jan 15, 2019 · 3 comments
Labels

Comments

@dkebler
Copy link

dkebler commented Jan 15, 2019

Running Linux Mint 19 (Ubuntu 18.04 under hood) with nemo file manager. Installed latest gnome-gmail deb 2.5.6.

Set up as preferred ap. Send as Email nemo action works but

  1. the created draft does not have the file attached.
  2. The created draft has a label of `Sending but when I open the draft the subject is blank.

Can't tell the version of the gmail api but I assume it's the latest.

Let me know how to provide you logs or more info that will help track this down.
Does your app create it's own nemo action file? Maybe that's the problem?

@dkebler dkebler changed the title Creates Email in Draft but no attachement Creates Email in Draft but no attachment Jan 15, 2019
@dkebler
Copy link
Author

dkebler commented Jan 15, 2019

I'm guessing it's the nemo action

Exec=<send-by-mail.py %F>

which calls this python script

#!/usr/bin/python3 -OOt

import argparse
from itertools import chain
from subprocess import call

parser = argparse.ArgumentParser()
parser.add_argument('filelist', help='list of absolute paths separated by /#/')
args = parser.parse_args()

command = ['xdg-email'] + list(chain.from_iterable(('--attach', arg) for arg in args.filelist.split('/#/')))
call(command)

It uses xdg-email. Maybe xdg-email is the wrong tool or the command is bad. Is there a better more direct way to invoke gnome-gmail??

@dkebler
Copy link
Author

dkebler commented Jan 15, 2019

from command line seems like attaching a file is creating a parsing error?

this works
gnome-gmail "mailto:?Subject=Hello%20again"

but this gives error

$ gnome-gmail -r "testfiletosend"  "mailto:?Subject=Hello%20again"
Traceback (most recent call last):
  File "/usr/share/gnome-gmail/gnomegmail.py", line 1005, in <module>
    main()
  File "/usr/share/gnome-gmail/gnomegmail.py", line 979, in main
    from_address = fromFromMessage(message)
  File "/usr/share/gnome-gmail/gnomegmail.py", line 714, in fromFromMessage
    line = [x for x in message.split('\n') if 'FROM:' in x.upper()][0]
IndexError: list index out of range

@davesteele
Copy link
Owner

Is there a space in the name of the file that failed?

The "-r" option is not intended to be used that way. The attachment becomes part of the mailto:

gnome-mail "mailto:?subject=Hello%20again&attach=testfiletosend"

Either "attach" or "attachment" may be used. I'm not sure right now if a valid, fully formed recipient is required.

As a general rule, I use "xdg-open mailto:...". It would be interesting to know what the "command" is coming out of that script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants