custom headers configuration added
[claws.git] / src / prefs_account.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999,2000 Hiroyuki Yamamoto
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 2 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, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __PREFS_ACCOUNT_H__
21 #define __PREFS_ACCOUNT_H__
22
23 #include <glib.h>
24
25 typedef struct _PrefsAccount    PrefsAccount;
26
27 #include "folder.h"
28
29 typedef enum {
30         A_POP3,
31         A_APOP,
32         A_RPOP,
33         A_IMAP4,
34         A_NNTP,
35         A_LOCAL
36 } RecvProtocol;
37
38 #if USE_GPGME
39 typedef enum {
40         SIGN_KEY_DEFAULT,
41         SIGN_KEY_BY_FROM,
42         SIGN_KEY_CUSTOM
43 } SignKeyType;
44 #endif /* USE_GPGME */
45
46 struct _PrefsAccount
47 {
48         gchar *account_name;
49
50         /* Personal info */
51         gchar *name;
52         gchar *address;
53         gchar *organization;
54
55         /* Server info */
56         RecvProtocol protocol;
57         gchar *inbox;
58         gchar *recv_server;
59         gchar *smtp_server;
60         gchar *nntp_server;
61         gboolean use_nntp_auth;
62         gchar *userid;
63         gchar *passwd;
64
65         /* Temporarily preserved password */
66         gchar *tmp_pass;
67
68         /* Receive */
69         gboolean rmmail;
70         gboolean getall;
71         gboolean recv_at_getall;
72         gboolean filter_on_recv;
73
74         /* Send */
75         gboolean  add_date;
76         gboolean  gen_msgid;
77         gboolean  add_customhdr;
78         gboolean  set_autocc;
79         gchar    *auto_cc;
80         gboolean  set_autobcc;
81         gchar    *auto_bcc;
82         gboolean  set_autoreplyto;
83         gchar    *auto_replyto;
84         gboolean use_smtp_auth;
85         gboolean pop_before_smtp;
86
87         GSList *customhdr_list;
88
89         /* Compose */
90         gchar *sig_path;
91
92 #if USE_GPGME
93         /* Privacy */
94         SignKeyType sign_key;
95         gchar *sign_key_id;
96 #endif /* USE_GPGME */
97
98         /* Advanced */
99         gboolean  set_smtpport;
100         gushort   smtpport;
101         gboolean  set_popport;
102         gushort   popport;
103         gboolean  set_nntpport;
104         gushort   nntpport;
105         gboolean  set_domain;
106         gchar    *domain;
107
108         /* Default or not */
109         gboolean is_default;
110         /* Unique account ID */
111         gint account_id;
112
113         RemoteFolder *folder;
114 };
115
116 void prefs_account_read_config          (PrefsAccount   *ac_prefs,
117                                          const gchar    *label);
118 void prefs_account_save_config          (PrefsAccount   *ac_prefs);
119 void prefs_account_save_config_all      (GList          *account_list);
120 void prefs_account_free                 (PrefsAccount   *ac_prefs);
121 PrefsAccount *prefs_account_open        (PrefsAccount   *ac_prefs);
122
123 #endif /* __PREFS_ACCOUNT_H__ */