sync with 0.8.3cvs6
[claws.git] / src / prefs_account.h
index f6b44fa30a86c8e5125c61e6d792ab75dbf3c44a..4eb03c2b0f052590e38ff06eab61bb50da226648 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * 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
 typedef struct _PrefsAccount   PrefsAccount;
 
 #include "folder.h"
+#include "smtp.h"
+
+#ifdef USE_GPGME
+#  include "rfc2015.h"
+#endif
 
 typedef enum {
        A_POP3,
@@ -36,9 +41,24 @@ typedef enum {
        A_RPOP,
        A_IMAP4,
        A_NNTP,
-       A_LOCAL,
+       A_LOCAL
 } RecvProtocol;
 
+typedef enum {
+       /* login and retrieve messages, as before */
+       STYPE_NORMAL,
+       /* send TOP to server and retrieve all available Headers */
+       STYPE_PREVIEW_ALL,
+       /* send TOP to server and retrieve new Headers */
+       STYPE_PREVIEW_NEW,
+       /* delete selected Headers on Server */
+       STYPE_DELETE, 
+       /* download + remove Mail from Server */
+       STYPE_DOWNLOAD,
+       /* just login (pop before smtp) */
+       STYPE_POP_BEFORE_SMTP,
+} Pop3SessionType;
+
 #if USE_GPGME
 typedef enum {
        SIGN_KEY_DEFAULT,
@@ -58,7 +78,6 @@ struct _PrefsAccount
 
        /* Server info */
        RecvProtocol protocol;
-       gchar *inbox;
        gchar *recv_server;
        gchar *smtp_server;
        gchar *nntp_server;
@@ -70,35 +89,65 @@ struct _PrefsAccount
        gboolean use_mail_command;
        gchar * mail_command;
 
+#if USE_SSL
+       SSLType ssl_pop;
+       SSLType ssl_imap;
+       SSLType ssl_nntp;
+       SSLType ssl_smtp;
+#endif /* USE_SSL */
+
        /* Temporarily preserved password */
        gchar *tmp_pass;
 
        /* Receive */
        gboolean rmmail;
+       gint msg_leave_time;
        gboolean getall;
        gboolean recv_at_getall;
+       gboolean sd_rmmail_on_download;
+       gboolean sd_filter_on_recv;
+       gboolean enable_size_limit;
+       gint size_limit;
        gboolean filter_on_recv;
+       gchar *inbox;
+
+       /* selective Download */
+       gint   session;
+       GSList *msg_list;
 
        /* Send */
-       gboolean  add_date;
-       gboolean  gen_msgid;
-       gboolean  add_customhdr;
-       gboolean  set_autocc;
-       gchar    *auto_cc;
-       gboolean  set_autobcc;
-       gchar    *auto_bcc;
-       gboolean  set_autoreplyto;
-       gchar    *auto_replyto;
+       gboolean add_date;
+       gboolean gen_msgid;
+       gboolean add_customhdr;
        gboolean use_smtp_auth;
+       SMTPAuthType smtp_auth_type;
+       gchar *smtp_userid;
+       gchar *smtp_passwd;
+
+       /* Temporarily preserved password */
+       gchar *tmp_smtp_pass;
+
        gboolean pop_before_smtp;
+       gint pop_before_smtp_timeout;
+       time_t last_pop_login_time;
 
        GSList *customhdr_list;
 
        /* Compose */
        gchar *sig_path;
+       gboolean  set_autocc;
+       gchar    *auto_cc;
+       gboolean  set_autobcc;
+       gchar    *auto_bcc;
+       gboolean  set_autoreplyto;
+       gchar    *auto_replyto;
 
 #if USE_GPGME
        /* Privacy */
+       gboolean default_encrypt;
+       gboolean default_sign;
+       gboolean ascii_armored;
+       gboolean clearsign;
        SignKeyType sign_key;
        gchar *sign_key_id;
 #endif /* USE_GPGME */
@@ -108,10 +157,34 @@ struct _PrefsAccount
        gushort   smtpport;
        gboolean  set_popport;
        gushort   popport;
+       gboolean  set_imapport;
+       gushort   imapport;
        gboolean  set_nntpport;
        gushort   nntpport;
        gboolean  set_domain;
        gchar    *domain;
+       gboolean  mark_crosspost_read;
+       gint      crosspost_col;
+
+       /* Use this command to open a socket, rather than doing so
+        * directly.  Good if you want to perhaps use a special socks
+        * tunnel command, or run IMAP-over-SSH.  In this case the
+        * server, port etc are only for the user's own information
+        * and are not used.  username and password are used to
+        * authenticate the account only if necessary, since some
+        * tunnels will implicitly authenticate by running e.g. imapd
+        * as a particular user. */
+       gboolean  set_tunnelcmd;
+       gchar     *tunnelcmd;
+
+       gchar *imap_dir;
+
+       gboolean set_sent_folder;
+       gchar *sent_folder;
+       gboolean set_draft_folder;
+       gchar *draft_folder;
+       gboolean set_trash_folder;
+       gchar *trash_folder;
 
        /* Default or not */
        gboolean is_default;
@@ -121,11 +194,15 @@ struct _PrefsAccount
        RemoteFolder *folder;
 };
 
+PrefsAccount *prefs_account_new                (void);
+
 void prefs_account_read_config         (PrefsAccount   *ac_prefs,
                                         const gchar    *label);
 void prefs_account_save_config         (PrefsAccount   *ac_prefs);
 void prefs_account_save_config_all     (GList          *account_list);
+
 void prefs_account_free                        (PrefsAccount   *ac_prefs);
+
 PrefsAccount *prefs_account_open       (PrefsAccount   *ac_prefs);
 
 #endif /* __PREFS_ACCOUNT_H__ */