GNOME Bugzilla – Bug 472715
Exporting photos to thunderbird doesn't seem to work (xdg-email support)
Last modified: 2018-07-01 08:55:32 UTC
Please describe the problem: When exporting a group of photos to mozilla-thunderbird the message is created with no attachments. The main problem seems to be with the command line arguments. I've attached a patch i used to get it to work with an older svn version of f-spot. The other problem is the strict filename requirements imposed on thunderbird...if I install from mozilla.org into my home folder, the f-spot email app determination fails and treats it as evolution style args, which is wrong. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Index: SendEmail.cs =================================================================== --- SendEmail.cs (revision 3104) +++ SendEmail.cs (working copy) @@ -242,7 +242,13 @@ // evaluate mailto command and define attachment args for cli System.Text.StringBuilder attach_arg = new System.Text.StringBuilder (); - switch (Preferences.Get (Preferences.GNOME_MAILTO_COMMAND) as string) { + + string mailPref = Preferences.Get (Preferences.GNOME_MAILTO_COMMAND) as string; + + System.Console.WriteLine(mailPref); + bool urlEncodeAttachments = false; + + switch (mailPref) { case "thunderbird %s": case "mozilla-thunderbird %s": case "seamonkey -mail -compose %s": @@ -254,6 +260,7 @@ break; default: //evolution falls into default, since it supports mailto uri correctly attach_arg.Append("&attach="); + urlEncodeAttachments = true; break; } @@ -299,7 +306,13 @@ filters.Convert (request); request.Preserve(request.Current); - mail_attach.Append(attach_arg.ToString() + System.Web.HttpUtility.UrlEncode (request.Current.ToString())); + if (mail_attach.Length > 0) + mail_attach.Append(attach_arg.ToString()); + + if (urlEncodeAttachments) + mail_attach.Append(System.Web.HttpUtility.UrlEncode (request.Current.ToString())); + else + mail_attach.Append(request.Current.ToString()); // Mark the path for deletion tmp_paths.Add (request.Current.LocalPath);
Forgot to mention that i'm assuming this code hasn't been heavily reworked in later versions of svn, also the Console.WriteLines were for my debugging benefit :) Cheers, Jae
*** Bug 472164 has been marked as a duplicate of this bug. ***
IT (almost) WORKED! There's an extra switch at line 323 which has to be converted to the new mailPref variable. I also had to add two extra lines mailPref = mailPref.Substring(mailPref.LastIndexOf(@"/") + 1); mailPref = mailPref.Replace("\"",""); in order to strip full path and "" from my mailto command, as my $ gconftool-2 --get /desktop/gnome/url-handlers/mailto/command returns: /usr/lib64/mozilla-thunderbird/thunderbird "%s" I don't know if it's the right approach, or if I should fix my mailto. Now there's another problem (but right now I'm too tired to go further): thunderbird reads the attachment only when you press the "Send" button, and it seems that when I did this the file was already removed.
Maxxer (comment #3): - I think you shouldn't have quotes in your default command. did you set that up by yourself or is it coming from your distro ? - about the removed images, the solution is documented in the user guide: Expert Tip: If you're sending resized pictures, F-Spot will keep the modified versions somewhere in the /tmp directory for 30 seconds. It's not an issue with evolution, which makes it's own local copy of the attachments, but could be a bit too shorte if you're using thunderbird. You can change the delay by editing the gconf key /apps/f-spot/export/email/delete_timeout_seconds.
(In reply to comment #4) > Maxxer (comment #3): > - I think you shouldn't have quotes in your default command. did you set that > up by yourself or is it coming from your distro ? it was a customized command (can't remember why). now I've restored it to the standard one. > - about the removed images, the solution is documented in the user guide: [...] > editing the gconf key /apps/f-spot/export/email/delete_timeout_seconds. modified, thanks! everything seems to work fine, with Jae's patch (and with the addition of the second modified switch). thanks
Have the changes made it to SVN? Will they? I'm wondering if it might be better to do some regular expressions or string.Contains instead of the switch to determine which emailer is being used. Thoughts? Maxxer, can you upload your changes as a new patch here?
Jae, Changes are not yet committed to svn cause I already had to change this code since we released 0.4.0 for another issue related to icedove/thunderbird. I first have to reproduce your issue as the current (svn) code _do_ work for me, even with tb.
Created attachment 94868 [details] [review] fspot-thunderbird.patch here's the patch which applies to the latest svn.
(In reply to comment #7) > Changes are not yet committed to svn cause I already had to change this code > since we released 0.4.0 for another issue related to icedove/thunderbird. > I first have to reproduce your issue as the current (svn) code _do_ work for > me, even with tb. I must admit that after fixing my gconf mailto key I didn't try a "clean" f-spot. I did it now (without the patch) and works for me too... So the patch is useless to me. Maybe, as Jae said, it would be useful to improve mailer check (switch).
(In reply to comment #4) > Maxxer (comment #3): > - I think you shouldn't have quotes in your default command. did you set that > up by yourself or is it coming from your distro ? Just for information, I found out that it's thunderbird itself who set the non-working-in-fspot mailto command, when confirmed that it should be the default mail program.
I doubt that tb itself changes the gconf key... but maybe the packager did that...
when tb starts it performs a check to see if it's the default mailer. after manually changing thru gnome conf the key, tb told me it wasn't the default mailer. I told it to restore the "situation", and the gconf key came back to the non working one.
I've just checked on Ubuntu 7.10. If you let Thunderbird set itself as default mailer, it places a customized command with the full path to the TB executable, thus making F-Spot not working. I believe the switch check must be turned to something like a substring or a regexp.
Created attachment 105389 [details] [review] mailer-be-more-flexible.patch i think this could be a solution. this patch gets the preference key, strips out the real command (like /usr/lib/thunderbird) and the mailer name (thunderbird). maybe it's a bit tricky, but allows f-spot to send mail to supported mailers even if the command string is not set to standard by Gnome.
Hm, wouldn't it be better to use xdg-email instead of doing all the mail client stuff in f-spot itself? Still there is an issue with thunderbird and attachments in xdg-email, so it whould have to be fixed there,too. But better fixing it in one place that benefits all than doing the same task in several apps.
Created attachment 106853 [details] [review] xdg-mailer-support.patch patch for xdg-email command support. even thought it's better, i don't know if it's worth committing it, since xdg-email is not actually working with thunderbird! :( I still think that the mailer-be-more-flexible patch is also needed.
Created attachment 106857 [details] [review] xdg-mailer-support.patch added changelog
There is already a patch for xdg-email that adds attachment support for thunderbird: http://bugs.freedesktop.org/show_bug.cgi?id=13435 If this would be integrated it would solve f-spot's problem as well.
*** Bug 561308 has been marked as a duplicate of this bug. ***
*** Bug 603364 has been marked as a duplicate of this bug. ***
Comment on attachment 105389 [details] [review] mailer-be-more-flexible.patch Maintenance update: In the past we've been less than stellar in reviewing patches. As such we have a pile of patches in bugzilla which are outdated and don't apply anymore. Am currently marking all of these as "needs-work". My apologies for this. Since I've become a maintainer of the project, I've set the personal rule of quickly reviewing all patches, to avoid that this happens again. If you (or anyone) wants to go through the trouble of updating this patch, please talk to us to figure out if it fits in the F-Spot long term roadmap. Should you, in the future, notice a patch lingering around for too long, please notify us immediately and we'll look into it, to avoid situations like these from happening again. You can filter these mails by searching for ###F-OLDPATCHCLEANUP###
Comment on attachment 106857 [details] [review] xdg-mailer-support.patch Maintenance update: In the past we've been less than stellar in reviewing patches. As such we have a pile of patches in bugzilla which are outdated and don't apply anymore. Am currently marking all of these as "needs-work". My apologies for this. Since I've become a maintainer of the project, I've set the personal rule of quickly reviewing all patches, to avoid that this happens again. If you (or anyone) wants to go through the trouble of updating this patch, please talk to us to figure out if it fits in the F-Spot long term roadmap. Should you, in the future, notice a patch lingering around for too long, please notify us immediately and we'll look into it, to avoid situations like these from happening again. You can filter these mails by searching for ###F-OLDPATCHCLEANUP###
f-spot is not under active development anymore, has not seen code changes for five years, and saw its last tarball release in the year 2010. Its codebase has been archived: https://gitlab.gnome.org/Archive/f-spot/commits/master Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.