OK, so I thought bug 596066
(https://bugzilla.gnome.org/show_bug.cgi?id=596066) might be easy
enough for me, an admitted novice in C.
However, I can not for the life of me figure out why my call to
g_spawn_async throws a segfault every time. I would be most grateful
if someone could point out the problem (I'm sure it's a newbie error
on my part).
This patch has known problems. Due to the new import/export structure
(I think), it will only work on native .XCF files right now., and the
file must be saved. There is some legacy code from the original
sendmail plugin hanging around that isn't doing much. And the
segfault of course :) And finally, xdg-email is broken, and needs to
be patched in order for Evolution or Thunderbird to even accept
attachments. You can grab the patch for xdg-email from launchpad
(filed upstream also):
https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/408350
The git patch is attached.
Thanks!
Chris
PS - is there any reason to maintain backwards compatibility with the
original mail plugin? The attached patch was a heavy-handed attack
just to see if I could get it working with xdg-utils - I have not
really settled on the best approach yet.
From 099cf07983d1dbc82510952b2a2bce798b7ef62f Mon Sep 17 00:00:00 2001
From: Chris Mohler cr33...@gmail.com
Date: Sat, 3 Oct 2009 21:10:35 -0500
Subject: [PATCH] Update mail plugin to use xdg-email
This is a work-in-progress patch to use xdg-email instead of sendmail. There are known problems.
---
plug-ins/common/mail.c | 501 +++-
1 files changed, 30 insertions(+), 471 deletions(-)
diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c
index 8f5625a..19b8e71 100644
--- a/plug-ins/common/mail.c
+++ b/plug-ins/common/mail.c
@@ -102,8 +102,8 @@ static const guint8 mail_icon[] =
};
-#ifndef SENDMAIL
-#define SENDMAIL /usr/lib/sendmail
+#ifndef XDGEMAIL
+#define XDGEMAIL /usr/bin/xdg-email
#endif
#define BUFFER_SIZE 256
@@ -114,10 +114,6 @@ static const guint8 mail_icon[] =
typedef struct
{
gchar filename[BUFFER_SIZE];
- gchar receipt[BUFFER_SIZE];
- gchar from[BUFFER_SIZE];
- gchar subject[BUFFER_SIZE];
- gchar comment[BUFFER_SIZE];
} m_info;
@@ -128,26 +124,11 @@ static void run (const gchar *name,
gint *nreturn_vals,
GimpParam **return_vals);
-static GimpPDBStatusType save_image (const gchar *filename,
+static GimpPDBStatusType save_image (gchar *filename,
gint32image_ID,
gint32drawable_ID,
gint32run_mode);
-static gboolean save_dialog (void);
-static void mail_entry_callback (GtkWidget*widget,
-gchar*data);
-static void mesg_body_callback (GtkTextBuffer*buffer,
-gpointer data);
-
-static gboolean valid_file (const gchar *filename);
-static void create_headers (FILE *mailpipe);
-static gchar* find_extension (const gchar *filename);
-static gboolean to64 (const gchar *filename,
-FILE *outfile,
-GError **error);
-static FILE * sendmail_pipe(gchar **cmd,
-GPid *pid);
-
const GimpPlugInInfo PLUG_IN_INFO =
{
@@ -159,11 +140,9 @@ const GimpPlugInInfo PLUG_IN_INFO =
static m_info mail_info =
{
- , , , ,
+
};
-static gchar *mesg_body = NULL;
-
MAIN ()
@@ -176,16 +155,11 @@ query (void)
{ GIMP_PDB_IMAGE,image, Input image },
{ GIMP_PDB_DRAWABLE, drawable, Drawable to save },
{ GIMP_PDB_STRING, filename, The name of the file to save the image in },
-{ GIMP_PDB_STRING, to-address,The email address to send to },
-{ GIMP_PDB_STRING, from-address, The email address for the From: field },
-{ GIMP_PDB_STRING, subject, The subject },
-{ GIMP_PDB_STRING, comment, The Comment },
-{ GIMP_PDB_INT32,encapsulation, ignored }
};
gimp_install_procedure (PLUG_IN_PROC,
N_(Send the image by email),
- You need to have sendmail installed,
+ You need to have xdg-utils installed,
Adrian Likins, Reagan Blundell,
Adrian Likins, Reagan Blundell, Daniel Risacher,