Real fix for Coverity 1372362.
[claws.git] / src / plugins / spamassassin / spamassassin.h
1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2012 the Claws Mail Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * 
18  */
19
20 #ifndef SPAMASSASSIN_H
21 #define SPAMASSASSIN_H 1
22
23 #include <glib.h>
24 #include "folder.h"
25
26 typedef struct _SpamAssassinConfig SpamAssassinConfig;
27
28 typedef void (*MessageCallback) (gchar *);
29
30 typedef enum {
31         SPAMASSASSIN_DISABLED            = 0, /* unused, just for compatibility */
32         SPAMASSASSIN_TRANSPORT_LOCALHOST = 1,
33         SPAMASSASSIN_TRANSPORT_TCP       = 2,
34         SPAMASSASSIN_TRANSPORT_UNIX      = 3,
35 } SpamAssassinTransport;
36
37 struct _SpamAssassinConfig
38 {
39         gboolean                 enable;
40         SpamAssassinTransport    transport;
41         gchar                   *hostname;
42         guint                    port;
43         gchar                   *socket;
44         gboolean                 process_emails;
45         gboolean                 receive_spam;
46         gchar                   *save_folder;
47         guint                    max_size;
48         guint                    timeout;
49         gchar                   *username;
50         gboolean                 mark_as_read;
51         gboolean                 whitelist_ab;
52         gchar                   *whitelist_ab_folder;
53 };
54
55 SpamAssassinConfig *spamassassin_get_config           (void);
56 void                spamassassin_save_config          (void);
57 gint                    spamassassin_check_username           (void);  
58 void                spamassassin_set_message_callback (MessageCallback callback);
59 gint spamassassin_gtk_init(void);
60 void spamassassin_gtk_done(void);
61 int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam);
62 void spamassassin_register_hook(void);
63 void spamassassin_unregister_hook(void);
64 FolderItem *spamassassin_get_spam_folder(MsgInfo *msginfo);
65
66 #endif