0.8.6claws75
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 8 Dec 2002 13:52:10 +0000 (13:52 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 8 Dec 2002 13:52:10 +0000 (13:52 +0000)
* src/Makefile.am
* src/about.c
* src/account.c
* src/crash.c
* src/esmtp.h
* src/imap.[ch]
* src/inc.c
* src/main.c
* src/mainwindow.c
* src/news.c
* src/pop.[ch]
* src/prefs_account.[ch]
* src/prefs_common.[ch]
* src/send.[ch]
* src/smtp.[ch]
* src/ssl_certificate.[ch]
* src/ssl_manager.[ch]
* src/common/Makefile.am
* src/common/log.c
* src/common/nntp.[ch]
* src/common/socket.[ch]
* src/common/ssl.[ch]
* src/gtk/sslcertwindow.c
* ac/openssl.m4
        use new autoconf script to detect OpenSSL with extra parameters
        to specify the location of libs and includes, also remove USE_SSL
        to USE_OPENSSL

* src/common/sylpheed.[ch]
* src/common/version.h.in
        start seperation of common code initialization seperated from gui

last commit did not work without this, so here is the rest

40 files changed:
ChangeLog.claws
ac/openssl.m4 [new file with mode: 0644]
src/Makefile.am
src/about.c
src/account.c
src/common/Makefile.am
src/common/log.c
src/common/nntp.c
src/common/nntp.h
src/common/socket.c
src/common/socket.h
src/common/ssl.c
src/common/ssl.h
src/common/sylpheed.c [new file with mode: 0644]
src/common/sylpheed.h [new file with mode: 0644]
src/common/version.h [new file with mode: 0644]
src/common/version.h.in [moved from src/version.h.in with 100% similarity]
src/crash.c
src/esmtp.h
src/gtk/sslcertwindow.c
src/imap.c
src/imap.h
src/inc.c
src/main.c
src/mainwindow.c
src/news.c
src/pop.c
src/pop.h
src/prefs_account.c
src/prefs_account.h
src/prefs_common.c
src/prefs_common.h
src/send.c
src/send.h
src/smtp.c
src/smtp.h
src/ssl_certificate.c
src/ssl_certificate.h
src/ssl_manager.c
src/ssl_manager.h

index a0a021f..9cfcd4a 100644 (file)
@@ -1,5 +1,37 @@
 2002-12-08 [christoph] 0.8.6claws75
 
+       * src/Makefile.am
+       * src/about.c
+       * src/account.c
+       * src/crash.c
+       * src/esmtp.h
+       * src/imap.[ch]
+       * src/inc.c
+       * src/main.c
+       * src/mainwindow.c
+       * src/news.c
+       * src/pop.[ch]
+       * src/prefs_account.[ch]
+       * src/prefs_common.[ch]
+       * src/send.[ch]
+       * src/smtp.[ch]
+       * src/ssl_certificate.[ch]
+       * src/ssl_manager.[ch]
+       * src/common/Makefile.am
+       * src/common/log.c
+       * src/common/nntp.[ch]
+       * src/common/socket.[ch]
+       * src/common/ssl.[ch]
+       * src/gtk/sslcertwindow.c
+       * ac/openssl.m4
+               use new autoconf script to detect OpenSSL with extra parameters
+               to specify the location of libs and includes, also remove USE_SSL
+               to USE_OPENSSL
+
+       * src/common/sylpheed.[ch]
+       * src/common/version.h.in
+               start seperation of common code initialization seperated from gui
+
        * src/summaryview.c
                The function that is called when a color lable changes
                should not change the color lable again
diff --git a/ac/openssl.m4 b/ac/openssl.m4
new file mode 100644 (file)
index 0000000..e50b399
--- /dev/null
@@ -0,0 +1,73 @@
+dnl ******************************
+dnl OpenSSL
+dnl ******************************
+
+AC_DEFUN(AM_PATH_OPENSSL,
+[dnl
+       AC_ARG_ENABLE(openssl, [  --enable-openssl        Attempt to use OpenSSL for SSL support.],
+               [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=no])
+
+       dnl delect OpenSSL
+       if test "x${ac_cv_enable_openssl}" != "xno"; then
+               AC_ARG_WITH(openssl-includes, [  --with-openssl-includes=PREFIX     Location of OpenSSL includes.],
+                       with_openssl_includes="$withval", with_openssl_includes="/usr/include")
+               have_openssl_includes="no"
+               if test "x${with_openssl_includes}" != "xno"; then
+                       CPPFLAGS_save="$CPPFLAGS"
+               
+                       AC_MSG_CHECKING(for OpenSSL includes)
+                       AC_MSG_RESULT("")
+               
+                       CPPFLAGS="$CPPFLAGS -I$with_openssl_includes"
+                       AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h, [ openssl_includes="yes" ])
+                       CPPFLAGS="$CPPFLAGS_save"
+               
+                       if test "x{$openssl_includes}" != "xno" -a "x{$openssl_includes}" != "x"; then
+                               have_openssl_includes="yes"
+                               OPENSSL_CFLAGS="-I$with_openssl_includes"
+                       else
+                               OPENSSL_CFLAGS=""
+                       fi
+               else
+                       AC_MSG_CHECKING(for OpenSSL includes)
+                       AC_MSG_RESULT(no)
+               fi
+       
+               AC_ARG_WITH(openssl-libs, [  --with-openssl-libs=PREFIX         Location of OpenSSL libs.],
+                       with_openssl_libs="$withval")
+               if test "x${with_openssl_libs}" != "xno" -a "x${have_openssl_includes}" != "xno"; then
+                       LIBS_save="$LIBS"
+       
+                       case $with_openssl_libs in
+                       ""|-L*) ;;
+                       *) with_openssl_libs="-L$with_openssl_libs" ;;
+                       esac
+       
+                       AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl", DL_LIBS="")
+                       AC_CACHE_CHECK([for OpenSSL libraries], openssl_libs,
+                       [
+                               LIBS="$LIBS $with_openssl_libs -lssl -lcrypto $DL_LIBS"
+                               AC_TRY_LINK_FUNC(SSL_read, openssl_libs="yes", openssl_libs="no")
+                               LIBS="$LIBS_save"
+                       ])
+                       if test "x${openssl_libs}" != "xno"; then
+                               AC_DEFINE(USE_OPENSSL, 1, [Define if you use OpenSSL to support SSL])
+                               msg_ssl="yes (OpenSSL)"
+                               OPENSSL_LIBS="$with_openssl_libs -lssl -lcrypto $DL_LIBS"
+                       else
+                               OPENSSL_CFLAGS=""
+                               OPENSSL_LIBS=""
+                       fi
+               else
+                       AC_MSG_CHECKING(for OpenSSL libraries)
+                       AC_MSG_RESULT(no)
+               fi
+       else
+               OPENSSL_CFLAGS=""
+               OPENSSL_LIBS=""
+               ac_cv_enable_openssl="no"
+       fi
+
+       AC_SUBST(OPENSSL_CFLAGS)
+       AC_SUBST(OPENSSL_LIBS)
+])
\ No newline at end of file
index 0f8bbbb..f8be29a 100644 (file)
@@ -221,6 +221,7 @@ INCLUDES = \
        $(GDK_IMLIB_CFLAGS) \
        $(GDK_PIXBUF_CFLAGS) \
        $(GPGME_CFLAGS) \
