tags 532082 patch
thanks

Here is a patch against the git repository, please have a look at it :)

Kindly,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
From b27fba7fdf0fb1bb404d503848361ba552b4f7b4 Mon Sep 17 00:00:00 2001
From: David Paleino <d.pale...@gmail.com>
Date: Sat, 6 Jun 2009 11:33:50 +0200
Subject: [PATCH] share/claws-recompose: added support for claws-mail as MUA; Closes: #532082

---
 debian/changelog      |    4 ++++
 reportbug/utils.py    |    2 ++
 setup.py              |    2 +-
 share/claws-recompose |   39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 1 deletions(-)
 create mode 100755 share/claws-recompose

diff --git a/debian/changelog b/debian/changelog
index 18cee88..f65daf4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -36,6 +36,10 @@ reportbug (4.5) UNRELEASED; urgency=low
     - check whether the progress bar is present or not before dropping it in
       the bug page; thanks to Arian Sanusi for the report; Closes: #530686
 
+  [ David Paleino ]
+  * share/claws-recompose:
+    - added support for claws-mail as MUA; Closes: #532082
+
  -- Sandro Tosi <mo...@debian.org>  Fri, 05 Jun 2009 13:20:04 +0200
 
 reportbug (4.4) unstable; urgency=low
diff --git a/reportbug/utils.py b/reportbug/utils.py
index fac6e8b..f8e03bd 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -756,6 +756,7 @@ MUA = {
     'mutt' : 'mutt -H',
     'mh' : '/usr/bin/mh/comp -use -file',
     'gnus' : 'REPORTBUG=%s emacs -l /usr/share/reportbug/reportbug.el -f tfheen-reportbug-insert-template',
+    'claws-mail' : '/usr/share/reportbug/claws-recompose',
     }
 MUA['nmh'] = MUA['mh']
 
@@ -763,6 +764,7 @@ MUAVERSION = {
     MUA['mutt'] : 'mutt -v',
     MUA['mh'] : '/usr/bin/mh/comp -use -file',
     MUA['gnus'] : 'emacs --version',
+    MUA['claws-mail'] : 'claws-mail --version',
     }
 
 def mua_is_supported(mua):
diff --git a/setup.py b/setup.py
index d09f08a..5e71f58 100755
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ setup(name='reportbug', version=reportbug.VERSION_NUMBER,
       author='reportbug maintainence team',
       author_email='reportbug-ma...@lists.alioth.debian.org',
       url='http://alioth.debian.org/projects/reportbug',
-      data_files=[('share/reportbug', ['share/handle_bugscript', 'share/reportbug.el']),
+      data_files=[('share/reportbug', ['share/handle_bugscript', 'share/reportbug.el', 'share/claws-recompose']),
                   ('share/bug/reportbug', ['share/presubj', 'share/script'])],
       license='MIT',
       packages=['reportbug','reportbug.ui'],
diff --git a/share/claws-recompose b/share/claws-recompose
new file mode 100755
index 0000000..5a61e50
--- /dev/null
+++ b/share/claws-recompose
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -W
+
+# Code by Federico Heinz <fhe...@vialibre.org.ar>
+# Minor fixes by David Paleino <d.pale...@gmail.com>
+
+use strict;
+use URI;
+
+die "Usage: $0 [<message file>]" unless 2 > @ARGV;
+
+my $to = undef;
+my %fields = ();
+my $lastHeader = undef;
+
+while (<>) {
+    chomp;
+    last if /^$/; #end of headers
+    ($fields{$lastHeader} .= " $1"), next if (defined($lastHeader) && /^\s+(.*)/);
+    die "Malformed header: $_" unless /([^\:]+)\:\s*(.*)/;
+    my ($header, $value) = ($1, $2);
+    ($lastHeader = undef), next unless $header =~ /to|cc|bcc|subject/i;
+    $lastHeader = lc $header;
+    $fields{$lastHeader} = $value; 
+}
+
+my $body = "";
+while (<>) {
+    $body .= $_;
+}
+$fields{'body'} = $body;
+
+die "Missing recipient" unless defined($fields{'to'});
+my $url = URI->new("mailto:".$fields{'to'});
+delete($fields{'to'});
+$url->query_form(\%fields);
+my $msg = "$url";
+$msg =~ s/\+/ /g;
+#print $url->as_string;
+exec "claws-mail", "--compose", $msg;
-- 
1.6.3.1

Attachment: signature.asc
Description: PGP signature

Reply via email to