[Commits] Makefile.am NONE 1.1.2.1 newmail.c NONE 1.1.2.1 placeholder.txt 1.1.2.1 NONE

colin at claws-mail.org colin at claws-mail.org
Sun Feb 17 22:22:00 CET 2013


Update of /home/claws-mail/claws/src/plugins/newmail
In directory srv:/tmp/cvs-serv7104/src/plugins/newmail

Added Files:
      Tag: gtk2
	Makefile.am newmail.c 
Removed Files:
      Tag: gtk2
	placeholder.txt 
Log Message:
2013-02-17 [colin]	3.9.0cvs75

	* src/plugins/Makefile.am
	* src/plugins/archive/Makefile.am
	* src/plugins/clamd/Makefile.am
	* src/plugins/clamd/clamav_plugin.c
	* src/plugins/clamd/clamav_plugin.h
	* src/plugins/clamd/clamav_plugin_gtk.c
	* src/plugins/clamd/placeholder.txt
	* src/plugins/clamd/libclamd/Makefile.am
	* src/plugins/clamd/libclamd/clamd-plugin.c
	* src/plugins/clamd/libclamd/clamd-plugin.h
	* src/plugins/fetchinfo/Makefile.am
	* src/plugins/fetchinfo/fetchinfo_plugin.c
	* src/plugins/fetchinfo/fetchinfo_plugin.h
	* src/plugins/fetchinfo/fetchinfo_plugin_gtk.c
	* src/plugins/fetchinfo/placeholder.txt
	* src/plugins/gdata/Makefile.am
	* src/plugins/gdata/cm_gdata_contacts.c
	* src/plugins/gdata/cm_gdata_contacts.h
	* src/plugins/gdata/cm_gdata_prefs.c
	* src/plugins/gdata/cm_gdata_prefs.h
	* src/plugins/gdata/gdata_plugin.c
	* src/plugins/gdata/gdata_plugin.h
	* src/plugins/gdata/placeholder.txt
	* src/plugins/geolocation/placeholder.txt
	* src/plugins/gtkhtml2_viewer/placeholder.txt
	* src/plugins/mailmbox/Makefile.am
	* src/plugins/mailmbox/carray.c
	* src/plugins/mailmbox/carray.h
	* src/plugins/mailmbox/chash.c
	* src/plugins/mailmbox/chash.h
	* src/plugins/mailmbox/clist.c
	* src/plugins/mailmbox/clist.h
	* src/plugins/mailmbox/mailimf.c
	* src/plugins/mailmbox/mailimf.h
	* src/plugins/mailmbox/mailimf_types.c
	* src/plugins/mailmbox/mailimf_types.h
	* src/plugins/mailmbox/mailimf_types_helper.c
	* src/plugins/mailmbox/mailimf_types_helper.h
	* src/plugins/mailmbox/mailimf_write.c
	* src/plugins/mailmbox/mailimf_write.h
	* src/plugins/mailmbox/maillock.c
	* src/plugins/mailmbox/maillock.h
	* src/plugins/mailmbox/mailmbox.c
	* src/plugins/mailmbox/mailmbox.h
	* src/plugins/mailmbox/mailmbox_folder.c
	* src/plugins/mailmbox/mailmbox_folder.h
	* src/plugins/mailmbox/mailmbox_gtk.deps
	* src/plugins/mailmbox/mailmbox_parse.c
	* src/plugins/mailmbox/mailmbox_parse.h
	* src/plugins/mailmbox/mailmbox_types.c
	* src/plugins/mailmbox/mailmbox_types.h
	* src/plugins/mailmbox/mmapstring.c
	* src/plugins/mailmbox/mmapstring.h
	* src/plugins/mailmbox/placeholder.txt
	* src/plugins/mailmbox/plugin.c
	* src/plugins/mailmbox/plugin_gtk.c
	* src/plugins/mailmbox/plugin_gtk.h
	* src/plugins/newmail/Makefile.am
	* src/plugins/newmail/newmail.c
	* src/plugins/newmail/placeholder.txt
	* src/plugins/notification/Makefile.am
	* src/plugins/notification/claws.def
	* src/plugins/notification/notification_banner.c
	* src/plugins/notification/notification_banner.h
	* src/plugins/notification/notification_command.c
	* src/plugins/notification/notification_command.h
	* src/plugins/notification/notification_core.c
	* src/plugins/notification/notification_core.h
	* src/plugins/notification/notification_foldercheck.c
	* src/plugins/notification/notification_foldercheck.h
	* src/plugins/notification/notification_hotkeys.c
	* src/plugins/notification/notification_hotkeys.h
	* src/plugins/notification/notification_indicator.c
	* src/plugins/notification/notification_indicator.h
	* src/plugins/notification/notification_lcdproc.c
	* src/plugins/notification/notification_lcdproc.h
	* src/plugins/notification/notification_pixbuf.c
	* src/plugins/notification/notification_pixbuf.h
	* src/plugins/notification/notification_plugin.c
	* src/plugins/notification/notification_plugin.h
	* src/plugins/notification/notification_popup.c
	* src/plugins/notification/notification_popup.h
	* src/plugins/notification/notification_prefs.c
	* src/plugins/notification/notification_prefs.h
	* src/plugins/notification/notification_trayicon.c
	* src/plugins/notification/notification_trayicon.h
	* src/plugins/notification/placeholder.txt
	* src/plugins/notification/plugin.def
	* src/plugins/notification/raw_claws_mail_logo_64x64.h
	* src/plugins/notification/version.rc
	* src/plugins/pdf_viewer/Makefile.am
	* src/plugins/pdf_viewer/doc_index.xpm
	* src/plugins/pdf_viewer/doc_index_close.xpm
	* src/plugins/pdf_viewer/doc_info.xpm
	* src/plugins/pdf_viewer/first_arrow.xpm
	* src/plugins/pdf_viewer/last_arrow.xpm
	* src/plugins/pdf_viewer/left_arrow.xpm
	* src/plugins/pdf_viewer/placeholder.txt
	* src/plugins/pdf_viewer/poppler_viewer.c
	* src/plugins/pdf_viewer/poppler_viewer.h
	* src/plugins/pdf_viewer/right_arrow.xpm
	* src/plugins/pdf_viewer/rotate_left.xpm
	* src/plugins/pdf_viewer/rotate_right.xpm
	* src/plugins/pdf_viewer/zoom_fit.xpm
	* src/plugins/pdf_viewer/zoom_in.xpm
	* src/plugins/pdf_viewer/zoom_out.xpm
	* src/plugins/pdf_viewer/zoom_width.xpm
	* src/plugins/perl/Makefile.am
	* src/plugins/perl/perl_gtk.c
	* src/plugins/perl/perl_gtk.h
	* src/plugins/perl/perl_plugin.c
	* src/plugins/perl/perl_plugin.h
	* src/plugins/perl/placeholder.txt
	* src/plugins/python/Makefile.am
	* src/plugins/python/clawsmailmodule.c
	* src/plugins/python/clawsmailmodule.h
	* src/plugins/python/composewindowtype.c
	* src/plugins/python/composewindowtype.h
	* src/plugins/python/foldertype.c
	* src/plugins/python/foldertype.h
	* src/plugins/python/messageinfotype.c
	* src/plugins/python/messageinfotype.h
	* src/plugins/python/nodetype.c
	* src/plugins/python/nodetype.h
	* src/plugins/python/placeholder.txt
	* src/plugins/python/python-hooks.c
	* src/plugins/python/python-hooks.h
	* src/plugins/python/python-shell.c
	* src/plugins/python/python-shell.h
	* src/plugins/python/python_plugin.c
	* src/plugins/vcalendar/Makefile.in
		Add some plugins (clamd, fetchinfo, gdata, mailmbox, newmail,
		notification, pdf_viewer, perl, python). Notification not yet
		enabled because it has too much autoconf switches for my taste.