+       $(OPENSSL_CFLAGS) \
        -I$(includedir)
 
 sylpheed_LDADD = \
@@ -231,7 +232,8 @@ sylpheed_LDADD = \
        $(GDK_IMLIB_LIBS) \
        $(GDK_PIXBUF_LIBS) \
        $(GPGME_LIBS) \
-       $(LDAP_LIBS)
+       $(LDAP_LIBS) \
+       $(OPENSSL_LIBS)
 
 CPPFLAGS = \
        -DLOCALEDIR=\""$(localedir)"\" \
index 1b61645..b522047 100644 (file)
@@ -145,7 +145,7 @@ static void about_create(void)
 #if USE_GPGME
                   " GnuPG"
 #endif
-#if USE_SSL
+#if USE_OPENSSL
                   " OpenSSL"
 #endif
 #if USE_LDAP
index 83539c7..2e3a16b 100644 (file)
@@ -872,7 +872,7 @@ static gint account_clist_set_row(PrefsAccount *ac_prefs, gint row)
        text[COL_DEFAULT] = "";
        text[COL_GETALL]  = "";
        text[COL_NAME]    = ac_prefs->account_name;
-#if USE_SSL
+#if USE_OPENSSL
        text[COL_PROTOCOL] = ac_prefs->protocol == A_POP3 ?
                             (ac_prefs->ssl_pop == SSL_TUNNEL ?
                              "POP3 (SSL)" :
index b99e82d..9b7939f 100644 (file)
@@ -8,12 +8,18 @@ libsylpheedcommon_la_SOURCES = \
        nntp.c nntp.h \
        socket.c socket.h \
        ssl.c ssl.h \
+       sylpheed.c sylpheed.h \
        template.c template.h \
        utils.c utils.h \
        uuencode.c uuencode.h
 
 INCLUDES = \
-       $(GLIB_CFLAGS)
+       $(GLIB_CFLAGS) \
+       $(OPENSSL_CFLAGS)
+
+CPPFLAGS = \
+       -DLOCALEDIR=\""$(localedir)"\"
 
 libsylpheedcommon_la_LIBADD = \
-       $(GLIB_LIBS)
+       $(GLIB_LIBS) \
+       $(OPENSSL_LIBS)
index a26470d..d5a1848 100644 (file)
@@ -33,7 +33,19 @@ static FILE *log_fp = NULL;
 
 void set_log_file(const gchar *filename)
 {
-       if (log_fp) return;
+       if (log_fp)
+               return;
+
+       /* backup old logfile if existing */
+       if (is_file_exist(filename)) {
+               gchar *backupname;
+               
+               backupname = g_strconcat(filename, ".bak", NULL);
+               if (rename(filename, backupname) < 0)
+                       FILE_OP_ERROR(filename, "rename");
+               g_free(backupname);
+       }
+
        log_fp = fopen(filename, "wb");
        if (!log_fp)
                FILE_OP_ERROR(filename, "fopen");
index d9b6f4d..14a5323 100644 (file)
@@ -30,7 +30,7 @@
 #include "socket.h"
 #include "utils.h"
 #include "log.h"
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
@@ -47,7 +47,7 @@ static gint nntp_gen_command  (NNTPSockInfo   *sock,
                                 const gchar    *format,
                                 ...);
 
-#if USE_SSL
+#if USE_OPENSSL
 NNTPSockInfo *nntp_open(const gchar *server, gushort port, gchar *buf,
                        SSLType ssl_type)
 #else
@@ -63,7 +63,7 @@ NNTPSockInfo *nntp_open(const gchar *server, gushort port, gchar *buf)
                return NULL;
        }
 
-#if USE_SSL
+#if USE_OPENSSL
        if (ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
                sock_close(sock);
                return NULL;
@@ -82,7 +82,7 @@ NNTPSockInfo *nntp_open(const gchar *server, gushort port, gchar *buf)
        }
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 NNTPSockInfo *nntp_open_auth(const gchar *server, gushort port, gchar *buf,
                             const gchar *userid, const gchar *passwd,
                             SSLType ssl_type)
@@ -93,7 +93,7 @@ NNTPSockInfo *nntp_open_auth(const gchar *server, gushort port, gchar *buf,
 {
        NNTPSockInfo *sock;
 
-#if USE_SSL
+#if USE_OPENSSL
        sock = nntp_open(server, port, buf, ssl_type);
 #else
        sock = nntp_open(server, port, buf);
index 62e68ce..46d05d4 100644 (file)
@@ -21,7 +21,7 @@
 #define __NNTP_H__
 
 #include "socket.h"
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
@@ -48,7 +48,7 @@ struct _NNTPSockInfo
 
 #define NNTPBUFSIZE    8192
 
-#if USE_SSL
+#if USE_OPENSSL
 NNTPSockInfo *nntp_open                (const gchar    *server,
                                 gushort         port,
                                 gchar          *buf,
index e9bbef2..1e26abe 100644 (file)
@@ -44,7 +44,7 @@
 #include "socket.h"
 #include "utils.h"
 #include "log.h"
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
@@ -455,7 +455,7 @@ gint sock_read(SockInfo *sock, gchar *buf, gint len)
 {
        g_return_val_if_fail(sock != NULL, -1);
 
-#if USE_SSL
+#if USE_OPENSSL
        if (sock->ssl)
                return ssl_read(sock->ssl, buf, len);
 #endif
@@ -470,7 +470,7 @@ gint fd_read(gint fd, gchar *buf, gint len)
        return read(fd, buf, len);
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 gint ssl_read(SSL *ssl, gchar *buf, gint len)
 {
        return SSL_read(ssl, buf, len);
@@ -481,7 +481,7 @@ gint sock_write(SockInfo *sock, const gchar *buf, gint len)
 {
        g_return_val_if_fail(sock != NULL, -1);
 
-#if USE_SSL
+#if USE_OPENSSL
        if (sock->ssl)
                return ssl_write(sock->ssl, buf, len);
 #endif
@@ -509,7 +509,7 @@ gint fd_write(gint fd, const gchar *buf, gint len)
        return wrlen;
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 gint ssl_write(SSL *ssl, const gchar *buf, gint len)
 {
        gint n, wrlen = 0;
@@ -557,7 +557,7 @@ gint fd_gets(gint fd, gchar *buf, gint len)
        return bp - buf;
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 gint ssl_gets(SSL *ssl, gchar *buf, gint len)
 {
        gchar *newline, *bp = buf;
@@ -585,7 +585,7 @@ gint sock_gets(SockInfo *sock, gchar *buf, gint len)
 {
        g_return_val_if_fail(sock != NULL, -1);
 
-#if USE_SSL
+#if USE_OPENSSL
        if (sock->ssl)
                return ssl_gets(sock->ssl, buf, len);
 #endif
@@ -621,7 +621,7 @@ gchar *fd_getline(gint fd)
        return str;
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 gchar *ssl_getline(SSL *ssl)
 {
        gchar buf[BUFFSIZE];
@@ -649,7 +649,7 @@ gchar *sock_getline(SockInfo *sock)
 {
        g_return_val_if_fail(sock != NULL, NULL);
 
-#if USE_SSL
+#if USE_OPENSSL
        if (sock->ssl)
                return ssl_getline(sock->ssl);
 #endif
@@ -673,7 +673,7 @@ gint sock_peek(SockInfo *sock)
 
        g_return_val_if_fail(sock != NULL, -1);
 
-#if USE_SSL
+#if USE_OPENSSL
        if (sock->ssl) {
                if ((n = SSL_peek(sock->ssl, &ch, 1)) < 0)
                        return -1;
@@ -694,7 +694,7 @@ gint sock_close(SockInfo *sock)
        if (!sock)
                return 0;
 
-#if USE_SSL
+#if USE_OPENSSL
        if (sock->ssl)
                ssl_done_socket(sock);
 #endif
index 733eac2..68d178a 100644 (file)
@@ -29,7 +29,7 @@
 
 typedef struct _SockInfo       SockInfo;
 
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
@@ -55,7 +55,7 @@ struct _SockInfo
        gushort port;
        ConnectionState state;
        gpointer data;
-#if USE_SSL
+#if USE_OPENSSL
        SSL *ssl;
 #endif
 };
@@ -95,7 +95,7 @@ gchar *fd_getline     (gint sock);
 gint fd_close          (gint sock);
 
 /* Functions for SSL */
-#if USE_SSL
+#if USE_OPENSSL
 gint ssl_read(SSL *ssl, gchar *buf, gint len);
 gint ssl_write(SSL *ssl, const gchar *buf, gint len);
 gint ssl_gets(SSL *ssl, gchar *buf, gint len);
index 5383bcd..c93e4b7 100644 (file)
@@ -21,7 +21,7 @@
 #  include "config.h"
 #endif
 
-#if USE_SSL
+#if USE_OPENSSL
 
 #include "defs.h"
 
@@ -133,4 +133,4 @@ void ssl_done_socket(SockInfo *sockinfo)
        }
 }
 
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
index 9e788a8..ccc2362 100644 (file)
@@ -24,7 +24,7 @@
 #  include "config.h"
 #endif
 
-#if USE_SSL
+#if USE_OPENSSL
 
 #include <glib.h>
 #include <openssl/crypto.h>
@@ -54,6 +54,6 @@ gboolean ssl_init_socket_with_method  (SockInfo       *sockinfo,
                                         SSLMethod       method);
 void ssl_done_socket                   (SockInfo       *sockinfo);
 
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 
 #endif /* __SSL_H__ */
diff --git a/src/common/sylpheed.c b/src/common/sylpheed.c
new file mode 100644 (file)
index 0000000..1dd0a89
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999,2000 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib.h>
+
+#if HAVE_LOCALE_H
+#  include <locale.h>
+#endif
+
+#include "sylpheed.h"
+#include "intl.h"
+#include "defs.h"
+#include "utils.h"
+#include "ssl.h"
+#include "version.h"
+
+static gboolean sylpheed_initialized = FALSE;
+
+gboolean sylpheed_init(int *argc, char ***argv)
+{
+       if (sylpheed_initialized)
+               return TRUE;
+
+       setlocale(LC_ALL, "");
+       bindtextdomain(PACKAGE, LOCALEDIR);
+       textdomain(PACKAGE);
+
+       /* backup if old rc file exists */
+       if (is_file_exist(RC_DIR)) {
+               if (rename(RC_DIR, RC_DIR ".bak") < 0) {
+                       FILE_OP_ERROR(RC_DIR, "rename");
+                       return FALSE;
+               }
+       }
+
+#if USE_OPENSSL
+       ssl_init();
+#endif
+
+       srandom((gint)time(NULL));
+
+       sylpheed_initialized = TRUE;
+
+       return TRUE;
+}
diff --git a/src/common/sylpheed.h b/src/common/sylpheed.h
new file mode 100644 (file)
index 0000000..c50de47
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999,2000 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+gboolean sylpheed_init (int *argc, char ***argv);
diff --git a/src/common/version.h b/src/common/version.h
new file mode 100644 (file)
index 0000000..c188c52
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2001 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __VERSION_H__
+#define __VERSION_H__
+
+#define PACKAGE                        "sylpheed"
+#define VERSION                        "0.8.6claws75"
+#define PROG_VERSION           "Sylpheed version "VERSION
+
+#endif /* __VERSION_H__ */
similarity index 100%
rename from src/version.h.in
rename to src/common/version.h.in
index 155292b..9ecd6ac 100644 (file)
@@ -415,8 +415,8 @@ static const gchar *get_compiled_in_features(void)
 #if USE_GPGME
                   " GPGME"
 #endif
-#if USE_SSL
-                  " SSL"
+#if USE_OPENSSL
+                  " OpenSSL"
 #endif
 #if USE_LDAP
                   " LDAP"
index 8f22706..8d03be5 100644 (file)
@@ -27,7 +27,7 @@
 #include <glib.h>
 
 #include "socket.h"
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
index dce3ff7..b20fd52 100644 (file)
@@ -21,7 +21,7 @@
 #  include "config.h"
 #endif
 
-#if USE_SSL
+#if USE_OPENSSL
 
 #include <openssl/ssl.h>
 #include <glib.h>
index 534ad32..bd82e7c 100644 (file)
@@ -51,7 +51,7 @@
 #include "log.h"
 
 #define IMAP4_PORT     143
-#if USE_SSL
+#if USE_OPENSSL
 #define IMAPS_PORT     993
 #endif
 
@@ -123,7 +123,7 @@ static GSList *imap_delete_cached_messages  (GSList         *mlist,
                                                 guint32         last_uid);
 static void imap_delete_all_cached_messages    (FolderItem     *item);
 
-#if USE_SSL
+#if USE_OPENSSL
 static SockInfo *imap_open             (const gchar    *server,
                                         gushort         port,
                                         SSLType         ssl_type);
@@ -132,7 +132,7 @@ static SockInfo *imap_open          (const gchar    *server,
                                         gushort         port);
 #endif
 
-#if USE_SSL
+#if USE_OPENSSL
 static SockInfo *imap_open_tunnel(const gchar *server,
                                  const gchar *tunnelcmd,
                                  SSLType ssl_type);
@@ -141,7 +141,7 @@ static SockInfo *imap_open_tunnel(const gchar *server,
                                  const gchar *tunnelcmd);
 #endif
 
-#if USE_SSL
+#if USE_OPENSSL
 static SockInfo *imap_init_sock(SockInfo *sock, SSLType         ssl_type);
 #else
 static SockInfo *imap_init_sock(SockInfo *sock);
@@ -402,7 +402,7 @@ static IMAPSession *imap_session_get(Folder *folder)
        g_return_val_if_fail(folder->type == F_IMAP, NULL);
        g_return_val_if_fail(folder->account != NULL, NULL);
 
-#if USE_SSL
+#if USE_OPENSSL
        port = folder->account->set_imapport ? folder->account->imapport
                : folder->account->ssl_imap == SSL_TUNNEL
                ? IMAPS_PORT : IMAP4_PORT;
@@ -480,7 +480,7 @@ Session *imap_session_new(const PrefsAccount *account)
        gushort port;
        gboolean is_preauth;
 
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
        /* FIXME: IMAP over SSL only... */ 
        SSLType ssl_type;
 
@@ -494,7 +494,7 @@ Session *imap_session_new(const PrefsAccount *account)
 
        if (account->set_tunnelcmd) {
                log_message(_("creating tunneled IMAP4 connection\n"));
-#if USE_SSL
+#if USE_OPENSSL
                if ((imap_sock = imap_open_tunnel(account->recv_server, 
                                                  account->tunnelcmd,
                                                  ssl_type)) == NULL)
@@ -509,7 +509,7 @@ Session *imap_session_new(const PrefsAccount *account)
                log_message(_("creating IMAP4 connection to %s:%d ...\n"),
                            account->recv_server, port);
                
-#if USE_SSL
+#if USE_OPENSSL
                if ((imap_sock = imap_open(account->recv_server, port,
                                           ssl_type)) == NULL)
 #else
@@ -1804,7 +1804,7 @@ static void imap_delete_all_cached_messages(FolderItem *item)
        debug_print("done.\n");
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 static SockInfo *imap_open_tunnel(const gchar *server,
                           const gchar *tunnelcmd,
                           SSLType ssl_type)
@@ -1819,7 +1819,7 @@ static SockInfo *imap_open_tunnel(const gchar *server,
                log_warning(_("Can't establish IMAP4 session with: %s\n"),
                            server);
                return NULL;
-#if USE_SSL
+#if USE_OPENSSL
        return imap_init_sock(sock, ssl_type);
 #else
        return imap_init_sock(sock);
@@ -1827,7 +1827,7 @@ static SockInfo *imap_open_tunnel(const gchar *server,
 }
 
 
-#if USE_SSL
+#if USE_OPENSSL
 static SockInfo *imap_open(const gchar *server, gushort port,
                           SSLType ssl_type)
 #else
@@ -1842,7 +1842,7 @@ static SockInfo *imap_open(const gchar *server, gushort port)
                return NULL;
        }
 
-#if USE_SSL
+#if USE_OPENSSL
        if (ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
                log_warning(_("Can't establish IMAP4 session with: %s:%d\n"),
                            server, port);
@@ -1855,14 +1855,14 @@ static SockInfo *imap_open(const gchar *server, gushort port)
 #endif
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 static SockInfo *imap_init_sock(SockInfo *sock, SSLType ssl_type)
 #else
 static SockInfo *imap_init_sock(SockInfo *sock)
 #endif
 {
        imap_cmd_count = 0;
-#if USE_SSL
+#if USE_OPENSSL
        if (ssl_type == SSL_STARTTLS) {
                gint ok;
 
index c13763b..f8c887c 100644 (file)
@@ -27,7 +27,7 @@
 #include <glib.h>
 #include <time.h>
 
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 #include "folder.h"
index 45aa4d6..de99261 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -696,7 +696,7 @@ static IncState inc_pop3_session_do(IncSession *session)
        gchar *buf;
        static AtmHandler handlers[] = {
                pop3_greeting_recv      ,
-#if USE_SSL
+#if USE_OPENSSL
                pop3_stls_send          , pop3_stls_recv,
 #endif
                pop3_getauth_user_send  , pop3_getauth_user_recv,
@@ -740,7 +740,7 @@ static IncState inc_pop3_session_do(IncSession *session)
        atm->num = POP3_GREETING_RECV;
 
        server = pop3_state->ac_prefs->recv_server;
-#if USE_SSL
+#if USE_OPENSSL
        port = pop3_state->ac_prefs->set_popport ?
                pop3_state->ac_prefs->popport :
                pop3_state->ac_prefs->ssl_pop == SSL_TUNNEL ? 995 : 110;
@@ -774,7 +774,7 @@ static IncState inc_pop3_session_do(IncSession *session)
                return INC_CONNECT_ERROR;
        }
 
-#if USE_SSL
+#if USE_OPENSSL
        if (pop3_state->ac_prefs->ssl_pop == SSL_TUNNEL &&
            !ssl_init_socket(sockinfo)) {
                pop3_automaton_terminate(sockinfo, atm);
index 7a7776d..52e8858 100644 (file)
 #include <sys/types.h>
 #include <signal.h>
 
-#if HAVE_LOCALE_H
-#  include <locale.h>
-#endif
-
 #if USE_GPGME
 #  include <gpgme.h>
 #  include "passphrase.h"
 #endif
 
+#include "sylpheed.h"
 #include "intl.h"
 #include "main.h"
 #include "mainwindow.h"
@@ -78,7 +75,7 @@
 #if USE_GPGME
 #  include "rfc2015.h"
 #endif
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
@@ -88,7 +85,6 @@
 
 gchar *prog_version;
 gchar *startup_dir;
-gchar *argv0;
 
 static gint lock_socket = -1;
 static gint lock_socket_tag = 0;
@@ -165,13 +161,12 @@ int main(int argc, char *argv[])
        MainWindow *mainwin;
        FolderView *folderview;
 
-       setlocale(LC_ALL, "");
-       bindtextdomain(PACKAGE, LOCALEDIR);
-       textdomain(PACKAGE);
+       if(!sylpheed_init(&argc, &argv)) {
+               return 0;
+       }
 
        prog_version = PROG_VERSION;
        startup_dir = g_get_current_dir();
-       argv0 = g_strdup(argv[0]);
 
        parse_cmd_opt(argc, argv);
 
@@ -207,12 +202,6 @@ int main(int argc, char *argv[])
        gtk_widget_push_colormap(gdk_imlib_get_colormap());
 #endif
 
-#if USE_SSL
-       ssl_init();
-#endif
-
-       srandom((gint)time(NULL));
-
        /* parse gtkrc files */
        userrc = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".gtkrc",
                             NULL);
@@ -234,11 +223,6 @@ int main(int argc, char *argv[])
 
        CHDIR_RETURN_VAL_IF_FAIL(get_home_dir(), 1);
 
-       /* backup if old rc file exists */
-       if (is_file_exist(RC_DIR)) {
-               if (rename(RC_DIR, RC_DIR ".bak") < 0)
-                       FILE_OP_ERROR(RC_DIR, "rename");
-       }
        MAKE_DIR_IF_NOT_EXIST(RC_DIR);
        MAKE_DIR_IF_NOT_EXIST(get_imap_cache_dir());
        MAKE_DIR_IF_NOT_EXIST(get_news_cache_dir());
@@ -246,11 +230,6 @@ int main(int argc, char *argv[])
        MAKE_DIR_IF_NOT_EXIST(get_tmp_dir());
        MAKE_DIR_IF_NOT_EXIST(RC_DIR G_DIR_SEPARATOR_S "uidl");
 
-       if (is_file_exist(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log")) {
-               if (rename(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log",
-                          RC_DIR G_DIR_SEPARATOR_S "sylpheed.log.bak") < 0)
-                       FILE_OP_ERROR("sylpheed.log", "rename");
-       }
        set_log_file(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log");
 
        prefs_common_init();
@@ -605,7 +584,7 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        if (!cmd.crash)
                unlink(get_crashfile_name());
 
-#if USE_SSL
+#if USE_OPENSSL
        ssl_done();
 #endif
 
index ef75f00..d6fb535 100644 (file)
@@ -464,7 +464,7 @@ static void prefs_scoring_open_cb   (MainWindow     *mainwin,
 static void prefs_filtering_open_cb    (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
 static void ssl_manager_open_cb        (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
@@ -762,7 +762,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, delete_duplicated_cb,   0, NULL},
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
        {N_("/_Tools/E_xecute"),                "X", execute_summary_cb, 0, NULL},
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
        {N_("/_Tools/SSL certi_ficates..."),    
                                                NULL, ssl_manager_open_cb, 0, NULL},
@@ -3447,7 +3447,7 @@ static void prefs_actions_open_cb(MainWindow *mainwin, guint action,
 {
        prefs_actions_open(mainwin);
 }
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
 static void ssl_manager_open_cb(MainWindow *mainwin, guint action,
                                  GtkWidget *widget)
 {
index 0cd38d1..ed52654 100644 (file)
 #include "inputdialog.h"
 #include "alertpanel.h"
 #include "log.h"
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
 #define NNTP_PORT      119
-#if USE_SSL
+#if USE_OPENSSL
 #define NNTPS_PORT     563
 #endif
 
@@ -61,7 +61,7 @@ static void news_folder_init           (Folder        *folder,
                                          const gchar   *name,
                                          const gchar   *path);
 
-#if USE_SSL
+#if USE_OPENSSL
 static Session *news_session_new        (const gchar   *server,
                                          gushort        port,
                                          const gchar   *userid,
@@ -161,7 +161,7 @@ static void news_folder_init(Folder *folder, const gchar *name,
        folder->get_msginfos = news_get_msginfos;
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 static Session *news_session_new(const gchar *server, gushort port,
                                 const gchar *userid, const gchar *passwd,
                                 SSLType ssl_type)
@@ -178,7 +178,7 @@ static Session *news_session_new(const gchar *server, gushort port,
 
        log_message(_("creating NNTP connection to %s:%d ...\n"), server, port);
 
-#if USE_SSL
+#if USE_OPENSSL
        if (userid && passwd)
                nntp_sock = nntp_open_auth(server, port, buf, userid, passwd,
                                           ssl_type);
@@ -241,7 +241,7 @@ static Session *news_session_new_for_folder(Folder *folder)
                                                             userid);
        }
 
-#if USE_SSL
+#if USE_OPENSSL
        port = ac->set_nntpport ? ac->nntpport
                : ac->ssl_nntp ? NNTPS_PORT : NNTP_PORT;
        session = news_session_new(ac->nntp_server, port, userid, passwd,
index cede2ce..8738bb4 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -40,7 +40,7 @@
 #include "recv.h"
 #include "selective_download.h"
 #include "log.h"
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 
@@ -99,7 +99,7 @@ gint pop3_greeting_recv(SockInfo *sock, gpointer data)
 
        if ((ok = pop3_ok(sock, buf)) == PS_SUCCESS) {
                state->greeting = g_strdup(buf);
-#if USE_SSL
+#if USE_OPENSSL
                if (state->ac_prefs->ssl_pop == SSL_STARTTLS)
                        return POP3_STLS_SEND;
 #endif
@@ -113,7 +113,7 @@ gint pop3_greeting_recv(SockInfo *sock, gpointer data)
        }
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 gint pop3_stls_send(SockInfo *sock, gpointer data)
 {
        pop3_gen_send(sock, "STLS");
@@ -144,7 +144,7 @@ gint pop3_stls_recv(SockInfo *sock, gpointer data)
                return -1;
        }
 }
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 
 gint pop3_getauth_user_send(SockInfo *sock, gpointer data)
 {
index bbb5a88..85e27db 100644 (file)
--- a/src/pop.h
+++ b/src/pop.h
@@ -35,7 +35,7 @@ typedef struct _Pop3State     Pop3State;
 
 typedef enum {
        POP3_GREETING_RECV,
-#if USE_SSL
+#if USE_OPENSSL
        POP3_STLS_SEND,
        POP3_STLS_RECV,
 #endif
@@ -145,7 +145,7 @@ gint pop3_getauth_pass_send (SockInfo *sock, gpointer data);
 gint pop3_getauth_pass_recv    (SockInfo *sock, gpointer data);
 gint pop3_getauth_apop_send    (SockInfo *sock, gpointer data);
 gint pop3_getauth_apop_recv    (SockInfo *sock, gpointer data);
-#if USE_SSL
+#if USE_OPENSSL
 gint pop3_stls_send            (SockInfo *sock, gpointer data);
 gint pop3_stls_recv            (SockInfo *sock, gpointer data);
 #endif
index 67b87df..245ee50 100644 (file)
@@ -138,7 +138,7 @@ static struct Privacy {
 } privacy;
 #endif /* USE_GPGME */
 
-#if USE_SSL
+#if USE_OPENSSL
 static struct SSLPrefs {
        GtkWidget *pop_frame;
        GtkWidget *pop_nossl_radiobtn;
@@ -159,7 +159,7 @@ static struct SSLPrefs {
        GtkWidget *smtp_ssltunnel_radiobtn;
        GtkWidget *smtp_starttls_radiobtn;
 } ssl;
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 
 static struct Advanced {
        GtkWidget *smtpport_chkbtn;
@@ -201,10 +201,10 @@ static void prefs_account_smtp_auth_type_set_data_from_optmenu
                                                        (PrefParam *pparam);
 static void prefs_account_smtp_auth_type_set_optmenu   (PrefParam *pparam);
 
-#if USE_GPGME || USE_SSL
+#if USE_GPGME || USE_OPENSSL
 static void prefs_account_enum_set_data_from_radiobtn  (PrefParam *pparam);
 static void prefs_account_enum_set_radiobtn            (PrefParam *pparam);
-#endif /* USE_GPGME || USE_SSL */
+#endif /* USE_GPGME || USE_OPENSSL */
 
 #if USE_GPGME
 static void prefs_account_gnupg_inline_warning         (GtkWidget *widget);
@@ -393,7 +393,7 @@ static PrefParam param[] = {
         prefs_set_data_from_entry, prefs_set_entry},
 #endif /* USE_GPGME */
 
-#if USE_SSL
+#if USE_OPENSSL
        /* SSL */
        {"ssl_pop", "0", &tmp_ac_prefs.ssl_pop, P_ENUM,
         &ssl.pop_nossl_radiobtn,
@@ -411,7 +411,7 @@ static PrefParam param[] = {
         &ssl.smtp_nossl_radiobtn,
         prefs_account_enum_set_data_from_radiobtn,
         prefs_account_enum_set_radiobtn},
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 
        /* Advanced */
        {"set_smtpport", "FALSE", &tmp_ac_prefs.set_smtpport, P_BOOL,
@@ -508,9 +508,9 @@ static void prefs_account_compose_create    (void);
 #if USE_GPGME
 static void prefs_account_privacy_create       (void);
 #endif /* USE_GPGME */
-#if USE_SSL
+#if USE_OPENSSL
 static void prefs_account_ssl_create           (void);
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 static void prefs_account_advanced_create      (void);
 
 static void prefs_account_select_folder_cb     (GtkWidget      *widget,
@@ -738,10 +738,10 @@ static void prefs_account_create(void)
        prefs_account_privacy_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
 #endif /* USE_GPGME */
-#if USE_SSL
+#if USE_OPENSSL
        prefs_account_ssl_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("SSL"), page++);
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
        prefs_account_advanced_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Advanced"), page++);
 
@@ -1623,7 +1623,7 @@ static void prefs_account_privacy_create(void)
 }
 #endif /* USE_GPGME */
 
-#if USE_SSL
+#if USE_OPENSSL
 
 #define CREATE_RADIO_BUTTON(box, btn, btn_p, label, data)              \
 {                                                                      \
@@ -1772,7 +1772,7 @@ static void prefs_account_ssl_create(void)
 
 #undef CREATE_RADIO_BUTTONS
 #undef CREATE_RADIO_BUTTON
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 
 static void crosspost_color_toggled(void)
 {
@@ -2137,7 +2137,7 @@ static void prefs_account_edit_custom_header(void)
        prefs_custom_header_open(&tmp_ac_prefs);
 }
 
-#if USE_GPGME || USE_SSL
+#if USE_GPGME || USE_OPENSSL
 static void prefs_account_enum_set_data_from_radiobtn(PrefParam *pparam)
 {
        GtkRadioButton *radiobtn;
@@ -2176,7 +2176,7 @@ static void prefs_account_enum_set_radiobtn(PrefParam *pparam)
        }
 }
 
-#endif /* USE_GPGME || USE_SSL */
+#endif /* USE_GPGME || USE_OPENSSL */
 
 #if USE_GPGME
 static void prefs_account_gnupg_inline_warning(GtkWidget *widget)
@@ -2350,7 +2350,7 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                                 FALSE);
                }
 
-#if USE_SSL
+#if USE_OPENSSL
                gtk_widget_hide(ssl.pop_frame);
                gtk_widget_hide(ssl.imap_frame);
                gtk_widget_show(ssl.nntp_frame);
@@ -2419,7 +2419,7 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                                 TRUE);
                }
 
-#if USE_SSL
+#if USE_OPENSSL
                gtk_widget_hide(ssl.pop_frame);
                gtk_widget_hide(ssl.imap_frame);
                gtk_widget_hide(ssl.nntp_frame);
@@ -2490,7 +2490,7 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                                 FALSE);
                }
 
-#if USE_SSL
+#if USE_OPENSSL
                gtk_widget_hide(ssl.pop_frame);
                gtk_widget_show(ssl.imap_frame);
                gtk_widget_hide(ssl.nntp_frame);
@@ -2560,7 +2560,7 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                                 TRUE);
                }
 
-#if USE_SSL
+#if USE_OPENSSL
                gtk_widget_show(ssl.pop_frame);
                gtk_widget_hide(ssl.imap_frame);
                gtk_widget_hide(ssl.nntp_frame);
index c6ae3e0..69e5d0b 100644 (file)
@@ -94,12 +94,12 @@ struct _PrefsAccount
        gboolean use_mail_command;
        gchar * mail_command;
 
-#if USE_SSL
+#if USE_OPENSSL
        SSLType ssl_pop;
        SSLType ssl_imap;
        SSLType ssl_nntp;
        SSLType ssl_smtp;
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 
        /* Temporarily preserved password */
        gchar *tmp_pass;
index 9f15f7b..a0ec0c8 100644 (file)
@@ -237,7 +237,7 @@ static struct Other {
        GtkWidget *checkbtn_warnqueued;
         GtkWidget *checkbtn_cliplog;
         GtkWidget *loglength_entry;
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
        GtkWidget *checkbtn_ssl_ask_unknown_valid;
 #endif
 } other;
@@ -801,7 +801,7 @@ static PrefParam param[] = {
        {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
         P_BOOL, &other.checkbtn_warnqueued,
         prefs_set_data_from_toggle, prefs_set_toggle},
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
        {"ssl_ask_unknown_valid", "TRUE", &prefs_common.ssl_ask_unknown_valid,
         P_BOOL, &other.checkbtn_ssl_ask_unknown_valid,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -2849,7 +2849,7 @@ static void prefs_other_create(void)
        GtkWidget *checkbtn_cleanonexit;
        GtkWidget *checkbtn_askonclean;
        GtkWidget *checkbtn_warnqueued;
-#ifdef USE_SSL 
+#ifdef USE_OPENSSL
        GtkWidget *frame_ssl;
        GtkWidget *vbox_ssl;
        GtkWidget *hbox_ssl;
@@ -2963,7 +2963,7 @@ static void prefs_other_create(void)
                            FALSE, TRUE, 0);
        SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
 
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
        /* SSL */
        PACK_FRAME (vbox1, frame_ssl, _("Security"));
 
@@ -3019,7 +3019,7 @@ static void prefs_other_create(void)
        other.checkbtn_askonclean  = checkbtn_askonclean;
        other.checkbtn_warnqueued  = checkbtn_warnqueued;
        
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
        other.checkbtn_ssl_ask_unknown_valid = checkbtn_ssl_ask_unknown_valid;
 #endif
 }
index 74142ea..f693e04 100644 (file)
@@ -255,7 +255,7 @@ struct _PrefsCommon
        gboolean clean_on_exit;
        gboolean ask_on_clean;
        gboolean warn_queued_on_exit;
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
        gboolean ssl_ask_unknown_valid;
 #endif
        /* Memory cache*/
index 5a09121..2bc26d3 100644 (file)
@@ -353,7 +353,7 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list,
        size = get_left_file_size(fp);
        if (size < 0) return -1;
 
-#if USE_SSL
+#if USE_OPENSSL
        port = ac_prefs->set_smtpport ? ac_prefs->smtpport :
                ac_prefs->ssl_smtp == SSL_TUNNEL ? SSMTP_PORT : SMTP_PORT;
 #else
@@ -412,7 +412,7 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list,
        session->data = dialog;
        session->ui_func = (SessionUIFunc)send_progress_dialog_update;
 
-#if USE_SSL
+#if USE_OPENSSL
        SEND_EXIT_IF_NOTOK
                (smtp_connect(SMTP_SESSION(session), ac_prefs->smtp_server,
                              port, domain, user, pass, ac_prefs->ssl_smtp),
index 4445946..f5f9673 100644 (file)
@@ -25,7 +25,7 @@
 #include "prefs_account.h"
 
 #define SMTP_PORT      25
-#if USE_SSL
+#if USE_OPENSSL
 #define SSMTP_PORT     465
 #endif
 
index b361281..82a0cba 100644 (file)
@@ -79,7 +79,7 @@ void smtp_session_destroy(Session *session)
        g_free(SMTP_SESSION(session)->pass);
 }
 
-#if USE_SSL
+#if USE_OPENSSL
 gint smtp_connect(SMTPSession *session, const gchar *server, gushort port,
                  const gchar *domain, const gchar *user, const gchar *pass,
                  SSLType ssl_type)
@@ -96,7 +96,7 @@ gint smtp_connect(SMTPSession *session, const gchar *server, gushort port,
        g_return_val_if_fail(session != NULL, SM_ERROR);
        g_return_val_if_fail(server != NULL, SM_ERROR);
 
-#if USE_SSL
+#if USE_OPENSSL
        use_esmtp = user != NULL || ssl_type == SSL_STARTTLS;
 #else
        use_esmtp = user != NULL;
@@ -114,7 +114,7 @@ gint smtp_connect(SMTPSession *session, const gchar *server, gushort port,
                return SM_ERROR;
        }
 
-#if USE_SSL
+#if USE_OPENSSL
        if (ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
                log_warning(_("SSL connection failed"));
                sock_close(sock);
@@ -144,7 +144,7 @@ gint smtp_connect(SMTPSession *session, const gchar *server, gushort port,
                return val;
        }
 
-#if USE_SSL
+#if USE_OPENSSL
        if (ssl_type == SSL_STARTTLS) {
                val = smtp_starttls(session);
                if (val != SM_OK) {
index 316e212..86bf614 100644 (file)
@@ -27,7 +27,7 @@
 #include <glib.h>
 
 #include "socket.h"
-#if USE_SSL
+#if USE_OPENSSL
 #  include "ssl.h"
 #endif
 #include "session.h"
@@ -83,7 +83,7 @@ struct _SMTPSession
 Session *smtp_session_new      (void);
 void smtp_session_destroy      (Session        *session);
 
-#if USE_SSL
+#if USE_OPENSSL
 gint smtp_connect              (SMTPSession    *session,
                                 const gchar    *server,
                                 gushort         port,
index 9f96749..d44ca31 100644 (file)
@@ -21,7 +21,7 @@
 #  include "config.h"
 #endif
 
-#if USE_SSL
+#if USE_OPENSSL
 
 #include <openssl/ssl.h>
 #include <glib.h>
@@ -434,4 +434,4 @@ gboolean ssl_certificate_check (X509 *x509_cert, gchar *host, gushort port)
        return TRUE;
 }
 
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
index 9c70704..2378072 100644 (file)
@@ -24,7 +24,7 @@
 #  include "config.h"
 #endif
 
-#if USE_SSL
+#if USE_OPENSSL
 
 #include <openssl/ssl.h>
 #include <openssl/objects.h>
@@ -48,5 +48,5 @@ void ssl_certificate_delete_from_disk(SSLCertificate *cert);
 char * readable_fingerprint(unsigned char *src, int len);
 char *ssl_certificate_check_signer (X509 *cert);
 
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
 #endif /* SSL_CERTIFICATE_H */
index 16be64d..889e569 100644 (file)
@@ -20,7 +20,7 @@
 #  include "config.h"
 #endif
 
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
 #include <gtk/gtkwidget.h>
 #include <glib.h>
 #include <sys/types.h>
index 3a7453c..9b88fc0 100644 (file)
@@ -19,7 +19,7 @@
 
 #ifndef SSL_MANAGER_H
 #define SSL_MANAGER_H
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
 #include "mainwindow.h"
 
 void ssl_manager_create (void);