summaryrefslogtreecommitdiff
path: root/plugin/attachment_tool
diff options
context:
space:
mode:
authorSimeon Simeonov2018-02-26 11:23:00 +0100
committerSimeon Simeonov2018-02-26 11:23:00 +0100
commit0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (patch)
treeaf916a30553c78ce9d4f2d8658656a175c5b6921 /plugin/attachment_tool
Initial commit for sylpheed 3.7.0
Diffstat (limited to 'plugin/attachment_tool')
-rw-r--r--plugin/attachment_tool/Makefile.am20
-rw-r--r--plugin/attachment_tool/Makefile.in711
-rw-r--r--plugin/attachment_tool/README26
-rw-r--r--plugin/attachment_tool/attachment_tool.c302
4 files changed, 1059 insertions, 0 deletions
diff --git a/plugin/attachment_tool/Makefile.am b/plugin/attachment_tool/Makefile.am
new file mode 100644
index 0000000..81079b6
--- /dev/null
+++ b/plugin/attachment_tool/Makefile.am
@@ -0,0 +1,20 @@
1libdir = $(plugindir)
2
3lib_LTLIBRARIES = attachment_tool.la
4
5attachment_tool_la_SOURCES = attachment_tool.c
6attachment_tool_la_LDFLAGS = -module -no-undefined -avoid-version
7
8INCLUDES = \
9 -I$(top_srcdir) \
10 -I$(top_srcdir)/libsylph \
11 -I$(top_srcdir)/src \
12 $(GTK_CFLAGS)
13
14attachment_tool_la_LIBADD = \
15 $(GTK_LIBS) \
16 $(top_builddir)/src/libsylpheed-plugin-0.la \
17 $(top_builddir)/libsylph/libsylph-0.la
18
19install:
20install-plugin: install-am
diff --git a/plugin/attachment_tool/Makefile.in b/plugin/attachment_tool/Makefile.in
new file mode 100644
index 0000000..0cdead8
--- /dev/null
+++ b/plugin/attachment_tool/Makefile.in
@@ -0,0 +1,711 @@
1# Makefile.in generated by automake 1.14.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15@SET_MAKE@
16
17VPATH = @srcdir@
18am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
19am__make_running_with_option = \
20 case $${target_option-} in \
21 ?) ;; \
22 *) echo "am__make_running_with_option: internal error: invalid" \
23 "target option '$${target_option-}' specified" >&2; \
24 exit 1;; \
25 esac; \
26 has_opt=no; \
27 sane_makeflags=$$MAKEFLAGS; \
28 if $(am__is_gnu_make); then \
29 sane_makeflags=$$MFLAGS; \
30 else \
31 case $$MAKEFLAGS in \
32 *\\[\ \ ]*) \
33 bs=\\; \
34 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
35 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
36 esac; \
37 fi; \
38 skip_next=no; \
39 strip_trailopt () \
40 { \
41 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
42 }; \
43 for flg in $$sane_makeflags; do \
44 test $$skip_next = yes && { skip_next=no; continue; }; \
45 case $$flg in \
46 *=*|--*) continue;; \
47 -*I) strip_trailopt 'I'; skip_next=yes;; \
48 -*I?*) strip_trailopt 'I';; \
49 -*O) strip_trailopt 'O'; skip_next=yes;; \
50 -*O?*) strip_trailopt 'O';; \
51 -*l) strip_trailopt 'l'; skip_next=yes;; \
52 -*l?*) strip_trailopt 'l';; \
53 -[dEDm]) skip_next=yes;; \
54 -[JT]) skip_next=yes;; \
55 esac; \
56 case $$flg in \
57 *$$target_option*) has_opt=yes; break;; \
58 esac; \
59 done; \
60 test $$has_opt = yes
61am__make_dryrun = (target_option=n; $(am__make_running_with_option))
62am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
63pkgdatadir = $(datadir)/@PACKAGE@
64pkgincludedir = $(includedir)/@PACKAGE@
65pkglibdir = $(libdir)/@PACKAGE@
66pkglibexecdir = $(libexecdir)/@PACKAGE@
67am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
68install_sh_DATA = $(install_sh) -c -m 644
69install_sh_PROGRAM = $(install_sh) -c
70install_sh_SCRIPT = $(install_sh) -c
71INSTALL_HEADER = $(INSTALL_DATA)
72transform = $(program_transform_name)
73NORMAL_INSTALL = :
74PRE_INSTALL = :
75POST_INSTALL = :
76NORMAL_UNINSTALL = :
77PRE_UNINSTALL = :
78POST_UNINSTALL = :
79build_triplet = @build@
80host_triplet = @host@
81target_triplet = @target@
82subdir = plugin/attachment_tool
83DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
84 $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README
85ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
86am__aclocal_m4_deps = $(top_srcdir)/ac/aclocal-include.m4 \
87 $(top_srcdir)/ac/gnupg-check-typedef.m4 \
88 $(top_srcdir)/configure.ac
89am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
90 $(ACLOCAL_M4)
91mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
92CONFIG_HEADER = $(top_builddir)/config.h
93CONFIG_CLEAN_FILES =
94CONFIG_CLEAN_VPATH_FILES =
95am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
96am__vpath_adj = case $$p in \
97 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
98 *) f=$$p;; \
99 esac;
100am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
101am__install_max = 40
102am__nobase_strip_setup = \
103 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
104am__nobase_strip = \
105 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
106am__nobase_list = $(am__nobase_strip_setup); \
107 for p in $$list; do echo "$$p $$p"; done | \
108 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
109 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
110 if (++n[$$2] == $(am__install_max)) \
111 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
112 END { for (dir in files) print dir, files[dir] }'
113am__base_list = \
114 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
115 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
116am__uninstall_files_from_dir = { \
117 test -z "$$files" \
118 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
119 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
120 $(am__cd) "$$dir" && rm -f $$files; }; \
121 }
122am__installdirs = "$(DESTDIR)$(libdir)"
123LTLIBRARIES = $(lib_LTLIBRARIES)
124am__DEPENDENCIES_1 =
125attachment_tool_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
126 $(top_builddir)/src/libsylpheed-plugin-0.la \
127 $(top_builddir)/libsylph/libsylph-0.la
128am_attachment_tool_la_OBJECTS = attachment_tool.lo
129attachment_tool_la_OBJECTS = $(am_attachment_tool_la_OBJECTS)
130AM_V_lt = $(am__v_lt_@AM_V@)
131am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
132am__v_lt_0 = --silent
133am__v_lt_1 =
134attachment_tool_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
135 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
136 $(AM_CFLAGS) $(CFLAGS) $(attachment_tool_la_LDFLAGS) \
137 $(LDFLAGS) -o $@
138AM_V_P = $(am__v_P_@AM_V@)
139am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
140am__v_P_0 = false
141am__v_P_1 = :
142AM_V_GEN = $(am__v_GEN_@AM_V@)
143am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
144am__v_GEN_0 = @echo " GEN " $@;
145am__v_GEN_1 =
146AM_V_at = $(am__v_at_@AM_V@)
147am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
148am__v_at_0 = @
149am__v_at_1 =
150DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
151depcomp = $(SHELL) $(top_srcdir)/depcomp
152am__depfiles_maybe = depfiles
153am__mv = mv -f
154COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
155 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
156LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
157 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
158 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
159 $(AM_CFLAGS) $(CFLAGS)
160AM_V_CC = $(am__v_CC_@AM_V@)
161am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
162am__v_CC_0 = @echo " CC " $@;
163am__v_CC_1 =
164CCLD = $(CC)
165LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
166 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
167 $(AM_LDFLAGS) $(LDFLAGS) -o $@
168AM_V_CCLD = $(am__v_CCLD_@AM_V@)
169am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
170am__v_CCLD_0 = @echo " CCLD " $@;
171am__v_CCLD_1 =
172SOURCES = $(attachment_tool_la_SOURCES)
173DIST_SOURCES = $(attachment_tool_la_SOURCES)
174am__can_run_installinfo = \
175 case $$AM_UPDATE_INFO_DIR in \
176 n|no|NO) false;; \
177 *) (install-info --version) >/dev/null 2>&1;; \
178 esac
179am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
180# Read a list of newline-separated strings from the standard input,
181# and print each of them once, without duplicates. Input order is
182# *not* preserved.
183am__uniquify_input = $(AWK) '\
184 BEGIN { nonempty = 0; } \
185 { items[$$0] = 1; nonempty = 1; } \
186 END { if (nonempty) { for (i in items) print i; }; } \
187'
188# Make sure the list of sources is unique. This is necessary because,
189# e.g., the same source file might be shared among _SOURCES variables
190# for different programs/libraries.
191am__define_uniq_tagged_files = \
192 list='$(am__tagged_files)'; \
193 unique=`for i in $$list; do \
194 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
195 done | $(am__uniquify_input)`
196ETAGS = etags
197CTAGS = ctags
198DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
199ACLOCAL = @ACLOCAL@
200ALLOCA = @ALLOCA@
201AMTAR = @AMTAR@
202AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
203AR = @AR@
204AUTOCONF = @AUTOCONF@
205AUTOHEADER = @AUTOHEADER@
206AUTOMAKE = @AUTOMAKE@
207AWK = @AWK@
208BUILD_REVISION = @BUILD_REVISION@
209CATALOGS = @CATALOGS@
210CATOBJEXT = @CATOBJEXT@
211CC = @CC@
212CCDEPMODE = @CCDEPMODE@
213CFLAGS = @CFLAGS@
214CPP = @CPP@
215CPPFLAGS = @CPPFLAGS@
216CYGPATH_W = @CYGPATH_W@
217DATADIRNAME = @DATADIRNAME@
218DEFS = @DEFS@
219DEPDIR = @DEPDIR@
220DEVEL_VERSION = @DEVEL_VERSION@
221DLLTOOL = @DLLTOOL@
222DSYMUTIL = @DSYMUTIL@
223DUMPBIN = @DUMPBIN@
224ECHO_C = @ECHO_C@
225ECHO_N = @ECHO_N@
226ECHO_T = @ECHO_T@
227EGREP = @EGREP@
228EXEEXT = @EXEEXT@
229EXTRA_VERSION = @EXTRA_VERSION@
230FGREP = @FGREP@
231GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
232GLIB_CFLAGS = @GLIB_CFLAGS@
233GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
234GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
235GLIB_LIBS = @GLIB_LIBS@
236GLIB_MKENUMS = @GLIB_MKENUMS@
237GMOFILES = @GMOFILES@
238GMSGFMT = @GMSGFMT@
239GOBJECT_QUERY = @GOBJECT_QUERY@
240GPGME_CFLAGS = @GPGME_CFLAGS@
241GPGME_CONFIG = @GPGME_CONFIG@
242GPGME_LIBS = @GPGME_LIBS@
243GREP = @GREP@
244GTK_CFLAGS = @GTK_CFLAGS@
245GTK_LIBS = @GTK_LIBS@
246INSTALL = @INSTALL@
247INSTALL_DATA = @INSTALL_DATA@
248INSTALL_PROGRAM = @INSTALL_PROGRAM@
249INSTALL_SCRIPT = @INSTALL_SCRIPT@
250INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
251INSTOBJEXT = @INSTOBJEXT@
252INTLLIBS = @INTLLIBS@
253LD = @LD@
254LDAP_LIBS = @LDAP_LIBS@
255LDFLAGS = @LDFLAGS@
256LEX = @LEX@
257LEXLIB = @LEXLIB@
258LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
259LIBICONV = @LIBICONV@
260LIBOBJS = @LIBOBJS@
261LIBS = @LIBS@
262LIBSYLPH_CFLAGS = @LIBSYLPH_CFLAGS@
263LIBSYLPH_LIBS = @LIBSYLPH_LIBS@
264LIBTOOL = @LIBTOOL@
265LIPO = @LIPO@
266LN_S = @LN_S@
267LTLIBICONV = @LTLIBICONV@
268LTLIBOBJS = @LTLIBOBJS@
269LT_AGE = @LT_AGE@
270LT_CURRENT = @LT_CURRENT@
271LT_RELEASE = @LT_RELEASE@
272LT_REVISION = @LT_REVISION@
273MAINT = @MAINT@
274MAJOR_VERSION = @MAJOR_VERSION@
275MAKEINFO = @MAKEINFO@
276MANIFEST_TOOL = @MANIFEST_TOOL@
277MICRO_VERSION = @MICRO_VERSION@
278MINOR_VERSION = @MINOR_VERSION@
279MKDIR_P = @MKDIR_P@
280MKINSTALLDIRS = @MKINSTALLDIRS@
281MSGFMT = @MSGFMT@
282MSGFMT_OPTS = @MSGFMT_OPTS@
283NM = @NM@
284NMEDIT = @NMEDIT@
285OBJDUMP = @OBJDUMP@
286OBJEXT = @OBJEXT@
287OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
288OPENSSL_LIBS = @OPENSSL_LIBS@
289OTOOL = @OTOOL@
290OTOOL64 = @OTOOL64@
291PACKAGE = @PACKAGE@
292PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
293PACKAGE_NAME = @PACKAGE_NAME@
294PACKAGE_STRING = @PACKAGE_STRING@
295PACKAGE_TARNAME = @PACKAGE_TARNAME@
296PACKAGE_URL = @PACKAGE_URL@
297PACKAGE_VERSION = @PACKAGE_VERSION@
298PATH_SEPARATOR = @PATH_SEPARATOR@
299PKG_CONFIG = @PKG_CONFIG@
300PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
301PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
302POFILES = @POFILES@
303POSUB = @POSUB@
304PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
305PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
306RANLIB = @RANLIB@
307SED = @SED@
308SET_MAKE = @SET_MAKE@
309SHELL = @SHELL@
310STRIP = @STRIP@
311SYLPHEED_LIBS = @SYLPHEED_LIBS@
312USE_NLS = @USE_NLS@
313VERSION = @VERSION@
314WINDRES = @WINDRES@
315XGETTEXT = @XGETTEXT@
316YACC = @YACC@
317YFLAGS = @YFLAGS@
318abs_builddir = @abs_builddir@
319abs_srcdir = @abs_srcdir@
320abs_top_builddir = @abs_top_builddir@
321abs_top_srcdir = @abs_top_srcdir@
322ac_ct_AR = @ac_ct_AR@
323ac_ct_CC = @ac_ct_CC@
324ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
325am__include = @am__include@
326am__leading_dot = @am__leading_dot@
327am__quote = @am__quote@
328am__tar = @am__tar@
329am__untar = @am__untar@
330bindir = @bindir@
331build = @build@
332build_alias = @build_alias@
333build_cpu = @build_cpu@
334build_os = @build_os@
335build_vendor = @build_vendor@
336builddir = @builddir@
337datadir = @datadir@
338datarootdir = @datarootdir@
339docdir = @docdir@
340dvidir = @dvidir@
341exec_prefix = @exec_prefix@
342faqdir = @faqdir@
343host = @host@
344host_alias = @host_alias@
345host_cpu = @host_cpu@
346host_os = @host_os@
347host_vendor = @host_vendor@
348htmldir = @htmldir@
349includedir = @includedir@
350infodir = @infodir@
351install_sh = @install_sh@
352libdir = $(plugindir)
353libexecdir = @libexecdir@
354localedir = @localedir@
355localstatedir = @localstatedir@
356mandir = @mandir@
357manualdir = @manualdir@
358mkdir_p = @mkdir_p@
359oldincludedir = @oldincludedir@
360pdfdir = @pdfdir@
361plugindir = @plugindir@
362prefix = @prefix@
363program_transform_name = @program_transform_name@
364psdir = @psdir@
365sbindir = @sbindir@
366sharedstatedir = @sharedstatedir@
367srcdir = @srcdir@
368sysconfdir = @sysconfdir@
369target = @target@
370target_alias = @target_alias@
371target_cpu = @target_cpu@
372target_os = @target_os@
373target_vendor = @target_vendor@
374themedir = @themedir@
375top_build_prefix = @top_build_prefix@
376top_builddir = @top_builddir@
377top_srcdir = @top_srcdir@
378lib_LTLIBRARIES = attachment_tool.la
379attachment_tool_la_SOURCES = attachment_tool.c
380attachment_tool_la_LDFLAGS = -module -no-undefined -avoid-version
381INCLUDES = \
382 -I$(top_srcdir) \
383 -I$(top_srcdir)/libsylph \
384 -I$(top_srcdir)/src \
385 $(GTK_CFLAGS)
386
387attachment_tool_la_LIBADD = \
388 $(GTK_LIBS) \
389 $(top_builddir)/src/libsylpheed-plugin-0.la \
390 $(top_builddir)/libsylph/libsylph-0.la
391
392all: all-am
393
394.SUFFIXES:
395.SUFFIXES: .c .lo .o .obj
396$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
397 @for dep in $?; do \
398 case '$(am__configure_deps)' in \
399 *$$dep*) \
400 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
401 && { if test -f $@; then exit 0; else break; fi; }; \
402 exit 1;; \
403 esac; \
404 done; \
405 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugin/attachment_tool/Makefile'; \
406 $(am__cd) $(top_srcdir) && \
407 $(AUTOMAKE) --foreign plugin/attachment_tool/Makefile
408.PRECIOUS: Makefile
409Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
410 @case '$?' in \
411 *config.status*) \
412 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
413 *) \
414 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
415 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
416 esac;
417
418$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
419 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
420
421$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
422 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
423$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
424 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
425$(am__aclocal_m4_deps):
426
427install-libLTLIBRARIES: $(lib_LTLIBRARIES)
428 @$(NORMAL_INSTALL)
429 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
430 list2=; for p in $$list; do \
431 if test -f $$p; then \
432 list2="$$list2 $$p"; \
433 else :; fi; \
434 done; \
435 test -z "$$list2" || { \
436 echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
437 $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
438 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
439 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
440 }
441
442uninstall-libLTLIBRARIES:
443 @$(NORMAL_UNINSTALL)
444 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
445 for p in $$list; do \
446 $(am__strip_dir) \
447 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
448 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
449 done
450
451clean-libLTLIBRARIES:
452 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
453 @list='$(lib_LTLIBRARIES)'; \
454 locs=`for p in $$list; do echo $$p; done | \
455 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
456 sort -u`; \
457 test -z "$$locs" || { \
458 echo rm -f $${locs}; \
459 rm -f $${locs}; \
460 }
461
462attachment_tool.la: $(attachment_tool_la_OBJECTS) $(attachment_tool_la_DEPENDENCIES) $(EXTRA_attachment_tool_la_DEPENDENCIES)
463 $(AM_V_CCLD)$(attachment_tool_la_LINK) -rpath $(libdir) $(attachment_tool_la_OBJECTS) $(attachment_tool_la_LIBADD) $(LIBS)
464
465mostlyclean-compile:
466 -rm -f *.$(OBJEXT)
467
468distclean-compile:
469 -rm -f *.tab.c
470
471@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attachment_tool.Plo@am__quote@
472
473.c.o:
474@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
475@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
476@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
477@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
478@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
479
480.c.obj:
481@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
482@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
483@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
484@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
485@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
486
487.c.lo:
488@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
489@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
490@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
491@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
492@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
493
494mostlyclean-libtool:
495 -rm -f *.lo
496
497clean-libtool:
498 -rm -rf .libs _libs
499
500ID: $(am__tagged_files)
501 $(am__define_uniq_tagged_files); mkid -fID $$unique
502tags: tags-am
503TAGS: tags
504
505tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
506 set x; \
507 here=`pwd`; \
508 $(am__define_uniq_tagged_files); \
509 shift; \
510 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
511 test -n "$$unique" || unique=$$empty_fix; \
512 if test $$# -gt 0; then \
513 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
514 "$$@" $$unique; \
515 else \
516 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
517 $$unique; \
518 fi; \
519 fi
520ctags: ctags-am
521
522CTAGS: ctags
523ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
524 $(am__define_uniq_tagged_files); \
525 test -z "$(CTAGS_ARGS)$$unique" \
526 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
527 $$unique
528
529GTAGS:
530 here=`$(am__cd) $(top_builddir) && pwd` \
531 && $(am__cd) $(top_srcdir) \
532 && gtags -i $(GTAGS_ARGS) "$$here"
533cscopelist: cscopelist-am
534
535cscopelist-am: $(am__tagged_files)
536 list='$(am__tagged_files)'; \
537 case "$(srcdir)" in \
538 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
539 *) sdir=$(subdir)/$(srcdir) ;; \
540 esac; \
541 for i in $$list; do \
542 if test -f "$$i"; then \
543 echo "$(subdir)/$$i"; \
544 else \
545 echo "$$sdir/$$i"; \
546 fi; \
547 done >> $(top_builddir)/cscope.files
548
549distclean-tags:
550 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
551
552distdir: $(DISTFILES)
553 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
554 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
555 list='$(DISTFILES)'; \
556 dist_files=`for file in $$list; do echo $$file; done | \
557 sed -e "s|^$$srcdirstrip/||;t" \
558 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
559 case $$dist_files in \
560 */*) $(MKDIR_P) `echo "$$dist_files" | \
561 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
562 sort -u` ;; \
563 esac; \
564 for file in $$dist_files; do \
565 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
566 if test -d $$d/$$file; then \
567 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
568 if test -d "$(distdir)/$$file"; then \
569 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
570 fi; \
571 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
572 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
573 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
574 fi; \
575 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
576 else \
577 test -f "$(distdir)/$$file" \
578 || cp -p $$d/$$file "$(distdir)/$$file" \
579 || exit 1; \
580 fi; \
581 done
582check-am: all-am
583check: check-am
584all-am: Makefile $(LTLIBRARIES)
585installdirs:
586 for dir in "$(DESTDIR)$(libdir)"; do \
587 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
588 done
589install-exec: install-exec-am
590install-data: install-data-am
591uninstall: uninstall-am
592
593install-am: all-am
594 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
595
596installcheck: installcheck-am
597install-strip:
598 if test -z '$(STRIP)'; then \
599 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
600 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
601 install; \
602 else \
603 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
604 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
605 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
606 fi
607mostlyclean-generic:
608
609clean-generic:
610
611distclean-generic:
612 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
613 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
614
615maintainer-clean-generic:
616 @echo "This command is intended for maintainers to use"
617 @echo "it deletes files that may require special tools to rebuild."
618clean: clean-am
619
620clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
621 mostlyclean-am
622
623distclean: distclean-am
624 -rm -rf ./$(DEPDIR)
625 -rm -f Makefile
626distclean-am: clean-am distclean-compile distclean-generic \
627 distclean-tags
628
629dvi: dvi-am
630
631dvi-am:
632
633html: html-am
634
635html-am:
636
637info: info-am
638
639info-am:
640
641install-data-am:
642
643install-dvi: install-dvi-am
644
645install-dvi-am:
646
647install-exec-am: install-libLTLIBRARIES
648
649install-html: install-html-am
650
651install-html-am:
652
653install-info: install-info-am
654
655install-info-am:
656
657install-man:
658
659install-pdf: install-pdf-am
660
661install-pdf-am:
662
663install-ps: install-ps-am
664
665install-ps-am:
666
667installcheck-am:
668
669maintainer-clean: maintainer-clean-am
670 -rm -rf ./$(DEPDIR)
671 -rm -f Makefile
672maintainer-clean-am: distclean-am maintainer-clean-generic
673
674mostlyclean: mostlyclean-am
675
676mostlyclean-am: mostlyclean-compile mostlyclean-generic \
677 mostlyclean-libtool
678
679pdf: pdf-am
680
681pdf-am:
682
683ps: ps-am
684
685ps-am:
686
687uninstall-am: uninstall-libLTLIBRARIES
688
689.MAKE: install-am install-strip
690
691.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
692 clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
693 ctags-am distclean distclean-compile distclean-generic \
694 distclean-libtool distclean-tags distdir dvi dvi-am html \
695 html-am info info-am install install-am install-data \
696 install-data-am install-dvi install-dvi-am install-exec \
697 install-exec-am install-html install-html-am install-info \
698 install-info-am install-libLTLIBRARIES install-man install-pdf \
699 install-pdf-am install-ps install-ps-am install-strip \
700 installcheck installcheck-am installdirs maintainer-clean \
701 maintainer-clean-generic mostlyclean mostlyclean-compile \
702 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
703 tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
704
705
706install:
707install-plugin: install-am
708
709# Tell versions [3.59,3.63) of GNU make to not export all variables.
710# Otherwise a system limit (for SysV at least) may be exceeded.
711.NOEXPORT:
diff --git a/plugin/attachment_tool/README b/plugin/attachment_tool/README
new file mode 100644
index 0000000..159a2af
--- /dev/null
+++ b/plugin/attachment_tool/README
@@ -0,0 +1,26 @@
1Attachment Tool Plug-in
2=======================
3
4This is a plug-in for handling messages with attached files.
5
6Currently, this plug-in can only remove data of attached files with file name.
7MIME structure will be retained, and users will see 0 byte files.
8
9This tool is available on local folders only.
10
11Requirement
12-----------
13
14This plug-in requires Sylpheed 3.1beta3 or later.
15
16Install
17-------
18
19This plugin will not be installed by 'make install'.
20To install this test plugin, type 'make install-plugin'.
21
22Usage
23-----
24
251. Select target messages in the summary view.
262. Select 'Tools - Remove attachments'.
diff --git a/plugin/attachment_tool/attachment_tool.c b/plugin/attachment_tool/attachment_tool.c
new file mode 100644
index 0000000..de299a2
--- /dev/null
+++ b/plugin/attachment_tool/attachment_tool.c
@@ -0,0 +1,302 @@
1/*
2 * Attachment Tool Plug-in -- an attachment processing plug-in for Sylpheed
3 * Copyright (C) 2010 Hiroyuki Yamamoto
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include "defs.h"
21
22#include <glib.h>
23#include <gtk/gtk.h>
24
25#include <stdio.h>
26#include <sys/stat.h>
27
28#include "sylmain.h"
29#include "plugin.h"
30#include "procmsg.h"
31#include "procmime.h"
32#include "utils.h"
33
34#include <glib/gi18n-lib.h>
35
36static SylPluginInfo info = {
37 "Attachment Tool Plug-in",
38 "0.1.0",
39 "Hiroyuki Yamamoto",
40 "Attachment processing plug-in for Sylpheed"
41};
42
43static void remove_attachment_cb(void);
44
45void plugin_load(void)
46{
47 debug_print("initializing attachment_tool plug-in\n");
48
49 syl_plugin_add_menuitem("/Tools", NULL, NULL, NULL);
50 syl_plugin_add_menuitem("/Tools", _("Remove attachments"), remove_attachment_cb, NULL);
51
52 debug_print("attachment_tool plug-in loading done.\n");
53}
54
55void plugin_unload(void)
56{
57 debug_print("attachment_tool plug-in unloaded.\n");
58}
59
60SylPluginInfo *plugin_info(void)
61{
62 return &info;
63}
64
65gint plugin_interface_version(void)
66{
67 return SYL_PLUGIN_INTERFACE_VERSION;
68}
69
70static gboolean remove_attachment_rec(MimeInfo *partinfo, FILE *fp, FILE *outfp)
71{
72 gchar buf[BUFFSIZE];
73 gchar *boundary = NULL;
74 gint boundary_len = 0;
75 gboolean err = FALSE;
76
77 while (partinfo) {
78 gboolean is_attach_part = FALSE;
79 gint count;
80
81 debug_print("------------------------------------------------- begin %s\n", partinfo->content_type);
82 debug_print("fpos = %ld\n", partinfo->fpos);
83 debug_print("content_type = %s\n", partinfo->content_type);
84
85 if (partinfo->filename || partinfo->name) {
86 is_attach_part = TRUE;
87 debug_print("skip this body\n");
88 }
89
90 if (fseek(fp, partinfo->fpos, SEEK_SET) < 0) {
91 perror("fseek");
92 err = TRUE;
93 break;
94 }
95 /* write part headers */
96 count = 0;
97 while (fgets(buf, sizeof(buf), fp) != NULL) {
98 count++;
99 fputs(buf, outfp);
100 if (buf[0] == '\r' || buf[0] == '\n') break;
101 }
102 debug_print("wrote header: %d lines\n", count);
103
104 /* write until first boundary */
105 count = 0;
106 if (partinfo->children && partinfo->boundary) {
107 boundary = partinfo->boundary;
108 boundary_len = strlen(boundary);
109 debug_print("write until %s\n", boundary);
110 while (fgets(buf, sizeof(buf), fp) != NULL) {
111 count++;
112 if (IS_BOUNDARY(buf, boundary, boundary_len)) {
113 fputs(buf, outfp);
114 debug_print("start boundary: %s", buf);
115 break;
116 } else {
117 fputs(buf, outfp);
118 }
119 }
120 debug_print("wrote %d lines\n", count);
121 }
122
123 if (partinfo->sub) {
124 debug_print("enter rfc822 -----------------------------\n");
125 err = !remove_attachment_rec(partinfo->sub, fp, outfp);
126 debug_print("leave rfc822 -----------------------------\n");
127 if (err)
128 break;
129 } else if (partinfo->children) {
130 debug_print("enter child -----------------------------\n");
131 err = !remove_attachment_rec
132 (partinfo->children, fp, outfp);
133 debug_print("leave child -----------------------------\n");
134 if (err)
135 break;
136 }
137
138 if (partinfo->parent && partinfo->parent->boundary) {
139 boundary = partinfo->parent->boundary;
140 boundary_len = strlen(boundary);
141 debug_print("boundary = %s\n", boundary);
142 } else {
143 boundary = NULL;
144 boundary_len = 0;
145 }
146
147 /* write (or skip) part body and end boundary */
148 if (boundary && !partinfo->main) {
149 count = 0;
150 debug_print("write until %s\n", boundary);
151 while (fgets(buf, sizeof(buf), fp) != NULL) {
152 if (IS_BOUNDARY(buf, boundary, boundary_len)) {
153 count++;
154 fputs(buf, outfp);
155 debug_print("end boundary: %s", buf);
156 break;
157 } else {
158 if (!is_attach_part)
159 count++;
160 if (!is_attach_part)
161 fputs(buf, outfp);
162 }
163 }
164 debug_print("wrote body: %d lines\n", count);
165 }
166
167 debug_print("------------------------------------------------- end %s\n", partinfo->content_type);
168
169 partinfo = partinfo->next;
170 }
171
172 return !err;
173}
174
175static gboolean has_attach_part(MimeInfo *mimeinfo)
176{
177 for (; mimeinfo != NULL; mimeinfo = procmime_mimeinfo_next(mimeinfo)) {
178 if (mimeinfo->filename || mimeinfo->name)
179 return TRUE;
180 }
181
182 return FALSE;
183}
184
185static gboolean remove_attachment(MsgInfo *msginfo)
186{
187 MimeInfo *mimeinfo;
188 FILE *fp, *outfp;
189 gchar *infile, *outfile;
190 gboolean err = FALSE;
191
192 mimeinfo = procmime_scan_message(msginfo);
193 g_return_val_if_fail(mimeinfo != NULL, FALSE);
194
195 if (!has_attach_part(mimeinfo)) {
196 debug_print("remove_attachment: this message doesn't have attachments\n");
197 procmime_mimeinfo_free_all(mimeinfo);
198 return TRUE;
199 }
200
201 if ((fp = procmsg_open_message(msginfo)) == NULL) {
202 procmime_mimeinfo_free_all(mimeinfo);
203 return FALSE;
204 }
205
206 infile = procmsg_get_message_file(msginfo);
207 outfile = g_strconcat(infile, ".tmp", NULL);
208 debug_print("infile: %s\n", infile);
209 debug_print("outfile: %s\n", outfile);
210
211 if ((outfp = g_fopen(outfile, "wb")) == NULL) {
212 g_free(outfile);
213 g_free(infile);
214 fclose(fp);
215 procmime_mimeinfo_free_all(mimeinfo);
216 return FALSE;
217 }
218
219 err = !remove_attachment_rec(mimeinfo, fp, outfp);
220
221 if (fclose(outfp) == EOF) {
222 FILE_OP_ERROR(outfile, "fclose");
223 err = TRUE;
224 }
225
226 fclose(fp);
227
228 if (!err) {
229 debug_print("overwriting original message file: %s\n", infile);
230 if (copy_file(outfile, infile, FALSE) == 0) {
231 GStatBuf s;
232 if (g_stat(infile, &s) == 0) {
233 msginfo->size = s.st_size;
234 msginfo->mtime = s.st_mtime;
235 }
236 if (msginfo->folder)
237 msginfo->folder->cache_dirty = TRUE;
238 } else
239 err = TRUE;
240 }
241
242 g_unlink(outfile);
243 g_free(outfile);
244 g_free(infile);
245 procmime_mimeinfo_free_all(mimeinfo);
246
247 return !err;
248}
249
250static void remove_attachment_cb(void)
251{
252 FolderItem *item;
253 GSList *mlist, *cur;
254 gint val;
255
256 debug_print("remove_attachment_cb\n");
257
258 if (syl_plugin_summary_is_locked())
259 return;
260
261 item = syl_plugin_summary_get_current_folder();
262 if (!item || !item->folder || FOLDER_TYPE(item->folder) != F_MH ||
263 item->stype == F_VIRTUAL) {
264 syl_plugin_alertpanel_message(_("Error"), _("This tool is available on local folders only."), 3);
265 return;
266 }
267
268 mlist = syl_plugin_summary_get_selected_msg_list();
269 if (!mlist)
270 return;
271
272 val = syl_plugin_alertpanel(_("Remove attachments"),
273 _("Do you really remove attached files from the selected messages?"),
274 GTK_STOCK_YES, GTK_STOCK_NO, NULL);
275 if (val != 0) {
276 g_slist_free(mlist);
277 return;
278 }
279
280 for (cur = mlist; cur != NULL; cur = cur->next) {
281 MsgInfo *msginfo = (MsgInfo *)cur->data;
282
283 if (!msginfo)
284 continue;
285 if (!MSG_IS_MIME(msginfo->flags)) {
286 debug_print("message %u is not multi-part. skipping.\n", msginfo->msgnum);
287 continue;
288 }
289 debug_print("Removing attachments of message: %u: %s\n", msginfo->msgnum, msginfo->subject ? msginfo->subject : "(No Subject)");
290
291 if (!remove_attachment(msginfo)) {
292 g_warning("Cannot remove attachments from %u: %s\n", msginfo->msgnum, msginfo->subject ? msginfo->subject : "(No Subject)");
293 break;
294 }
295
296 syl_plugin_summary_update_by_msgnum(msginfo->msgnum);
297 }
298
299 g_slist_free(mlist);
300
301 syl_plugin_summary_redisplay_msg();
302}