After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 472715 - Exporting photos to thunderbird doesn't seem to work (xdg-email support)
Exporting photos to thunderbird doesn't seem to work (xdg-email support)
Status: RESOLVED WONTFIX
Product: f-spot
Classification: Other
Component: General
0.4.x
Other All
: Normal normal
: ---
Assigned To: F-spot maintainers
F-spot maintainers
gnome[unmaintained]
: 472164 561308 603364 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-09-02 02:12 UTC by Jae Stutzman
Modified: 2018-07-01 08:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fspot-thunderbird.patch (2.03 KB, patch)
2007-09-03 16:09 UTC, Maxxer
none Details | Review
mailer-be-more-flexible.patch (3.41 KB, patch)
2008-02-16 16:36 UTC, Maxxer
needs-work Details | Review
xdg-mailer-support.patch (3.15 KB, patch)
2008-03-08 17:11 UTC, Maxxer
none Details | Review
xdg-mailer-support.patch (3.51 KB, patch)
2008-03-08 17:26 UTC, Maxxer
needs-work Details | Review

Description Jae Stutzman 2007-09-02 02:12:00 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);
Comment 1 Jae Stutzman 2007-09-02 02:15:16 UTC
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
Comment 2 Stephane Delcroix 2007-09-02 09:45:18 UTC
*** Bug 472164 has been marked as a duplicate of this bug. ***
Comment 3 Maxxer 2007-09-02 22:05:00 UTC
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.
Comment 4 Stephane Delcroix 2007-09-03 08:13:18 UTC
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.

Comment 5 Maxxer 2007-09-03 09:01:57 UTC
(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
Comment 6 Jae Stutzman 2007-09-03 15:18:39 UTC
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?
Comment 7 Stephane Delcroix 2007-09-03 16:06:14 UTC
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.
Comment 8 Maxxer 2007-09-03 16:09:17 UTC
Created attachment 94868 [details] [review]
fspot-thunderbird.patch

here's the patch which applies to the latest svn.
Comment 9 Maxxer 2007-09-03 16:38:02 UTC
(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). 

Comment 10 Maxxer 2007-09-03 17:32:34 UTC
(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.
Comment 11 Stephane Delcroix 2007-09-03 19:45:10 UTC
I doubt that tb itself changes the gconf key... but maybe the packager did that...
Comment 12 Maxxer 2007-09-03 21:33:47 UTC
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.
Comment 13 Maxxer 2007-11-12 16:18:01 UTC
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.
Comment 14 Maxxer 2008-02-16 16:36:19 UTC
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.
Comment 15 Frederik Elwert 2008-02-27 18:30:10 UTC
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.
Comment 16 Maxxer 2008-03-08 17:11:25 UTC
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.
Comment 17 Maxxer 2008-03-08 17:26:55 UTC
Created attachment 106857 [details] [review]
xdg-mailer-support.patch

added changelog
Comment 18 Frederik Elwert 2008-03-09 11:31:14 UTC
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.
Comment 19 Maxxer 2008-11-18 17:29:18 UTC
*** Bug 561308 has been marked as a duplicate of this bug. ***
Comment 20 Maxxer 2010-01-09 21:16:36 UTC
*** Bug 603364 has been marked as a duplicate of this bug. ***
Comment 21 Ruben Vermeersch 2010-06-24 14:45:24 UTC
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 22 Ruben Vermeersch 2010-06-24 14:45:27 UTC
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###
Comment 23 André Klapper 2018-07-01 08:55:32 UTC
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.