--- NEW FILE: newmail.c ---
/*
 * newmail - A plugin for Claws Mail
 *
 * Copyright (C) 2005-2005 H.Merijn Brand and the Claws Mail Team
 *
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 * Copyright (C) 1999-2012 the Claws Mail Team
 *
 * This program 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 3 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <errno.h>

#include <glib.h>
#include <glib/gi18n.h>

#include "version.h"
#include "claws.h"
#include "plugin.h"
#include "utils.h"
#include "hooks.h"
#include "procmsg.h"

#include <inttypes.h>

#include "plugin.h"

static guint hook_id;

static FILE *NewLog   = NULL;
static char *LogName  = NULL;
static int   truncLog = 1;

static gchar *defstr (gchar *s)
{
    return s ? s : "(null)";
    } /* defstr */

gboolean newmail_hook (gpointer source, gpointer data)
{
    auto MsgInfo    *msginfo = (MsgInfo *)source;
    auto FolderItem *tof;

    if (!msginfo) return (FALSE);

    tof = msginfo->folder;
    (void)fprintf (NewLog, "---\n"
	"Date:\t%s\n"
	"Subject:\t%s\n"
	"From:\t%s\n"
	"To:\t%s\n"
	"Cc:\t%s\n"
	"Size:\t%jd\n"
	"Path:\t%s\n"
	"Message:\t%d\n"
	"Folder:\t%s\n",
	    defstr (msginfo->date),
	    defstr (msginfo->subject),
	    defstr (msginfo->from),
	    defstr (msginfo->to),
	    defstr (msginfo->cc),
	    (intmax_t) msginfo->size,
	    defstr (procmsg_get_message_file_path (msginfo)),
	    msginfo->msgnum,
	    tof ? defstr (tof->name) : "(null)");

    return (FALSE);
    } /* newmail_hook */

