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
--- /dev/null
+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
$(GDK_IMLIB_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
$(GPGME_CFLAGS) \
+ $(OPENSSL_CFLAGS) \
-I$(includedir)
sylpheed_LDADD = \
$(GDK_IMLIB_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(GPGME_LIBS) \
- $(LDAP_LIBS)
+ $(LDAP_LIBS) \
+ $(OPENSSL_LIBS)
CPPFLAGS = \
-DLOCALEDIR=\""$(localedir)"\" \
#if USE_GPGME
" GnuPG"
#endif
-#if USE_SSL
+#if USE_OPENSSL
" OpenSSL"
#endif
#if USE_LDAP
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)" :
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)
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");
#include "socket.h"
#include "utils.h"
#include "log.h"
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
const gchar *format,
...);
-#if USE_SSL
+#if USE_OPENSSL
NNTPSockInfo *nntp_open(const gchar *server, gushort port, gchar *buf,
SSLType ssl_type)
#else
return NULL;
}
-#if USE_SSL
+#if USE_OPENSSL
if (ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
sock_close(sock);
return NULL;
}
}
-#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)
{
NNTPSockInfo *sock;
-#if USE_SSL
+#if USE_OPENSSL
sock = nntp_open(server, port, buf, ssl_type);
#else
sock = nntp_open(server, port, buf);
#define __NNTP_H__
#include "socket.h"
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
#define NNTPBUFSIZE 8192
-#if USE_SSL
+#if USE_OPENSSL
NNTPSockInfo *nntp_open (const gchar *server,
gushort port,
gchar *buf,
#include "socket.h"
#include "utils.h"
#include "log.h"
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
{
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
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);
{
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
return wrlen;
}
-#if USE_SSL
+#if USE_OPENSSL
gint ssl_write(SSL *ssl, const gchar *buf, gint len)
{
gint n, wrlen = 0;
return bp - buf;
}
-#if USE_SSL
+#if USE_OPENSSL
gint ssl_gets(SSL *ssl, gchar *buf, gint len)
{
gchar *newline, *bp = buf;
{
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
return str;
}
-#if USE_SSL
+#if USE_OPENSSL
gchar *ssl_getline(SSL *ssl)
{
gchar buf[BUFFSIZE];
{
g_return_val_if_fail(sock != NULL, NULL);
-#if USE_SSL
+#if USE_OPENSSL
if (sock->ssl)
return ssl_getline(sock->ssl);
#endif
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;
if (!sock)
return 0;
-#if USE_SSL
+#if USE_OPENSSL
if (sock->ssl)
ssl_done_socket(sock);
#endif
typedef struct _SockInfo SockInfo;
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
gushort port;
ConnectionState state;
gpointer data;
-#if USE_SSL
+#if USE_OPENSSL
SSL *ssl;
#endif
};
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);
# include "config.h"
#endif
-#if USE_SSL
+#if USE_OPENSSL
#include "defs.h"
}
}
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
# include "config.h"
#endif
-#if USE_SSL
+#if USE_OPENSSL
#include <glib.h>
#include <openssl/crypto.h>
SSLMethod method);
void ssl_done_socket (SockInfo *sockinfo);
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
#endif /* __SSL_H__ */
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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);
--- /dev/null
+/*
+ * 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__ */
#if USE_GPGME
" GPGME"
#endif
-#if USE_SSL
- " SSL"
+#if USE_OPENSSL
+ " OpenSSL"
#endif
#if USE_LDAP
" LDAP"
#include <glib.h>
#include "socket.h"
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
# include "config.h"
#endif
-#if USE_SSL
+#if USE_OPENSSL
#include <openssl/ssl.h>
#include <glib.h>
#include "log.h"
#define IMAP4_PORT 143
-#if USE_SSL
+#if USE_OPENSSL
#define IMAPS_PORT 993
#endif
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);
gushort port);
#endif
-#if USE_SSL
+#if USE_OPENSSL
static SockInfo *imap_open_tunnel(const gchar *server,
const gchar *tunnelcmd,
SSLType ssl_type);
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);
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;
gushort port;
gboolean is_preauth;
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
/* FIXME: IMAP over SSL only... */
SSLType ssl_type;
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)
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
debug_print("done.\n");
}
-#if USE_SSL
+#if USE_OPENSSL
static SockInfo *imap_open_tunnel(const gchar *server,
const gchar *tunnelcmd,
SSLType ssl_type)
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);
}
-#if USE_SSL
+#if USE_OPENSSL
static SockInfo *imap_open(const gchar *server, gushort port,
SSLType ssl_type)
#else
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);
#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;
#include <glib.h>
#include <time.h>
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
#include "folder.h"
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,
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;
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);
#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"
#if USE_GPGME
# include "rfc2015.h"
#endif
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
gchar *prog_version;
gchar *startup_dir;
-gchar *argv0;
static gint lock_socket = -1;
static gint lock_socket_tag = 0;
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);
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);
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());
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();
if (!cmd.crash)
unlink(get_crashfile_name());
-#if USE_SSL
+#if USE_OPENSSL
ssl_done();
#endif
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);
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},
{
prefs_actions_open(mainwin);
}
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
static void ssl_manager_open_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
#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
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,
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)
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);
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,
#include "recv.h"
#include "selective_download.h"
#include "log.h"
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
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
}
}
-#if USE_SSL
+#if USE_OPENSSL
gint pop3_stls_send(SockInfo *sock, gpointer data)
{
pop3_gen_send(sock, "STLS");
return -1;
}
}
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
gint pop3_getauth_user_send(SockInfo *sock, gpointer data)
{
typedef enum {
POP3_GREETING_RECV,
-#if USE_SSL
+#if USE_OPENSSL
POP3_STLS_SEND,
POP3_STLS_RECV,
#endif
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
} privacy;
#endif /* USE_GPGME */
-#if USE_SSL
+#if USE_OPENSSL
static struct SSLPrefs {
GtkWidget *pop_frame;
GtkWidget *pop_nossl_radiobtn;
GtkWidget *smtp_ssltunnel_radiobtn;
GtkWidget *smtp_starttls_radiobtn;
} ssl;
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
static struct Advanced {
GtkWidget *smtpport_chkbtn;
(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);
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,
&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,
#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,
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++);
}
#endif /* USE_GPGME */
-#if USE_SSL
+#if USE_OPENSSL
#define CREATE_RADIO_BUTTON(box, btn, btn_p, label, data) \
{ \
#undef CREATE_RADIO_BUTTONS
#undef CREATE_RADIO_BUTTON
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
static void crosspost_color_toggled(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;
}
}
-#endif /* USE_GPGME || USE_SSL */
+#endif /* USE_GPGME || USE_OPENSSL */
#if USE_GPGME
static void prefs_account_gnupg_inline_warning(GtkWidget *widget)
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);
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);
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);
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);
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;
GtkWidget *checkbtn_warnqueued;
GtkWidget *checkbtn_cliplog;
GtkWidget *loglength_entry;
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
GtkWidget *checkbtn_ssl_ask_unknown_valid;
#endif
} other;
{"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},
GtkWidget *checkbtn_cleanonexit;
GtkWidget *checkbtn_askonclean;
GtkWidget *checkbtn_warnqueued;
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
GtkWidget *frame_ssl;
GtkWidget *vbox_ssl;
GtkWidget *hbox_ssl;
FALSE, TRUE, 0);
SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
/* SSL */
PACK_FRAME (vbox1, frame_ssl, _("Security"));
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
}
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*/
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
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),
#include "prefs_account.h"
#define SMTP_PORT 25
-#if USE_SSL
+#if USE_OPENSSL
#define SSMTP_PORT 465
#endif
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)
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;
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);
return val;
}
-#if USE_SSL
+#if USE_OPENSSL
if (ssl_type == SSL_STARTTLS) {
val = smtp_starttls(session);
if (val != SM_OK) {
#include <glib.h>
#include "socket.h"
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
#include "session.h"
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,
# include "config.h"
#endif
-#if USE_SSL
+#if USE_OPENSSL
#include <openssl/ssl.h>
#include <glib.h>
return TRUE;
}
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
# include "config.h"
#endif
-#if USE_SSL
+#if USE_OPENSSL
#include <openssl/ssl.h>
#include <openssl/objects.h>
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 */
# include "config.h"
#endif
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
#include <gtk/gtkwidget.h>
#include <glib.h>
#include <sys/types.h>
#ifndef SSL_MANAGER_H
#define SSL_MANAGER_H
-#ifdef USE_SSL
+#ifdef USE_OPENSSL
#include "mainwindow.h"
void ssl_manager_create (void);