update contributors list
[claws.git] / src / prefs_account.h
blob539dfd9e5c2bb8924acc78cf5dc271e40d738771
1 /*
2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
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.
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.
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/>.
20 #ifndef PREFS_ACCOUNT_H
21 #define PREFS_ACCOUNT_H
23 #ifdef HAVE_CONFIG_H
24 #include "claws-features.h"
25 #endif
26 #include "ssl.h"
27 typedef struct _PrefsAccount PrefsAccount;
29 typedef enum {
30 A_POP3,
31 A_IMAP4,
32 A_NNTP,
33 A_LOCAL,
34 A_NONE, /* SMTP only */
35 NUM_RECV_PROTOCOLS
36 } RecvProtocol;
38 typedef enum {
39 SIG_FILE,
40 SIG_COMMAND,
41 SIG_DIRECT
42 } SigType;
44 typedef enum
46 POPAUTH_APOP = 1 << 0,
47 POPAUTH_OAUTH2 = 1 << 1
48 } POPAuthType;
50 #include <glib.h>
52 #include "smtp.h"
53 #include "pop.h"
54 #include "gtk/prefswindow.h"
56 struct _Folder;
58 /* Changes to this data structure might need to be reflected
59 * in account_clone() */
60 struct _PrefsAccount
62 gchar *account_name;
64 /* Personal info */
65 gchar *name;
66 gchar *address;
67 gchar *organization;
69 /* Server info */
70 RecvProtocol protocol;
71 gchar *recv_server;
72 gchar *smtp_server;
73 gchar *nntp_server;
74 gboolean use_nntp_auth;
75 gboolean use_nntp_auth_onconnect;
76 gchar *userid;
77 gchar *passwd;
78 gchar *session_passwd;
80 gchar * local_mbox;
81 gboolean use_mail_command;
82 gchar * mail_command;
84 SSLType ssl_pop;
85 SSLType ssl_imap;
86 SSLType ssl_nntp;
87 SSLType ssl_smtp;
89 gchar *out_ssl_client_cert_file;
90 gchar *out_ssl_client_cert_pass;
91 gchar *in_ssl_client_cert_file;
92 gchar *in_ssl_client_cert_pass;
94 gboolean ssl_certs_auto_accept;
95 gboolean use_nonblocking_ssl;
96 gboolean use_tls_sni;
98 /* Receive */
99 gboolean use_pop_auth;
100 POPAuthType pop_auth_type;
101 gboolean use_apop_auth; /* deprecated */
102 gboolean rmmail;
103 gint msg_leave_time;
104 gint msg_leave_hour;
105 gboolean recv_at_getall;
106 gboolean sd_rmmail_on_download;
107 gboolean enable_size_limit;
108 gint size_limit;
109 gboolean filter_on_recv;
110 gboolean filterhook_on_recv;
111 gchar *inbox;
112 gchar *local_inbox;
113 gint max_articles;
114 gboolean autochk_use_default;
115 gboolean autochk_use_custom;
116 gint autochk_itv;
117 guint autocheck_timer;
119 gint imap_auth_type;
121 gboolean receive_in_progress;
123 /* Send */
124 gboolean gen_msgid;
125 gboolean gen_xmailer;
126 gboolean add_customhdr;
127 gboolean use_smtp_auth;
128 SMTPAuthType smtp_auth_type;
129 gchar *smtp_userid;
130 gchar *smtp_passwd;
131 gchar *session_smtp_passwd;
133 gboolean pop_before_smtp;
134 gint pop_before_smtp_timeout;
135 time_t last_pop_login_time;
137 GSList *customhdr_list;
139 /* OAuth2 */
140 gint oauth2_provider;
141 gint oauth2_date;
142 gchar *oauth2_authcode;
143 gchar *oauth2_client_id;
144 gchar *oauth2_client_secret;
146 /* Compose */
147 SigType sig_type;
148 gchar *sig_path;
149 gboolean auto_sig;
150 gchar *sig_sep;
151 gboolean set_autocc;
152 gchar *auto_cc;
153 gboolean set_autobcc;
154 gchar *auto_bcc;
155 gboolean set_autoreplyto;
156 gchar *auto_replyto;
157 gboolean enable_default_dictionary;
158 gchar *default_dictionary;
159 gboolean enable_default_alt_dictionary;
160 gchar *default_alt_dictionary;
161 gboolean compose_with_format;
162 gchar *compose_subject_format;
163 gchar *compose_body_format;
164 gboolean reply_with_format;
165 gchar *reply_quotemark;
166 gchar *reply_body_format;
167 gboolean forward_with_format;
168 gchar *forward_quotemark;
169 gchar *forward_body_format;
171 /* Privacy */
172 gchar *default_privacy_system;
173 gboolean default_encrypt;
174 gboolean default_encrypt_reply;
175 gboolean default_sign;
176 gboolean default_sign_reply;
177 gboolean save_encrypted_as_clear_text;
178 gboolean encrypt_to_self;
180 /* Advanced */
181 gboolean set_smtpport;
182 gushort smtpport;
183 gboolean set_popport;
184 gushort popport;
185 gboolean set_imapport;
186 gushort imapport;
187 gboolean set_nntpport;
188 gushort nntpport;
189 gboolean set_domain;
190 gchar *domain;
191 gboolean set_gnutls_priority;
192 gchar *gnutls_priority;
193 gboolean msgid_with_addr;
194 gboolean mark_crosspost_read;
195 gint crosspost_col;
197 #ifndef G_OS_WIN32
198 /* Use this command to open a socket, rather than doing so
199 * directly. Good if you want to perhaps use a special socks
200 * tunnel command, or run IMAP-over-SSH. In this case the
201 * server, port etc are only for the user's own information
202 * and are not used. username and password are used to
203 * authenticate the account only if necessary, since some
204 * tunnels will implicitly authenticate by running e.g. imapd
205 * as a particular user. */
206 gboolean set_tunnelcmd;
207 gchar *tunnelcmd;
208 #endif
210 gchar *imap_dir;
211 gboolean imap_subsonly;
212 gboolean low_bandwidth;
214 gboolean set_sent_folder;
215 gchar *sent_folder;
216 gboolean set_queue_folder;
217 gchar *queue_folder;
218 gboolean set_draft_folder;
219 gchar *draft_folder;
220 gboolean set_trash_folder;
221 gchar *trash_folder;
223 /* Default or not */
224 gboolean is_default;
225 /* Unique account ID */
226 gint account_id;
228 /* SOCKS proxy */
229 gboolean use_proxy;
230 gboolean use_default_proxy;
231 gboolean use_proxy_for_send;
232 ProxyInfo proxy_info;
234 struct _Folder *folder;
235 GHashTable *privacy_prefs;
236 SMTPSession *session;
238 gint config_version;
241 void prefs_account_init (void);
243 PrefsAccount *prefs_account_new (void);
244 PrefsAccount *prefs_account_new_from_config (const gchar *label);
246 void prefs_account_write_config_all (GList *account_list);
248 void prefs_account_free (PrefsAccount *ac_prefs);
250 PrefsAccount *prefs_account_open (PrefsAccount *ac_prefs, gboolean *dirty);
252 const gchar *prefs_account_get_privacy_prefs(PrefsAccount *account, gchar *id);
253 void prefs_account_set_privacy_prefs(PrefsAccount *account, gchar *id, gchar *new_value);
254 gchar *prefs_account_generate_msgid(PrefsAccount *account);
256 void prefs_account_register_page (PrefsPage *page);
257 void prefs_account_unregister_page (PrefsPage *page);
259 gchar *prefs_account_cache_dir (PrefsAccount *ac_prefs, gboolean for_server);
261 #endif /* PREFS_ACCOUNT_H */