gboolean plugin_done (void)
{
    if (NewLog) {
	(void)fclose (NewLog);
	NewLog  = NULL;
	LogName = NULL;
	}
    hooks_unregister_hook (MAIL_POSTFILTERING_HOOKLIST, hook_id);

    printf (_("Newmail plugin unloaded\n"));
    return TRUE;
    } /* plugin_done */

gint plugin_init (gchar **error)
{
	if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
				VERSION_NUMERIC, _("NewMail"), error))
		return -1;

	hook_id = hooks_register_hook (MAIL_POSTFILTERING_HOOKLIST, newmail_hook, NULL);
  if (hook_id == -1) {
		*error = g_strdup (_("Failed to register newmail hook"));
		return (-1);
	}

    if (!NewLog) {
	auto char *mode = truncLog ? "w" : "a";
	if (!LogName) {
	    auto size_t l;
	    auto char   name[260];
	    (void)snprintf (name, 256, "%s/Mail/NewLog", getenv ("HOME"));
	    l = strlen (name);
	    if (l > 255 || !(LogName = (char *)malloc (l + 1))) {
		*error = g_strdup (_("Cannot load plugin NewMail\n"
				     "$HOME is too long\n"));
		plugin_done ();
		return (-1);
		}
	    (void)strcpy (LogName, name);
	    }
	if (!(NewLog = fopen (LogName, mode))) {
	    *error = g_strdup (sys_errlist[errno]);
	    plugin_done ();
	    return (-1);
	    }
	setbuf (NewLog, NULL);
	}

    printf (_("Newmail plugin loaded\n"
              "Message header summaries written to %s\n"), LogName);
    return (0);
    } /* plugin_init */

const gchar *plugin_name (void)
{
    return _("NewMail");
    } /* plugin_name */

const gchar *plugin_desc (void)
{
    return _("This Plugin writes a header summary to a log file for each "
	     "mail received after sorting.\n\n"
	     "Default is ~/Mail/NewLog");
    } /* plugin_desc */

const gchar *plugin_type (void)
{
    return ("Common");
    } /* plugin_type */

const gchar *plugin_licence (void)
{
    return ("GPL3+");
    } /* plugin_licence */

const gchar *plugin_version (void)
{
    return (VERSION);
    } /* plugin_version */

struct PluginFeature *plugin_provides(void)
{
	static struct PluginFeature features[] = 
		{ {PLUGIN_NOTIFIER, N_("Log file")},
		  {PLUGIN_NOTHING, NULL}};
	return features;
}

--- NEW FILE: Makefile.am ---
plugindir = $(pkglibdir)/plugins

plugin_LTLIBRARIES = newmail.la

newmail_la_SOURCES = \
	newmail.c

newmail_la_LDFLAGS = \
	-avoid-version -module

AM_CPPFLAGS = \
        $(CLAWS_MAIL_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GTK_CFLAGS)

INCLUDES = \
	-I$(top_srcdir)/src \
	-I$(top_srcdir)/src/common \
	-I$(top_srcdir)/src/gtk

--- placeholder.txt DELETED ---



More information about the Commits mailing list