1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2007 Colin Leroy <colin@colino.net>
4  * and the Claws Mail Team
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef SPAMREPORTPREFS_H
22 #define SPAMREPORTPREFS_H
23 
24 #include <glib.h>
25 
26 #include "procmsg.h"
27 #include "passwordstore.h"
28 
29 #define SPAM_REPORT_USERAGENT "Claws Mail SpamReport plugin "
30 
31 typedef struct _SpamReportPrefs	SpamReportPrefs;
32 
33 typedef enum {
34 	INTF_SIGNALSPAM,
35 	INTF_SPAMCOP,
36 	INTF_DEBIANSPAM,
37 	INTF_LAST
38 } InterfaceId;
39 
40 typedef enum {
41 	INTF_HTTP,
42 	INTF_HTTP_AUTH,
43 	INTF_MAIL,
44 	INTF_HTTP_GET,
45 	INTF_NULL
46 } InterfaceType;
47 
48 typedef struct _ReportInterface {
49 	gchar *name;
50 	InterfaceType type;
51 	gchar *url;
52 	gchar *body;
53 	gboolean (*should_report)(MsgInfo *info);
54 } ReportInterface;
55 
56 extern ReportInterface spam_interfaces[];
57 
58 struct _SpamReportPrefs
59 {
60 	gboolean enabled[INTF_LAST];
61 	gchar *user[INTF_LAST];
62 	gchar *pass[INTF_LAST];
63 };
64 
65 extern SpamReportPrefs spamreport_prefs;
66 
67 void spamreport_prefs_init(void);
68 void spamreport_prefs_done(void);
69 
70 #define spamreport_passwd_set(id, pwd) \
71 	passwd_store_set(PWS_PLUGIN, "SpamReport", id, pwd, FALSE)
72 #define spamreport_passwd_get(id) \
73 	passwd_store_get(PWS_PLUGIN, "SpamReport", id)
74 
75 #endif
76