2007-03-09 [paul] 2.8.1cvs5
authorPaul Mangan <paul@claws-mail.org>
Fri, 9 Mar 2007 09:16:38 +0000 (09:16 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 9 Mar 2007 09:16:38 +0000 (09:16 +0000)
* tools/Makefile.am
* tools/README
* tools/claws-mail-compose-insert-files.pl
added a script which enables inserting files
into the message body of a new Claws Mail
Compose window from the command line. Additionally
To, Cc, Subject and files to attach to the message
can be specified.

ChangeLog
PATCHSETS
configure.ac
tools/Makefile.am
tools/README
tools/claws-mail-compose-insert-files.pl [new file with mode: 0644]

index 9070a20269fe4ac900e7c21149a1481a71b407c4..7e49e8adff8b1c2a362da76c87a6db6b6605c96c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-03-09 [paul]      2.8.1cvs5
+
+       * tools/Makefile.am
+       * tools/README
+       * tools/claws-mail-compose-insert-files.pl
+               added a script which enables inserting files
+               into the message body of a new Claws Mail
+               Compose window from the command line. Additionally
+               To, Cc, Subject and files to attach to the message
+               can be specified.
+
 2007-03-09 [wwp]       2.8.1cvs4
 
        * src/addr_compl.c
index 948f8859e94a2f7e518da2208837c087fea8957f..ec73c0bf22c1151d55bda796fcd548c0dc1dc8bf 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.5.2.54 -r 1.5.2.55 src/gtk/gtkutils.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/plugins/trayicon/trayicon_prefs.h;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/trayicon/trayicon_prefs.c;  cvs diff -u -r 1.14.2.52 -r 1.14.2.53 src/plugins/trayicon/trayicon.c;  cvs diff -u -r 1.39.2.32 -r 1.39.2.33 src/mainwindow.h;  cvs diff -u -r 1.274.2.176 -r 1.274.2.177 src/mainwindow.c;  ) > 2.8.1cvs2.patchset
 ( cvs diff -u -r 1.8.2.14 -r 1.8.2.15 src/quote_fmt.c;  cvs diff -u -r 1.8.2.8 -r 1.8.2.9 src/quote_fmt_lex.l;  cvs diff -u -r 1.22.2.27 -r 1.22.2.28 src/quote_fmt_parse.y;  ) > 2.8.1cvs3.patchset
 ( cvs diff -u -r 1.27.2.34 -r 1.27.2.35 src/addr_compl.c;  cvs diff -u -r 1.8.2.9 -r 1.8.2.10 src/addr_compl.h;  cvs diff -u -r 1.60.2.28 -r 1.60.2.29 src/filtering.c;  ) > 2.8.1cvs4.patchset
+( cvs diff -u -r 1.25.2.17 -r 1.25.2.18 tools/Makefile.am;  cvs diff -u -r 1.30.2.17 -r 1.30.2.18 tools/README;  diff -u /dev/null tools/claws-mail-compose-insert-files.pl;  ) > 2.8.1cvs5.patchset
index fee5db46af9447b5f7065afe35269c79beffaec3..f60ed7875e96f835943a1778e350ca48f04eef8c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=4
+EXTRA_VERSION=5
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5e0c9f09ef9355596a8f1a8dc1c764d8d096082e..ec8d38abf26b061e0a6e3df7ab8aff8284d4179b 100644 (file)
@@ -1,6 +1,7 @@
 EXTRA_TOOLS = \
        OOo2claws-mail.pl \
        acroread2claws-mail.pl \
+       claws-mail-compose-insert-files.pl \
        calypso_convert.pl \
        convert_mbox.pl \
        eud2gc.py \
index e385ba262e24462943d329370d5c8f1afbf7fc90..b98c6654b373047ce444224638080e43629ef553 100644 (file)
@@ -29,6 +29,8 @@ Mailbox conversion:
 
 Other tools:
   acroread2claws-mail.pl       Send PDFs from Adobe Reader 7
