#if USE_GPGME
# include "rfc2015.h"
#endif
+#if USE_SSL
+# include "ssl.h"
+#endif
+
+#include "version.h"
gchar *prog_version;
gchar *startup_dir;
static gint lock_socket = -1;
static gint lock_socket_tag = 0;
-#if USE_SSL
-SSL_CTX *ssl_ctx;
-#endif
-
static struct Cmd {
gboolean receive;
gboolean receive_all;
gtk_set_locale();
gtk_init(&argc, &argv);
-#if USE_THREADS
+#if USE_THREADS || USE_LDAP
g_thread_init(NULL);
if (!g_thread_supported())
g_error(_("g_thread is not supported by glib.\n"));
gtk_widget_push_colormap(gdk_imlib_get_colormap());
#endif
+#if USE_SSL
+ ssl_init();
+#endif
+
srandom((gint)time(NULL));
/* parse gtkrc files */
gpgme_register_idle(idle_function_for_gpgme);
#endif
-#if USE_SSL
- {
- SSL_METHOD *meth;
-
- SSLeay_add_ssl_algorithms();
- meth = SSLv2_client_method();
- SSL_load_error_strings();
- ssl_ctx = SSL_CTX_new(meth);
- if(ssl_ctx == NULL) {
- debug_print(_("SSL disabled\n"));
- } else {
- debug_print(_("SSL loaded: \n"));
- }
- }
-#endif
-
prefs_common_save_config();
prefs_filter_read_config();
prefs_filter_write_config();
prefs_display_header_read_config();
prefs_display_header_write_config();
prefs_filtering_read_config();
+ addressbook_read_file();
gtkut_widget_init();
account_read_config_all();
account_save_config_all();
- if (folder_read_list() < 0) setup(mainwin);
+ if (folder_read_list() < 0) {
+ setup(mainwin);
+ folder_write_list();
+ }
+ if (!account_get_list()) {
+ account_edit_open();
+ account_add();
+ }
+
account_set_missing_folder();
folderview_set(folderview);
prefs_scoring_read_config();
+ addressbook_read_file();
+
inc_autocheck_timer_init(mainwin);
if (cmd.receive_all || prefs_common.chk_on_startup)
gtk_main();
-#if USE_SSL
- if(ssl_ctx) {
- SSL_CTX_free(ssl_ctx);
- }
+#if USE_PSPELL
+ gtkpspell_finished(gtkpspellconfig);
#endif
return 0;
manage_window_focus_in(mainwin->window, NULL, NULL);
}
+ inc_autocheck_timer_remove();
+
if (prefs_common.clean_on_exit)
main_window_empty_trash(mainwin, prefs_common.ask_on_clean);
filename = get_socket_name();
unlink(filename);
+#if USE_SSL
+ ssl_done();
+#endif
+
gtk_main_quit();
}