+  claws-mail-compose-insert-files.pl
+                               Insert files into a new Compose window
   filter_conv_new.pl           Convert new-style Sylpheed filters to filtering
   filter_conv.pl                Convert old-style Sylpheed filters to filtering
   fix-date.sh                  Replace/Add a message's Date field
@@ -409,6 +411,26 @@ Other tools
   
   Contact: Paul Mangan <paul@claws-mail.org>
 
+* claws-mail-compose-insert-files.pl
+
+  WHAT IT DOES
+       This script enables inserting files into the message body of a new 
+       Claws Mail Compose window from the command line. Additionally To,
+       Cc, Subject and files to attach to the message can be specified. 
+
+  HOW TO USE IT
+       claws-mail-compose-insert-files.pl [options]
+       Options:
+               --help -h
+               --to mail@address.net[,mail2@address.net]
+               --cc mail@address.net[,mail2@address.net]
+               --subject "My subject"
+               --attach FILE
+               --insert FILE
+
+       --attach and --insert can be used multiple times
+  
+  Contact: Paul Mangan <paul@claws-mail.org>
 
 * filter_conv_new.pl
 
diff --git a/tools/claws-mail-compose-insert-files.pl b/tools/claws-mail-compose-insert-files.pl
new file mode 100644 (file)
index 0000000..8a87600
--- /dev/null
@@ -0,0 +1,88 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use Getopt::Long;
+use URI::Escape;
+
+#  * This file is free software; you can redistribute it and/or modify it
+#  * under the terms of the GNU General Public License as published by
+#  * the Free Software Foundation; either version 2 of the License, or
+#  * (at your option) any later version.
+#  *
+#  * This program is distributed in the hope that it will be useful, but
+#  * WITHOUT ANY WARRANTY; without even the implied warranty of
+#  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  * General Public License for more details.
+#  *
+#  * You should have received a copy of the GNU General Public License
+#  * along with this program; if not, write to the Free Software
+#  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#  *
+#  * Copyright 2007 Paul Mangan <paul@claws-mail.org>
+#  *
+
+# This script enables inserting files into the message body of a new Claws Mail
+# Compose window from the command line. Additionally To, Cc, Subject and files
+# to attach to the message can be specified 
+
+my (@inserts,@attachments,@lines,@output) = ();
+my $body = "";
+my $attach_list = "";
+my $to = "";
+my $cc = "";
+my $subject = "";
+my $help = "";
+
+GetOptions("to=s"      => \$to,
+          "cc=s"      => \$cc,
+          "subject=s" => \$subject,
+          "attach=s"  => \@attachments,
+          "insert=s"  => \@inserts,
+          "help|h"    => \$help);
+
+if ($help) {
+       help_me();
+}
+
+@attachments = split(/,/, join(',', @attachments));
+@inserts = split(/,/, join(',', @inserts));
+
+foreach my $attach (@attachments) {
+       $attach_list .= "$attach ";
+}
+
+foreach my $insert (@inserts) {
+       open(FILE, "<$insert") || die("can't open file\n");
+               @lines = <FILE>;
+               push(@output, @lines);
+       close FILE;
+}
+
+foreach my $line (@output) {
+       $body .= "$line";
+}
+
+$body = uri_escape($body);
+
+system("claws-mail --compose \"mailto:$to?subject=$subject&cc=$cc&body=$body\" --attach $attach_list");
+
+exit;
+
+sub help_me {
+       print<<'EOH';
+Usage: 
+       claws-mail-compose-insert-files.pl [options]
+Options:
+       --help -h
+       --to mail@address.net[,mail2@address.net]
+       --cc mail@address.net[,mail2@address.net]
+       --subject "My subject"
+       --attach FILE
+       --insert FILE
+
+--attach and --insert can be used multiple times
+
+EOH
+exit;
+}