[balsa] Make GpgME/E2EE support a hard requirement
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] Make GpgME/E2EE support a hard requirement
- Date: Sun, 2 Jun 2019 18:32:00 +0000 (UTC)
commit 7a0a4fe32e846b02263345fa58b761cfe1a0f478
Author: Albrecht Dreß <albrecht dress arcor de>
Date: Sun Jun 2 14:30:01 2019 -0400
Make GpgME/E2EE support a hard requirement
* INSTALL: ancient file, add pointer to README
* README: remove --with-gpgme option; add gpgme as requirement;
briefly describe Balsa's E2EE support; clarify --with-libsecret
* configure.ac, meson.build, meson_options.txt: remove --with-gpgme option;
fail if gpgme-config is unavailable; require gpgme >= 1.6.0
* libbalsa/Makefile.am, libbalsa/meson.build: remove conditional building with/without gpgme
* libbalsa/body.[ch], libbalsa/imap-server.c, libbalsa/mailbox.[ch], libbalsa/message.[ch],
libbalsa/rfc3156.[ch], libbalsa/send.[ch], src/balsa-app.[ch], src/balsa-icons.[ch],
src/balsa-message.[ch], src/balsa-mime-widget-crypto.[ch],
src/balsa-mime-widget-message.c, src/balsa-mime-widget-multipartc,
src/balsa-mime-widget.c, src/balsa-print-object-header.[ch],
src/balsa-print-object.c, src/main.c, src/print-gtk.c,
src/save-restore.c, src/sendmsg-window.[ch], src/toolbar-factory.c:
remove conditional compilation (HAVE_GPGME)
* libbalsa/identity.c: remove conditional compilation (HAVE_GPGME);
simplify append_ident_notebook_page()
* src/mailbox-conf.c: remove conditional compilation (HAVE_GPGME);
remove useless scope in mailbox_conf_view_new_full()
ChangeLog | 25 ++++++++++++
INSTALL | 4 ++
README | 25 +++++++-----
configure.ac | 84 +++++++++++++++------------------------
libbalsa/Makefile.am | 68 ++++++++++---------------------
libbalsa/body.c | 9 -----
libbalsa/body.h | 9 +----
libbalsa/identity.c | 36 +++--------------
libbalsa/imap-server.c | 4 --
libbalsa/mailbox.c | 8 ----
libbalsa/mailbox.h | 10 -----
libbalsa/meson.build | 44 +++++++++-----------
libbalsa/message.c | 8 ----
libbalsa/message.h | 10 -----
libbalsa/rfc3156.c | 4 --
libbalsa/rfc3156.h | 3 --
libbalsa/send.c | 35 ----------------
libbalsa/send.h | 2 -
meson.build | 67 +++++++++++++------------------
meson_options.txt | 5 ---
src/balsa-app.c | 2 -
src/balsa-app.h | 2 -
src/balsa-icons.c | 12 +-----
src/balsa-icons.h | 18 ++++-----
src/balsa-message.c | 26 +-----------
src/balsa-message.h | 2 -
src/balsa-mime-widget-crypto.c | 3 --
src/balsa-mime-widget-crypto.h | 3 --
src/balsa-mime-widget-message.c | 8 ----
src/balsa-mime-widget-multipart.c | 2 -
src/balsa-mime-widget.c | 4 --
src/balsa-print-object-header.c | 6 ---
src/balsa-print-object-header.h | 2 -
src/balsa-print-object.c | 4 --
src/mailbox-conf.c | 57 +++++++++++---------------
src/main.c | 6 ---
src/print-gtk.c | 20 +---------
src/save-restore.c | 10 -----
src/sendmsg-window.c | 54 +------------------------
src/sendmsg-window.h | 2 -
src/toolbar-factory.c | 2 -
41 files changed, 186 insertions(+), 519 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0ade90b46..b5c4557c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2019-06-02 Albrecht Dreß <albrecht dress arcor de>
+
+ Make GpgME/E2EE support a hard requirement
+
+ * INSTALL: ancient file, add pointer to README
+ * README: remove --with-gpgme option; add gpgme as requirement;
+ briefly describe Balsa's E2EE support; clarify --with-libsecret
+ * configure.ac, meson.build, meson_options.txt: remove --with-gpgme option;
+ fail if gpgme-config is unavailable; require gpgme >= 1.6.0
+ * libbalsa/Makefile.am, libbalsa/meson.build: remove conditional building with/without gpgme
+ * libbalsa/body.[ch], libbalsa/imap-server.c,
+ libbalsa/mailbox.[ch], libbalsa/message.[ch],
+ libbalsa/rfc3156.[ch], libbalsa/send.[ch],
+ src/balsa-app.[ch], src/balsa-icons.[ch],
+ src/balsa-message.[ch], src/balsa-mime-widget-crypto.[ch],
+ src/balsa-mime-widget-message.c, src/balsa-mime-widget-multipartc,
+ src/balsa-mime-widget.c, src/balsa-print-object-header.[ch],
+ src/balsa-print-object.c, src/main.c, src/print-gtk.c,
+ src/save-restore.c, src/sendmsg-window.[ch],
+ src/toolbar-factory.c: remove conditional compilation (HAVE_GPGME)
+ * libbalsa/identity.c: remove conditional compilation (HAVE_GPGME);
+ simplify append_ident_notebook_page()
+ * src/mailbox-conf.c: remove conditional compilation (HAVE_GPGME);
+ remove useless scope in mailbox_conf_view_new_full()
+
2019-06-02 Albrecht Dreß <albrecht dress arcor de>
libnetclient: use G_DECLARE*
diff --git a/INSTALL b/INSTALL
index 1516c8a2e..113325e6b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,3 +1,7 @@
+Please see README for latest installation information
+
+---
+
Balsa E-Mail Client 2.0.x
Copyright (C) 1997-2002 Stuart Parmenter and others, see AUTHORS file.
diff --git a/README b/README
index c71e64c36..1556c1313 100644
--- a/README
+++ b/README
@@ -44,6 +44,7 @@ Basically, Balsa requires
- gmime-2.6
- gio-2.0
- gthread-2.0
+- gpgme >= 1.6.0
--disable-more-warnings
Balsa by default is very sensitive to compilation warnings
@@ -56,15 +57,8 @@ use this option to compile the code and hope for the best.
Add "GNOME;" to Balsa's categories in the two .desktop files.
--with-libsecret
- Link to libsecret instead of gnome-keyring.
-
---with-gpgme[=gpgme-config]
- Use GPGME library for GnuPG message signing and encryption.
-The path of the gpgme-config tool must be specified only if it is
-installed in an uncommon place. See the (rather outdated) web page
-http://home.arcor.de/dralbrecht.dress/balsa/UsingGnuPG.html#FAQ
-for more details.
-Note: requires GpgME version >= 1.5.0
+ Link to libsecret to store credentials in the key ring instead of
+the obfuscated text file ~/.balsa/config-private.
--with-gss[=/usr/kerberos]
This enables GSSAPI Kerberos based authentication scheme.
@@ -121,6 +115,19 @@ source, get the module 'balsa':
git clone https://gitlab.gnome.org/GNOME/balsa.git
+End-to-End Encryption (E2EE):
+-----------------------------
+ Balsa supports E2EE using the multipart OpenPGP (RFC 3156)
+or S/MIME (RFC RFC 8551) standards as well as single-part OpenPGP
+(RFC 4880). Messages can be signed, encrypted, or both. The GpgME
+library (https://gnupg.org/software/gpgme/) must be installed. For
+the cryptographic operations, suitable backends like gnupg for the
+OpenPGP protocols and/or gpgsm for S/MIME are required.
+
+Optionally, Balsa can be configured to include Autocrypt support
+(https://autocrypt.org/index.html).
+
+
Specifying the SMTP Server:
---------------------------
diff --git a/configure.ac b/configure.ac
index 36e4aa3dd..6c0b72cee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,14 +60,9 @@ if test x$balsa_cv_fcntl = xyes; then
AC_DEFINE(USE_FCNTL,1,[Define if fcntl locking should be used.])
fi
-AC_ARG_WITH([gpgme],
- AC_HELP_STRING([--with-gpgme=gpgme-config],
- [build with gpgme/GnuPG support (default=no, path to gpgme-config optional)]),
- [ gpgmecfg=$withval ], [ gpgmecfg=no ])
-
AC_ARG_ENABLE([autocrypt],
AC_HELP_STRING([--enable-autocrypt],
- [build with Autocrypt support (see https://autocrypt.org/), default=no, requires gpgme and
sqlite3)]),
+ [build with Autocrypt support (see https://autocrypt.org/), default=no, requires
sqlite3)]),
[autocrypt=$enableval], [autocrypt=no])
AC_ARG_WITH(canberra,
@@ -324,60 +319,46 @@ fi
# GPGME detection.
# We don't use the std macro AM_PATH_GPGME here to avoid dependencies.
-
-AC_MSG_CHECKING(whether to build with gpgme/GnuPG support)
-if test x"$gpgmecfg" = xyes ; then
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(gpgmecfg, gpgme-config, no)
- if test "$gpgmecfg" = no; then
- AC_MSG_ERROR([GPGme build requested but gpgme-config program not found.])
- fi
+AC_PATH_PROG(gpgmecfg, gpgme-config, no)
+if test "$gpgmecfg" = no; then
+ AC_MSG_ERROR([gpgme-config program not found.])
+fi
+AC_MSG_CHECKING([gpgme library version])
+gpgmever=`$gpgmecfg --version`
+AC_MSG_RESULT($gpgmever)
+gpgme_ve=`echo $gpgmever|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+gpgme_ma=`echo $gpgmever|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+gpgme_mi=`echo $gpgmever|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+if test $gpgme_ve -lt 1; then
+ gpgmecfg=no
+fi
+if test \( $gpgme_ve -eq 1 \) -a \( $gpgme_ma -lt 6 \) ; then
+ gpgmecfg=no
fi
if test x"$gpgmecfg" != xno ; then
- AC_MSG_CHECKING([gpgme library version])
- gpgmever=`$gpgmecfg --version`
- AC_MSG_RESULT($gpgmever)
- gpgme_ve=`echo $gpgmever|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- gpgme_ma=`echo $gpgmever|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- gpgme_mi=`echo $gpgmever|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test $gpgme_ve -lt 1; then
- gpgmecfg=no
- fi
- if test \( $gpgme_ve -eq 1 \) -a \( $gpgme_ma -lt 5 \) ; then
- gpgmecfg=no
- fi
- if test x"$gpgmecfg" != xno ; then
- if test \( $gpgme_ve -eq 1 \) -a \( $gpgme_ma -lt 8 \) ; then
- BALSA_LIBS="$BALSA_LIBS `$gpgmecfg --thread=pthread --libs`"
- if test x"$?" != x0 ; then
- AC_MSG_ERROR([*** You enabled gpgme support, but your gpgme installation does
not support threads.])
- fi
- else
- BALSA_LIBS="$BALSA_LIBS `$gpgmecfg --libs`"
- fi
- AC_DEFINE(HAVE_GPGME,1,[Defined when gpgme is available.])
- BALSA_CFLAGS="$BALSA_CFLAGS `$gpgmecfg --cflags`"
- gpgmecfg=yes
+ if test \( $gpgme_ve -eq 1 \) -a \( $gpgme_ma -lt 8 \) ; then
+ BALSA_LIBS="$BALSA_LIBS `$gpgmecfg --thread=pthread --libs`"
+ if test x"$?" != x0 ; then
+ AC_MSG_ERROR([*** Your gpgme installation does not support threads.])
+ fi
else
- AC_MSG_WARN([sorry, you need at least gpgme version 1.5.0])
+ BALSA_LIBS="$BALSA_LIBS `$gpgmecfg --libs`"
fi
+ BALSA_CFLAGS="$BALSA_CFLAGS `$gpgmecfg --cflags`"
+else
+ AC_MSG_ERROR([sorry, you need at least gpgme version 1.6.0])
fi
-AM_CONDITIONAL([BUILD_WITH_GPGME], [test $gpgmecfg = "yes"])
# Autocrypt support
AC_MSG_CHECKING(whether to build with Autocrypt support)
-if test x"$gpgmecfg" != xno ; then
- if test x"$autocrypt" != xno ; then
- AC_MSG_RESULT([yes])
- PKG_CHECK_MODULES(AUTOCRYPT, [sqlite3])
- AC_DEFINE(ENABLE_AUTOCRYPT,1,[If defined, enable Autocrypt support])
- BALSA_CFLAGS="$BALSA_CFLAGS $AUTOCRYPT_CFLAGS"
- BALSA_LIBS="$BALSA_LIBS $AUTOCRYPT_LIBS"
- else
- AC_MSG_RESULT([no])
- fi
+if test x"$autocrypt" != xno ; then
+ AC_MSG_RESULT([yes])
+ PKG_CHECK_MODULES(AUTOCRYPT, [sqlite3])
+ AC_DEFINE(ENABLE_AUTOCRYPT,1,[If defined, enable Autocrypt support])
+ BALSA_CFLAGS="$BALSA_CFLAGS $AUTOCRYPT_CFLAGS"
+ BALSA_LIBS="$BALSA_LIBS $AUTOCRYPT_LIBS"
else
- AC_MSG_RESULT([skipped, gpgme is disabled])
+ AC_MSG_RESULT([no])
fi
# OpenLDAP configuration.
@@ -734,7 +715,6 @@ echo " Enable compile warnings: $set_more_warnings"
echo " HTML widget: $use_html_widget"
echo " Use GNOME: $with_gnome"
echo " Use Canberra: $with_canberra"
-echo " Use GPGME: $gpgmecfg"
echo " Use Autocrypt: $autocrypt"
echo " Use LDAP: $with_ldap"
echo " Use GSS: $with_gss"
diff --git a/libbalsa/Makefile.am b/libbalsa/Makefile.am
index c4f29403b..7094d0e00 100644
--- a/libbalsa/Makefile.am
+++ b/libbalsa/Makefile.am
@@ -3,50 +3,6 @@ SUBDIRS = imap
noinst_LIBRARIES = libbalsa.a
-if BUILD_WITH_GPGME
-libbalsa_gpgme_extra = \
- autocrypt.h \
- autocrypt.c \
- libbalsa-gpgme.h \
- libbalsa-gpgme.c \
- libbalsa-gpgme-cb.h \
- libbalsa-gpgme-cb.c \
- libbalsa-gpgme-keys.h \
- libbalsa-gpgme-keys.c \
- libbalsa-gpgme-widgets.h\
- libbalsa-gpgme-widgets.c\
- gmime-multipart-crypt.h \
- gmime-multipart-crypt.c \
- gmime-part-rfc2440.h \
- gmime-part-rfc2440.c \
- gmime-gpgme-signature.h \
- gmime-gpgme-signature.c \
- gmime-application-pkcs7.h \
- gmime-application-pkcs7.c
-libbalsa_gpgme_extra_dist =
-else
-libbalsa_gpgme_extra =
-libbalsa_gpgme_extra_dist = \
- autocrypt.h \
- autocrypt.c \
- libbalsa-gpgme.h \
- libbalsa-gpgme.c \
- libbalsa-gpgme-cb.h \
- libbalsa-gpgme-cb.c \
- libbalsa-gpgme-keys.h \
- libbalsa-gpgme-keys.c \
- libbalsa-gpgme-widgets.h\
- libbalsa-gpgme-widgets.c\
- gmime-multipart-crypt.h \
- gmime-multipart-crypt.c \
- gmime-part-rfc2440.h \
- gmime-part-rfc2440.c \
- gmime-gpgme-signature.h \
- gmime-gpgme-signature.c \
- gmime-application-pkcs7.h \
- gmime-application-pkcs7.c
-endif
-
libbalsa_a_SOURCES = \
abook-completion.c \
abook-completion.h \
@@ -74,6 +30,8 @@ libbalsa_a_SOURCES = \
address.h \
application-helpers.c \
application-helpers.h \
+ autocrypt.h \
+ autocrypt.c \
body.c \
body.h \
cell-renderer-button.c \
@@ -92,8 +50,16 @@ libbalsa_a_SOURCES = \
filter.h \
folder-scanners.c \
folder-scanners.h \
+ gmime-application-pkcs7.h \
+ gmime-application-pkcs7.c \
gmime-filter-header.c \
gmime-filter-header.h \
+ gmime-gpgme-signature.h \
+ gmime-gpgme-signature.c \
+ gmime-multipart-crypt.h \
+ gmime-multipart-crypt.c \
+ gmime-part-rfc2440.h \
+ gmime-part-rfc2440.c \
html.c \
html.h \
identity.c \
@@ -104,6 +70,14 @@ libbalsa_a_SOURCES = \
information.h \
libbalsa-conf.c \
libbalsa-conf.h \
+ libbalsa-gpgme.h \
+ libbalsa-gpgme.c \
+ libbalsa-gpgme-cb.h \
+ libbalsa-gpgme-cb.c \
+ libbalsa-gpgme-keys.h \
+ libbalsa-gpgme-keys.c \
+ libbalsa-gpgme-widgets.h\
+ libbalsa-gpgme-widgets.c\
libbalsa-progress.c \
libbalsa-progress.h \
macosx-helpers.c \
@@ -160,13 +134,11 @@ libbalsa_a_SOURCES = \
url.c \
url.h \
geometry-manager.c \
- geometry-manager.h \
- ${libbalsa_gpgme_extra}
+ geometry-manager.h
EXTRA_DIST = \
- padlock-keyhole.xpm \
- ${libbalsa_gpgme_extra_dist}
+ padlock-keyhole.xpm
AM_CPPFLAGS = -I${top_builddir} -I${top_srcdir} -I${top_srcdir}/libbalsa \
-I${top_srcdir}/libnetclient \
diff --git a/libbalsa/body.c b/libbalsa/body.c
index c1d2bf16b..6c27efe7a 100644
--- a/libbalsa/body.c
+++ b/libbalsa/body.c
@@ -33,10 +33,7 @@
#include "libbalsa-vfs.h"
#include "misc.h"
#include <glib/gi18n.h>
-
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
-#endif
LibBalsaMessageBody *
libbalsa_message_body_new(LibBalsaMessage * message)
@@ -55,10 +52,8 @@ libbalsa_message_body_new(LibBalsaMessage * message)
body->temp_filename = NULL;
body->charset = NULL;
-#ifdef HAVE_GPGME
body->was_encrypted = FALSE;
body->sig_info = NULL;
-#endif
body->next = NULL;
body->parts = NULL;
@@ -89,10 +84,8 @@ libbalsa_message_body_free(LibBalsaMessageBody * body)
g_free(body->charset);
-#ifdef HAVE_GPGME
if (body->sig_info)
g_object_unref(G_OBJECT(body->sig_info));
-#endif
libbalsa_message_body_free(body->next);
libbalsa_message_body_free(body->parts);
@@ -880,7 +873,6 @@ libbalsa_message_body_get_by_id(LibBalsaMessageBody * body,
return libbalsa_message_body_get_by_id(body->next, id);
}
-#ifdef HAVE_GPGME
LibBalsaMsgProtectState
libbalsa_message_body_protect_state(const LibBalsaMessageBody *body)
{
@@ -940,4 +932,3 @@ libbalsa_message_body_inline_signed(const LibBalsaMessageBody *body)
(body->sig_info != NULL) &&
(body->sig_info->status != GPG_ERR_NOT_SIGNED);
}
-#endif
diff --git a/libbalsa/body.h b/libbalsa/body.h
index d4ee8388d..765eb37de 100644
--- a/libbalsa/body.h
+++ b/libbalsa/body.h
@@ -33,10 +33,7 @@
#include <gdk/gdk.h>
#include "libbalsa-vfs.h"
-
-#ifdef HAVE_GPGME
#include "gmime-gpgme-signature.h"
-#endif
typedef enum _LibBalsaMessageBodyType LibBalsaMessageBodyType;
@@ -83,10 +80,8 @@ struct _LibBalsaMessageBody {
gchar *charset; /* the charset, used for sending, replying. */
GMimeObject *mime_part; /* mime body */
-#ifdef HAVE_GPGME
gboolean was_encrypted;
- GMimeGpgmeSigstat* sig_info; /* info about a pgp signature body */
-#endif
+ GMimeGpgmeSigstat* sig_info; /* info about a pgp or S/MIME signature body */
LibBalsaMessageBody *next; /* Next part in the message */
LibBalsaMessageBody *parts; /* The parts of a multipart or message/rfc822 message */
@@ -136,11 +131,9 @@ LibBalsaMessageBody *libbalsa_message_body_get_by_id(LibBalsaMessageBody *
body,
const gchar * id);
-#ifdef HAVE_GPGME
LibBalsaMsgProtectState libbalsa_message_body_protect_state(const LibBalsaMessageBody *body);
gboolean libbalsa_message_body_multipart_signed(const LibBalsaMessageBody *body);
gboolean libbalsa_message_body_inline_signed(const LibBalsaMessageBody *body);
-#endif
#endif /* __LIBBALSA_BODY_H__ */
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index ac4c1770e..b0ff23a87 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -33,9 +33,7 @@
# include "macosx-helpers.h"
#endif
-#ifdef HAVE_GPGME
-# include "libbalsa-gpgme.h"
-#endif
+#include "libbalsa-gpgme.h"
#include <string.h>
#include "smtp-server.h"
@@ -917,8 +915,7 @@ new_ident_cb(GtkTreeView * tree, GObject * dialog)
*/
static GtkWidget*
append_ident_notebook_page(GtkNotebook *notebook,
- const gchar * tab_label,
- const gchar * footnote)
+ const gchar * tab_label)
{
GtkWidget *vbox;
GtkWidget *grid;
@@ -927,13 +924,6 @@ append_ident_notebook_page(GtkNotebook *notebook,
grid = libbalsa_create_grid();
gtk_container_set_border_width(GTK_CONTAINER(grid), padding);
gtk_box_pack_start(GTK_BOX(vbox), grid, FALSE, FALSE, 0);
- if (footnote) {
- GtkWidget *label;
-
- label = gtk_label_new(footnote);
- gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- }
gtk_notebook_append_page(notebook, vbox, gtk_label_new(tab_label));
return grid;
@@ -978,10 +968,9 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree,
gint row;
GObject *name;
gpointer path;
- gchar *footnote;
/* create the "General" tab */
- grid = append_ident_notebook_page(notebook, _("General"), NULL);
+ grid = append_ident_notebook_page(notebook, _("General"));
row = 0;
ident_dialog_add_entry(grid, row++, dialog, _("_Identity name:"),
"identity-name");
@@ -995,7 +984,7 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree,
"identity-domain");
/* create the "Messages" tab */
- grid = append_ident_notebook_page(notebook, _("Messages"), NULL);
+ grid = append_ident_notebook_page(notebook, _("Messages"));
row = 0;
ident_dialog_add_entry(grid, row++, dialog, _("_BCC:"),
"identity-bcc");
@@ -1024,7 +1013,7 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree,
"identity-smtp-server", smtp_servers);
/* create the "Signature" tab */
- grid = append_ident_notebook_page(notebook, _("Signature"), NULL);
+ grid = append_ident_notebook_page(notebook, _("Signature"));
row = 0;
ident_dialog_add_check_and_entry(grid, row++, dialog,
_("Signature _path"),
@@ -1048,15 +1037,9 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree,
_("Prepend si_gnature"),
"identity-sigprepend", FALSE);
-#ifdef HAVE_GPGME
- footnote = NULL;
-#else
- footnote = _("Signing and encrypting messages are possible "
- "only if Balsa is built with cryptographic support.");
-#endif
/* create the "Security" tab */
grid =
- append_ident_notebook_page(notebook, _("Security"), footnote);
+ append_ident_notebook_page(notebook, _("Security"));
row = 0;
ident_dialog_add_checkbutton(grid, row++, dialog,
_("sign messages by default"),
@@ -1086,9 +1069,6 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree,
_("Autocrypt mode"),
"identity-autocrypt");
#endif
-#ifndef HAVE_GPGME
- gtk_widget_set_sensitive(grid, FALSE);
-#endif
name = g_object_get_data(G_OBJECT(dialog), "identity-name");
g_signal_connect(name, "changed",
@@ -1180,7 +1160,6 @@ ident_dialog_add_entry(GtkWidget * grid, gint row, GtkDialog * dialog,
}
-#ifdef HAVE_GPGME
static void
choose_key(GtkButton *button, gpointer user_data)
{
@@ -1209,7 +1188,6 @@ choose_key(GtkButton *button, gpointer user_data)
g_clear_error(&error);
}
}
-#endif
/*
@@ -1229,10 +1207,8 @@ ident_dialog_add_keysel_entry(GtkWidget *grid,
ident_dialog_add_entry(grid, row, dialog, label_name, entry_key);
button = gtk_button_new_with_label(_("Choose…"));
-#ifdef HAVE_GPGME
g_object_set_data_full(G_OBJECT(button), "target", g_strdup(entry_key), (GDestroyNotify) g_free);
g_signal_connect(button, "clicked", G_CALLBACK(choose_key), dialog);
-#endif
gtk_grid_attach(GTK_GRID(grid), button, 2, row, 1, 1);
}
diff --git a/libbalsa/imap-server.c b/libbalsa/imap-server.c
index 8f8b5a3bd..216816890 100644
--- a/libbalsa/imap-server.c
+++ b/libbalsa/imap-server.c
@@ -277,14 +277,10 @@ lb_imap_server_info_new(LibBalsaServer *server)
imap_handle_set_tls_mode(handle, server->security);
imap_handle_set_option(handle, IMAP_OPT_ANONYMOUS, server->try_anonymous);
imap_handle_set_option(handle, IMAP_OPT_CLIENT_SORT, TRUE);
-#ifdef HAVE_GPGME
/* binary fetches change encoding and the checksums, and
signatures, disable them if we ever consider verifying message
integrity. */
imap_handle_set_option(handle, IMAP_OPT_BINARY, FALSE);
-#else
- imap_handle_set_option(handle, IMAP_OPT_BINARY, TRUE);
-#endif
imap_handle_set_option(handle, IMAP_OPT_COMPRESS, TRUE);
imap_handle_set_option(handle, IMAP_OPT_IDLE,
LIBBALSA_IMAP_SERVER(server)->use_idle);
diff --git a/libbalsa/mailbox.c b/libbalsa/mailbox.c
index b15eeee8f..9c7dcce37 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -2293,9 +2293,7 @@ static LibBalsaMailboxView libbalsa_mailbox_view_default = {
0, /* open */
1, /* in_sync */
0, /* used */
-#ifdef HAVE_GPGME
LB_MAILBOX_CHK_CRYPT_MAYBE, /* gpg_chk_mode */
-#endif
-1, /* total messages */
-1, /* unread messages */
0, /* mod time */
@@ -2480,7 +2478,6 @@ libbalsa_mailbox_set_filter(LibBalsaMailbox * mailbox, gint filter)
}
}
-#ifdef HAVE_GPGME
gboolean
libbalsa_mailbox_set_crypto_mode(LibBalsaMailbox * mailbox,
LibBalsaChkCryptoMode gpg_chk_mode)
@@ -2496,7 +2493,6 @@ libbalsa_mailbox_set_crypto_mode(LibBalsaMailbox * mailbox,
} else
return FALSE;
}
-#endif
void
libbalsa_mailbox_set_unread(LibBalsaMailbox * mailbox, gint unread)
@@ -2644,7 +2640,6 @@ libbalsa_mailbox_get_filter(LibBalsaMailbox * mailbox)
mailbox->view->filter : libbalsa_mailbox_view_default.filter;
}
-#ifdef HAVE_GPGME
LibBalsaChkCryptoMode
libbalsa_mailbox_get_crypto_mode(LibBalsaMailbox * mailbox)
{
@@ -2652,7 +2647,6 @@ libbalsa_mailbox_get_crypto_mode(LibBalsaMailbox * mailbox)
mailbox->view->gpg_chk_mode :
libbalsa_mailbox_view_default.gpg_chk_mode;
}
-#endif
gint
libbalsa_mailbox_get_unread(LibBalsaMailbox * mailbox)
@@ -3238,7 +3232,6 @@ void libbalsa_mailbox_set_attach_icon(GdkPixbuf * pixbuf)
[LIBBALSA_MESSAGE_ATTACH_ATTACH]);
}
-#ifdef HAVE_GPGME
void libbalsa_mailbox_set_good_icon(GdkPixbuf * pixbuf)
{
libbalsa_mailbox_set_icon(pixbuf,
@@ -3273,7 +3266,6 @@ void libbalsa_mailbox_set_encr_icon(GdkPixbuf * pixbuf)
&attach_icons
[LIBBALSA_MESSAGE_ATTACH_ENCR]);
}
-#endif /* HAVE_GPGME */
/* =================================================================== *
* GtkTreeDragSource implementation functions. *
diff --git a/libbalsa/mailbox.h b/libbalsa/mailbox.h
index 5793714cf..7253f8d81 100644
--- a/libbalsa/mailbox.h
+++ b/libbalsa/mailbox.h
@@ -130,13 +130,11 @@ typedef enum {
LB_MAILBOX_STATE_CLOSING
} LibBalsaMailboxState;
-#ifdef HAVE_GPGME
typedef enum {
LB_MAILBOX_CHK_CRYPT_NEVER, /* never auto decrypt/signature check */
LB_MAILBOX_CHK_CRYPT_MAYBE, /* auto decrypt/signature check if possible */
LB_MAILBOX_CHK_CRYPT_ALWAYS /* always auto decrypt/signature check */
} LibBalsaChkCryptoMode;
-#endif
enum LibBalsaMailboxCapability {
LIBBALSA_MAILBOX_CAN_SORT,
@@ -170,9 +168,7 @@ struct _LibBalsaMailboxView {
gboolean in_sync; /* view is in sync with config */
gboolean used; /* keep track of usage */
-#ifdef HAVE_GPGME
LibBalsaChkCryptoMode gpg_chk_mode;
-#endif
/* Display statistics:
* - total >= 0 both counts are valid;
@@ -549,10 +545,8 @@ void libbalsa_mailbox_set_exposed(LibBalsaMailbox * mailbox,
gboolean exposed);
void libbalsa_mailbox_set_open(LibBalsaMailbox * mailbox, gboolean open);
void libbalsa_mailbox_set_filter(LibBalsaMailbox * mailbox, gint filter);
-#ifdef HAVE_GPGME
gboolean libbalsa_mailbox_set_crypto_mode(LibBalsaMailbox * mailbox,
LibBalsaChkCryptoMode gpg_chk_mode);
-#endif
void libbalsa_mailbox_set_unread(LibBalsaMailbox * mailbox, gint unread);
void libbalsa_mailbox_set_total (LibBalsaMailbox * mailbox, gint total);
void libbalsa_mailbox_set_mtime (LibBalsaMailbox * mailbox, time_t mtime);
@@ -572,9 +566,7 @@ LibBalsaMailboxSubscribe libbalsa_mailbox_get_subscribe(LibBalsaMailbox *
gboolean libbalsa_mailbox_get_exposed(LibBalsaMailbox * mailbox);
gboolean libbalsa_mailbox_get_open(LibBalsaMailbox * mailbox);
gint libbalsa_mailbox_get_filter(LibBalsaMailbox * mailbox);
-#ifdef HAVE_GPGME
LibBalsaChkCryptoMode libbalsa_mailbox_get_crypto_mode(LibBalsaMailbox * mailbox);
-#endif
gint libbalsa_mailbox_get_unread(LibBalsaMailbox * mailbox);
gint libbalsa_mailbox_get_total (LibBalsaMailbox * mailbox);
time_t libbalsa_mailbox_get_mtime(LibBalsaMailbox * mailbox);
@@ -614,13 +606,11 @@ void libbalsa_mailbox_set_trash_icon(GdkPixbuf * pixbuf);
void libbalsa_mailbox_set_flagged_icon(GdkPixbuf * pixbuf);
void libbalsa_mailbox_set_replied_icon(GdkPixbuf * pixbuf);
void libbalsa_mailbox_set_attach_icon(GdkPixbuf * pixbuf);
-#ifdef HAVE_GPGME
void libbalsa_mailbox_set_good_icon(GdkPixbuf * pixbuf);
void libbalsa_mailbox_set_notrust_icon(GdkPixbuf * pixbuf);
void libbalsa_mailbox_set_bad_icon(GdkPixbuf * pixbuf);
void libbalsa_mailbox_set_sign_icon(GdkPixbuf * pixbuf);
void libbalsa_mailbox_set_encr_icon(GdkPixbuf * pixbuf);
-#endif /* HAVE_GPGME */
/* Partial messages */
void libbalsa_mailbox_try_reassemble(LibBalsaMailbox * mailbox,
diff --git a/libbalsa/meson.build b/libbalsa/meson.build
index 8a4dbeacd..471d97d4d 100644
--- a/libbalsa/meson.build
+++ b/libbalsa/meson.build
@@ -1,29 +1,5 @@
# libbalsa/meson.build
-if gpgmecfg == 'true'
- libbalsa_gpgme_extra = [
- 'autocrypt.h',
- 'autocrypt.c',
- 'libbalsa-gpgme.h',
- 'libbalsa-gpgme.c',
- 'libbalsa-gpgme-cb.h',
- 'libbalsa-gpgme-cb.c',
- 'libbalsa-gpgme-keys.h',
- 'libbalsa-gpgme-keys.c',
- 'libbalsa-gpgme-widgets.h',
- 'libbalsa-gpgme-widgets.c',
- 'gmime-multipart-crypt.h',
- 'gmime-multipart-crypt.c',
- 'gmime-part-rfc2440.h',
- 'gmime-part-rfc2440.c',
- 'gmime-gpgme-signature.h',
- 'gmime-gpgme-signature.c',
- 'gmime-application-pkcs7.h',
- 'gmime-application-pkcs7.c']
-else
- libbalsa_gpgme_extra = []
-endif
-
libbalsa_a_sources = [
'abook-completion.c',
'abook-completion.h',
@@ -51,6 +27,8 @@ libbalsa_a_sources = [
'address.h',
'application-helpers.c',
'application-helpers.h',
+ 'autocrypt.h',
+ 'autocrypt.c',
'body.c',
'body.h',
'cell-renderer-button.c',
@@ -69,8 +47,16 @@ libbalsa_a_sources = [
'filter.h',
'folder-scanners.c',
'folder-scanners.h',
+ 'gmime-application-pkcs7.h',
+ 'gmime-application-pkcs7.c',
'gmime-filter-header.c',
'gmime-filter-header.h',
+ 'gmime-gpgme-signature.h',
+ 'gmime-gpgme-signature.c',
+ 'gmime-multipart-crypt.h',
+ 'gmime-multipart-crypt.c',
+ 'gmime-part-rfc2440.h',
+ 'gmime-part-rfc2440.c',
'html.c',
'html.h',
'identity.c',
@@ -81,6 +67,14 @@ libbalsa_a_sources = [
'information.h',
'libbalsa-conf.c',
'libbalsa-conf.h',
+ 'libbalsa-gpgme.h',
+ 'libbalsa-gpgme.c',
+ 'libbalsa-gpgme-cb.h',
+ 'libbalsa-gpgme-cb.c',
+ 'libbalsa-gpgme-keys.h',
+ 'libbalsa-gpgme-keys.c',
+ 'libbalsa-gpgme-widgets.h',
+ 'libbalsa-gpgme-widgets.c',
'libbalsa-progress.c',
'libbalsa-progress.h',
'macosx-helpers.c',
@@ -139,8 +133,6 @@ libbalsa_a_sources = [
'geometry-manager.c',
'geometry-manager.h']
-libbalsa_a_sources += libbalsa_gpgme_extra
-
libimap_include = include_directories('imap')
libbalsa_a = static_library('balsa', libbalsa_a_sources,
diff --git a/libbalsa/message.c b/libbalsa/message.c
index ce1cbba68..c4642351e 100644
--- a/libbalsa/message.c
+++ b/libbalsa/message.c
@@ -99,10 +99,8 @@ libbalsa_message_init(LibBalsaMessage * message)
message->body_ref = 0;
message->body_list = NULL;
message->has_all_headers = 0;
-#ifdef HAVE_GPGME
message->prot_state = LIBBALSA_MSG_PROTECT_NONE;
message->ident = NULL;
-#endif
}
@@ -179,11 +177,9 @@ libbalsa_message_finalize(GObject * object)
message->mime_msg = NULL;
}
-#ifdef HAVE_GPGME
if (message->ident != NULL) {
g_object_unref(message->ident);
}
-#endif
if (message->tempdir) {
if (rmdir(message->tempdir))
@@ -580,7 +576,6 @@ libbalsa_message_save(LibBalsaMessage * message, const gchar *filename)
LibBalsaMessageAttach
libbalsa_message_get_attach_icon(LibBalsaMessage * message)
{
-#ifdef HAVE_GPGME
if (libbalsa_message_is_pgp_encrypted(message))
return LIBBALSA_MESSAGE_ATTACH_ENCR;
else if (message->prot_state != LIBBALSA_MSG_PROTECT_NONE ||
@@ -598,7 +593,6 @@ libbalsa_message_get_attach_icon(LibBalsaMessage * message)
return LIBBALSA_MESSAGE_ATTACH_SIGN;
}
} else
-#endif
if (libbalsa_message_has_attachment(message))
return LIBBALSA_MESSAGE_ATTACH_ATTACH;
else
@@ -769,7 +763,6 @@ libbalsa_message_has_attachment(LibBalsaMessage * message)
}
}
-#ifdef HAVE_GPGME
gboolean
libbalsa_message_is_pgp_signed(LibBalsaMessage * message)
{
@@ -789,7 +782,6 @@ libbalsa_message_is_pgp_encrypted(LibBalsaMessage * message)
g_mime_content_type_is_type(message->headers->content_type,
"multipart", "encrypted") : FALSE;
}
-#endif
void
libbalsa_message_append_part(LibBalsaMessage * message,
diff --git a/libbalsa/message.h b/libbalsa/message.h
index 49c7dd918..f97aa1fde 100644
--- a/libbalsa/message.h
+++ b/libbalsa/message.h
@@ -31,9 +31,7 @@
#include <gmime/gmime.h>
-#ifdef HAVE_GPGME
#include "rfc3156.h"
-#endif
#define MESSAGE_COPY_CONTENT 1
#define LIBBALSA_TYPE_MESSAGE \
@@ -78,7 +76,6 @@ enum _LibBalsaMessageStatus {
};
-#ifdef HAVE_GPGME
typedef enum _LibBalsaMsgProtectState LibBalsaMsgProtectState;
enum _LibBalsaMsgProtectState {
@@ -89,18 +86,15 @@ enum _LibBalsaMsgProtectState {
LIBBALSA_MSG_PROTECT_SIGN_BAD,
LIBBALSA_MSG_PROTECT_CRYPT
};
-#endif
typedef enum _LibBalsaMessageAttach LibBalsaMessageAttach;
enum _LibBalsaMessageAttach {
LIBBALSA_MESSAGE_ATTACH_ATTACH,
-#ifdef HAVE_GPGME
LIBBALSA_MESSAGE_ATTACH_GOOD,
LIBBALSA_MESSAGE_ATTACH_NOTRUST,
LIBBALSA_MESSAGE_ATTACH_BAD,
LIBBALSA_MESSAGE_ATTACH_SIGN,
LIBBALSA_MESSAGE_ATTACH_ENCR,
-#endif
LIBBALSA_MESSAGE_ATTACH_ICONS_NUM
};
@@ -199,7 +193,6 @@ struct _LibBalsaMessage {
/* message ID */
gchar *message_id;
-#ifdef HAVE_GPGME
/* GPG sign and/or encrypt message (sending) */
guint gpg_mode;
@@ -211,7 +204,6 @@ struct _LibBalsaMessage {
/* sender identity, required for choosing a forced GnuPG or S/MIME key */
LibBalsaIdentity *ident;
-#endif
/* request a DSN (sending) */
gboolean request_dsn;
@@ -306,10 +298,8 @@ gboolean libbalsa_message_is_multipart(LibBalsaMessage * message);
gboolean libbalsa_message_is_partial(LibBalsaMessage * message,
gchar ** id);
gboolean libbalsa_message_has_attachment(LibBalsaMessage * message);
-#ifdef HAVE_GPGME
gboolean libbalsa_message_is_pgp_signed(LibBalsaMessage * message);
gboolean libbalsa_message_is_pgp_encrypted(LibBalsaMessage * message);
-#endif
const gchar* libbalsa_message_header_get_one(LibBalsaMessageHeaders* headers,
const gchar *find);
diff --git a/libbalsa/rfc3156.c b/libbalsa/rfc3156.c
index 9aa7df518..52d91a4e6 100644
--- a/libbalsa/rfc3156.c
+++ b/libbalsa/rfc3156.c
@@ -21,8 +21,6 @@
#endif /* HAVE_CONFIG_H */
#include "rfc3156.h"
-#ifdef HAVE_GPGME
-
#include <string.h>
#include <gpgme.h>
@@ -764,5 +762,3 @@ have_pub_key_for(gpgme_ctx_t gpgme_ctx,
return result;
}
-
-#endif /* HAVE_GPGME */
diff --git a/libbalsa/rfc3156.h b/libbalsa/rfc3156.h
index c04912268..8739ec99d 100644
--- a/libbalsa/rfc3156.h
+++ b/libbalsa/rfc3156.h
@@ -30,8 +30,6 @@
#define LIBBALSA_PROTECT_SMIMEV3 (1 << 3) /* RFC 2633 (S/MIME v3) */
#define LIBBALSA_PROTECT_RFC3156 (1 << 4) /* RFC 3156 (PGP/MIME) */
-#ifdef HAVE_GPGME
-
#include <gpgme.h>
#include "libbalsa.h"
#include "misc.h"
@@ -101,5 +99,4 @@ gchar *libbalsa_gpgme_sig_stat_to_gchar(gpgme_error_t stat)
const gchar *libbalsa_gpgme_validity_to_gchar(gpgme_validity_t validity);
const gchar *libbalsa_gpgme_validity_to_gchar_short(gpgme_validity_t validity);
-#endif /* HAVE_GPGME */
#endif /* __RFC3156_H__ */
diff --git a/libbalsa/send.c b/libbalsa/send.c
index e42a7c840..8ba6178b4 100644
--- a/libbalsa/send.c
+++ b/libbalsa/send.c
@@ -44,10 +44,7 @@
#include "identity.h"
#include "libbalsa-progress.h"
-
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
-#endif
#include <glib/gi18n.h>
@@ -233,7 +230,6 @@ send_message_info_destroy(SendMessageInfo *smi)
}
-#if HAVE_GPGME
static LibBalsaMsgCreateResult libbalsa_create_rfc2440_buffer(LibBalsaMessage *message,
GMimePart *mime_part,
GtkWindow *parent,
@@ -246,7 +242,6 @@ static LibBalsaMsgCreateResult do_multipart_crypto(LibBalsaMessage *message,
static GMimePart *lb_create_pubkey_part(LibBalsaMessage *message,
GtkWindow *parent,
GError **error);
-#endif
static gpointer balsa_send_message_real(SendMessageInfo *info);
static LibBalsaMsgCreateResult libbalsa_message_create_mime_message(LibBalsaMessage *message,
@@ -279,7 +274,6 @@ lbs_set_content(GMimePart *mime_part,
}
-#ifdef HAVE_GPGME
static GMimeObject *
add_mime_body_plain(LibBalsaMessageBody *body,
gboolean flow,
@@ -287,16 +281,10 @@ add_mime_body_plain(LibBalsaMessageBody *body,
guint use_gpg_mode,
LibBalsaMsgCreateResult *crypt_res,
GError **error)
-#else
-static GMimeObject *
-add_mime_body_plain(LibBalsaMessageBody * body, gboolean flow, gboolean postpone)
-#endif
{
GMimePart *mime_part;
const gchar *charset;
-#ifdef HAVE_GPGME
GtkWindow *parent = g_object_get_data(G_OBJECT(body->message), "parent-window");
-#endif
g_return_val_if_fail(body, NULL);
@@ -358,7 +346,6 @@ add_mime_body_plain(LibBalsaMessageBody * body, gboolean flow, gboolean postpone
lbs_set_content(mime_part, body->buffer);
}
-#ifdef HAVE_GPGME
/* rfc 2440 sign/encrypt if requested */
if (use_gpg_mode != 0) {
*crypt_res =
@@ -371,7 +358,6 @@ add_mime_body_plain(LibBalsaMessageBody * body, gboolean flow, gboolean postpone
return NULL;
}
}
-#endif
/* if requested, add a text/html version in a multipart/alternative */
if (body->html_buffer && !postpone) {
@@ -389,7 +375,6 @@ add_mime_body_plain(LibBalsaMessageBody * body, gboolean flow, gboolean postpone
"charset", "UTF-8");
lbs_set_content(mime_part, body->html_buffer);
-#ifdef HAVE_GPGME
if ((use_gpg_mode != 0) &&
((use_gpg_mode & LIBBALSA_PROTECT_MODE) != LIBBALSA_PROTECT_SIGN)) {
*crypt_res =
@@ -402,7 +387,6 @@ add_mime_body_plain(LibBalsaMessageBody * body, gboolean flow, gboolean postpone
return NULL;
}
}
-#endif
return GMIME_OBJECT(mpa);
} else {
@@ -1133,7 +1117,6 @@ message_add_references(const LibBalsaMessage *message,
}
-#ifdef HAVE_GPGME
static GList *
get_mailbox_names(GList *list,
InternetAddressList *address_list)
@@ -1156,8 +1139,6 @@ get_mailbox_names(GList *list,
}
-#endif
-
/* We could have used g_strsplit_set(s, "/;", 3) but it is not
* available in older glib. */
static gchar **
@@ -1209,16 +1190,12 @@ libbalsa_message_create_mime_message(LibBalsaMessage *message,
gchar *tmp;
GList *list;
gboolean attach_pubkey = FALSE;
-#ifdef HAVE_GPGME
GtkWindow *parent = g_object_get_data(G_OBJECT(message), "parent-window");
-#endif
-#ifdef HAVE_GPGME
/* attach the public key only if we send the message, not if we just postpone it */
if (!postponing && message->att_pubkey && ((message->gpg_mode & LIBBALSA_PROTECT_PROTOCOL) != 0)) {
attach_pubkey = TRUE;
}
-#endif
body = message->body_list;
if ((body != NULL) && ((body->next != NULL) || attach_pubkey)) {
@@ -1361,7 +1338,6 @@ libbalsa_message_create_mime_message(LibBalsaMessage *message,
}
g_strfreev(mime_type);
} else if (body->buffer != NULL) {
-#ifdef HAVE_GPGME
guint use_gpg_mode;
LibBalsaMsgCreateResult crypt_res = LIBBALSA_MESSAGE_CREATE_OK;
@@ -1381,9 +1357,6 @@ libbalsa_message_create_mime_message(LibBalsaMessage *message,
}
return crypt_res;
}
-#else
- mime_part = add_mime_body_plain(body, flow, postponing);
-#endif /* HAVE_GPGME */
}
if (mime_root != NULL) {
@@ -1397,7 +1370,6 @@ libbalsa_message_create_mime_message(LibBalsaMessage *message,
body = body->next;
}
-#ifdef HAVE_GPGME
if (attach_pubkey) {
GMimePart *pubkey_part;
@@ -1415,9 +1387,7 @@ libbalsa_message_create_mime_message(LibBalsaMessage *message,
mime_root = GMIME_OBJECT(pubkey_part);
}
}
-#endif
-#ifdef HAVE_GPGME
if ((message->body_list != NULL) && !postponing) {
LibBalsaMsgCreateResult crypt_res =
do_multipart_crypto(message, &mime_root, parent, error);
@@ -1425,7 +1395,6 @@ libbalsa_message_create_mime_message(LibBalsaMessage *message,
return crypt_res;
}
}
-#endif
mime_message = g_mime_message_new(TRUE);
if (mime_root != NULL) {
@@ -1721,7 +1690,6 @@ libbalsa_fill_msg_queue_item_from_queu(LibBalsaMessage *message,
}
-#ifdef HAVE_GPGME
/*
* If the identity contains a forced key ID for the passed protocol, return the key ID. Otherwise, return
the email address of the
* "From:" address list to let GpeME automagically select the proper key.
@@ -1959,6 +1927,3 @@ do_multipart_crypto(LibBalsaMessage *message,
return LIBBALSA_MESSAGE_CREATE_OK;
}
-
-
-#endif
diff --git a/libbalsa/send.h b/libbalsa/send.h
index 93381e952..4357665f8 100644
--- a/libbalsa/send.h
+++ b/libbalsa/send.h
@@ -32,10 +32,8 @@ typedef LibBalsaMailbox* (*LibBalsaFccboxFinder)(const gchar *url);
typedef enum _LibBalsaMsgCreateResult LibBalsaMsgCreateResult;
enum _LibBalsaMsgCreateResult {
LIBBALSA_MESSAGE_CREATE_OK,
-#ifdef HAVE_GPGME
LIBBALSA_MESSAGE_SIGN_ERROR,
LIBBALSA_MESSAGE_ENCRYPT_ERROR,
-#endif
LIBBALSA_MESSAGE_CREATE_ERROR,
LIBBALSA_MESSAGE_QUEUE_ERROR,
LIBBALSA_MESSAGE_SAVE_ERROR,
diff --git a/meson.build b/meson.build
index e81fd8d7f..509245301 100644
--- a/meson.build
+++ b/meson.build
@@ -47,7 +47,6 @@ if get_option('fcntl')
endif
gnome_desktop = get_option('gnome-desktop')
-gpgmecfg = get_option('gpgme')
autocrypt = get_option('autocrypt')
canberra = get_option('canberra')
compface = get_option('compface')
@@ -209,52 +208,41 @@ endif
# GPGME detection.
-if gpgmecfg == 'true'
- gpgmecfg_program = find_program('gpgme-config', required : false)
- if not gpgmecfg_program.found()
- error('GPGme build requested but gpgme-config program not found.')
- endif
- gpgmecfg = gpgmecfg_program.path()
-endif
+gpgmecfg_program = find_program('gpgme-config', required : true)
+gpgmecfg = gpgmecfg_program.path()
-if gpgmecfg != 'false'
- gpgmever = run_command(gpgmecfg, '--version').stdout().strip()
- if gpgmever.version_compare('< 1.5.0')
- gpgmecfg = 'false'
- message('Sorry, you need at least gpgme version 1.5.0')
+gpgmever = run_command(gpgmecfg, '--version').stdout().strip()
+if gpgmever.version_compare('< 1.6.0')
+ gpgmecfg = 'false'
+ error('Sorry, you need at least gpgme version 1.6.0')
+else
+ if gpgmever.version_compare('< 1.8.0')
+ gpgme_libs = run_command(gpgmecfg, '--thread=pthread', '--libs')
else
- if gpgmever.version_compare('< 1.8.0')
- gpgme_libs = run_command(gpgmecfg, '--thread=pthread', '--libs')
- else
- gpgme_libs = run_command(gpgmecfg, '--libs')
- endif
- if gpgme_libs.returncode() != 0
- error('*** You enabled gpgme support, but your gpgme installation does not support threads.')
- endif
+ gpgme_libs = run_command(gpgmecfg, '--libs')
+ endif
+ if gpgme_libs.returncode() != 0
+ error('*** Your gpgme installation does not support threads.')
+ endif
- gpgme_cflags = run_command(gpgmecfg, '--cflags')
- gpgme_cflags = gpgme_cflags.stdout().strip().split()
- gpgme_libs = gpgme_libs.stdout().strip().split()
+ gpgme_cflags = run_command(gpgmecfg, '--cflags')
+ gpgme_cflags = gpgme_cflags.stdout().strip().split()
+ gpgme_libs = gpgme_libs.stdout().strip().split()
- gpgme_dep = declare_dependency(compile_args : gpgme_cflags, link_args : gpgme_libs)
- conf.set('HAVE_GPGME', 1,
- description : 'Defined when gpgme is available.')
- balsa_deps += gpgme_dep
- gpgmecfg = 'true'
- endif
+ gpgme_dep = declare_dependency(compile_args : gpgme_cflags, link_args : gpgme_libs)
+ balsa_deps += gpgme_dep
+ gpgmecfg = 'true'
endif
# Autocrypt
-if gpgmecfg != 'false'
- if autocrypt
- autocrypt_dep = dependency('sqlite3', required : true)
- if autocrypt_dep.found()
- conf.set('ENABLE_AUTOCRYPT', 1, description : 'If defined, enable Autocrypt support.')
- else
- error('*** You enabled Autocrypt but sqlite3 library is not found.')
- endif
- balsa_deps += autocrypt_dep
+if autocrypt
+ autocrypt_dep = dependency('sqlite3', required : true)
+ if autocrypt_dep.found()
+ conf.set('ENABLE_AUTOCRYPT', 1, description : 'If defined, enable Autocrypt support.')
+ else
+ error('*** You enabled Autocrypt but sqlite3 library is not found.')
endif
+ balsa_deps += autocrypt_dep
endif
# OpenLDAP configuration.
@@ -636,7 +624,6 @@ summary = [
' HTML widget: @0@'.format(html_widget),
' Use GNOME: @0@'.format(gnome_desktop),
' Use Canberra: @0@'.format(canberra),
- ' Use GPGME: @0@'.format(gpgmecfg),
' Use Autocrypt: @0@'.format(autocrypt),
' Use LDAP: @0@'.format(ldap),
' Use GSS: @0@'.format(gss),
diff --git a/meson_options.txt b/meson_options.txt
index 94d0f5fab..230052752 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -13,11 +13,6 @@ option('fcntl',
value : true,
description : 'Use fcntl() to lock files (default=true)')
-option('gpgme',
- type : 'string',
- value : 'false',
- description : 'build with gpgme/GnuPG support (true|false|path to gpgme-config, default=false)')
-
option('autocrypt',
type : 'boolean',
value : false,
diff --git a/src/balsa-app.c b/src/balsa-app.c
index 2ce5f8903..a91a537a0 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -407,11 +407,9 @@ balsa_app_init(void)
balsa_app.check_imap_inbox = 0;
balsa_app.imap_scan_depth = 1;
-#ifdef HAVE_GPGME
/* gpgme stuff */
balsa_app.has_openpgp = FALSE;
balsa_app.has_smime = FALSE;
-#endif
/* Message filing */
balsa_app.folder_mru=NULL;
diff --git a/src/balsa-app.h b/src/balsa-app.h
index 5b9b197f9..617475ced 100644
--- a/src/balsa-app.h
+++ b/src/balsa-app.h
@@ -356,12 +356,10 @@ extern struct BalsaApplication {
gboolean convert_unknown_8bit;
LibBalsaCodeset convert_unknown_8bit_codeset;
-#ifdef HAVE_GPGME
/* gpgme stuff */
gboolean has_openpgp;
gboolean has_smime;
gboolean warn_reply_decrypted;
-#endif
/* Most recently used lists */
GList *folder_mru;
diff --git a/src/balsa-icons.c b/src/balsa-icons.c
index a8ee0d720..b06413c42 100644
--- a/src/balsa-icons.c
+++ b/src/balsa-icons.c
@@ -127,7 +127,6 @@ balsa_register_pixmaps(void)
{ BALSA_PIXMAP_NEXT_UNREAD, "balsa-next-unread" },
{ BALSA_PIXMAP_NEXT_FLAGGED, "balsa-next-flagged" },
-#ifdef HAVE_GPGME
/* crypto status icons, for both the structure view tree (24x24)
* and the index (16x16) */
{ BALSA_PIXMAP_SIGN, "balsa-signature-unknown" },
@@ -135,7 +134,6 @@ balsa_register_pixmaps(void)
{ BALSA_PIXMAP_SIGN_NOTRUST, "balsa-signature-notrust" },
{ BALSA_PIXMAP_SIGN_BAD, "balsa-signature-bad" },
{ BALSA_PIXMAP_ENCR, "balsa-encrypted" },
-#endif
/* the following book icons aren't strictly necessary as Gnome provides
them. However, this simplifies porting balsa if the Gnome libs
@@ -151,11 +149,9 @@ balsa_register_pixmaps(void)
{ BALSA_PIXMAP_SHOW_PREVIEW, "balsa-preview" },
{ BALSA_PIXMAP_MARKED_NEW, "balsa-marked-new" },
{ BALSA_PIXMAP_TRASH_EMPTY, "balsa-trash-empty" },
-#ifdef HAVE_GPGME
{ BALSA_PIXMAP_GPG_SIGN, "balsa-sign" },
{ BALSA_PIXMAP_GPG_ENCRYPT, "balsa-encrypt" },
{ BALSA_PIXMAP_GPG_RECHECK, "balsa-crypt-check" },
-#endif
/* mailbox icons (16x16) */
{ BALSA_PIXMAP_MBOX_IN, "mail-inbox" },
@@ -210,16 +206,12 @@ balsa_register_pixbufs(GtkWidget * widget)
libbalsa_mailbox_set_trash_icon, BALSA_PIXMAP_INFO_DELETED}, {
libbalsa_mailbox_set_flagged_icon, BALSA_PIXMAP_INFO_FLAGGED}, {
libbalsa_mailbox_set_replied_icon, BALSA_PIXMAP_INFO_REPLIED}, {
- libbalsa_mailbox_set_attach_icon, BALSA_PIXMAP_INFO_ATTACHMENT},
-#ifdef HAVE_GPGME
- {
+ libbalsa_mailbox_set_attach_icon, BALSA_PIXMAP_INFO_ATTACHMENT}, {
libbalsa_mailbox_set_good_icon, BALSA_PIXMAP_SIGN_GOOD}, {
libbalsa_mailbox_set_notrust_icon, BALSA_PIXMAP_SIGN_NOTRUST}, {
libbalsa_mailbox_set_bad_icon, BALSA_PIXMAP_SIGN_BAD}, {
libbalsa_mailbox_set_sign_icon, BALSA_PIXMAP_SIGN}, {
- libbalsa_mailbox_set_encr_icon, BALSA_PIXMAP_ENCR},
-#endif
- {
+ libbalsa_mailbox_set_encr_icon, BALSA_PIXMAP_ENCR}, {
libbalsa_address_view_set_book_icon, BALSA_PIXMAP_BOOK_RED}, {
libbalsa_address_view_set_close_icon, "window-close-symbolic"}, {
libbalsa_address_view_set_drop_down_icon, BALSA_PIXMAP_DROP_DOWN},
diff --git a/src/balsa-icons.h b/src/balsa-icons.h
index 90cfb434c..dd4e43efa 100644
--- a/src/balsa-icons.h
+++ b/src/balsa-icons.h
@@ -74,16 +74,14 @@
#define BALSA_PIXMAP_INFO_NEW "balsa_info_new"
#define BALSA_PIXMAP_INFO_ATTACHMENT BALSA_PIXMAP_ATTACHMENT
#define BALSA_PIXMAP_INFO_DELETED "edit-delete"
-#ifdef HAVE_GPGME
-# define BALSA_PIXMAP_GPG_SIGN "balsa_gpg_sign"
-# define BALSA_PIXMAP_GPG_ENCRYPT "balsa_gpg_encrypt"
-# define BALSA_PIXMAP_GPG_RECHECK "balsa_gpg_recheck"
-# define BALSA_PIXMAP_SIGN "balsa_sign"
-# define BALSA_PIXMAP_SIGN_GOOD "balsa_sign_good"
-# define BALSA_PIXMAP_SIGN_NOTRUST "balsa_sign_trust"
-# define BALSA_PIXMAP_SIGN_BAD "balsa_sign_bad"
-# define BALSA_PIXMAP_ENCR "balsa_encr"
-#endif
+#define BALSA_PIXMAP_GPG_SIGN "balsa_gpg_sign"
+#define BALSA_PIXMAP_GPG_ENCRYPT "balsa_gpg_encrypt"
+#define BALSA_PIXMAP_GPG_RECHECK "balsa_gpg_recheck"
+#define BALSA_PIXMAP_SIGN "balsa_sign"
+#define BALSA_PIXMAP_SIGN_GOOD "balsa_sign_good"
+#define BALSA_PIXMAP_SIGN_NOTRUST "balsa_sign_trust"
+#define BALSA_PIXMAP_SIGN_BAD "balsa_sign_bad"
+#define BALSA_PIXMAP_ENCR "balsa_encr"
#define BALSA_PIXMAP_BOOK_RED "balsa_book_red"
#define BALSA_PIXMAP_BOOK_YELLOW "balsa_book_yellow"
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 56d02ead7..a8b29f3fb 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -39,10 +39,8 @@
#include "balsa-mime-widget-message.h"
#include "balsa-mime-widget-image.h"
#include "balsa-mime-widget-crypto.h"
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
#include "autocrypt.h"
-#endif
#include <gdk/gdkkeysyms.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -56,9 +54,7 @@
# include "macosx-helpers.h"
#endif
-#ifdef HAVE_GPGME
-# include "gmime-part-rfc2440.h"
-#endif
+#include "gmime-part-rfc2440.h"
# define FORWARD_SEARCH(iter, text, match_begin, match_end) \
gtk_text_iter_forward_search((iter), (text), \
@@ -156,15 +152,12 @@ static void balsa_part_info_init(GObject *object, gpointer data);
static BalsaPartInfo* balsa_part_info_new(LibBalsaMessageBody* body);
static void balsa_part_info_free(GObject * object);
-
-#ifdef HAVE_GPGME
static LibBalsaMsgProtectState balsa_message_scan_signatures(LibBalsaMessageBody *body,
LibBalsaMessage * message);
static GdkPixbuf * get_crypto_content_icon(LibBalsaMessageBody * body,
const gchar * content_type,
gchar ** icon_title);
static void message_recheck_crypto_cb(GtkWidget * button, BalsaMessage * bm);
-#endif /* HAVE_GPGME */
#ifdef ENABLE_AUTOCRYPT
static inline gboolean autocrypt_in_use(void);
@@ -282,7 +275,6 @@ bm_header_tl_buttons(BalsaMessage * bm)
array = g_ptr_array_new();
-#ifdef HAVE_GPGME
button =
gtk_button_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_GPG_RECHECK),
GTK_ICON_SIZE_BUTTON);
@@ -298,7 +290,6 @@ bm_header_tl_buttons(BalsaMessage * bm)
g_signal_connect(button, "clicked",
G_CALLBACK(message_recheck_crypto_cb), bm);
g_ptr_array_add(array, button);
-#endif
button =
gtk_button_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_ATTACHMENT),
@@ -1199,7 +1190,6 @@ balsa_message_set(BalsaMessage * bm, LibBalsaMailbox * mailbox, guint msgno)
return FALSE;
}
-#ifdef HAVE_GPGME
balsa_message_perform_crypto(message,
libbalsa_mailbox_get_crypto_mode(mailbox),
FALSE, 1);
@@ -1211,7 +1201,6 @@ balsa_message_set(BalsaMessage * bm, LibBalsaMailbox * mailbox, guint msgno)
if (message->prot_state != prot_state)
message->prot_state = prot_state;
}
-#endif
/* may update the icon */
libbalsa_mailbox_msgno_update_attach(mailbox, message->msgno, message);
@@ -1525,7 +1514,6 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
info->path = gtk_tree_model_get_path(model, iter);
/* add to the tree view */
-#ifdef HAVE_GPGME
content_icon =
get_crypto_content_icon(body, content_type, &icon_title);
if (info->body->was_encrypted) {
@@ -1534,9 +1522,6 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
g_free(icon_title);
icon_title = new_title;
}
-#else
- content_icon = NULL;
-#endif
if (!content_icon)
content_icon =
libbalsa_icon_finder(GTK_WIDGET(bm),
@@ -2192,7 +2177,6 @@ add_multipart_mixed(BalsaMessage * bm, LibBalsaMessageBody * body,
if (body) {
retval = add_body(bm, body, container);
for (body = body->next; body; body = body->next) {
-#ifdef HAVE_GPGME
GMimeContentType *type =
g_mime_content_type_new_from_string(body->content_type);
@@ -2205,12 +2189,6 @@ add_multipart_mixed(BalsaMessage * bm, LibBalsaMessageBody * body,
g_mime_content_type_is_type(type, "application", "x-pkcs7-signature"))))
add_body(bm, body, container);
g_object_unref(type);
-#else
- if (libbalsa_message_body_is_inline(body) ||
- bm->force_inline ||
- libbalsa_message_body_is_multipart(body))
- add_body(bm, body, container);
-#endif
}
}
@@ -2709,7 +2687,6 @@ balsa_message_zoom(BalsaMessage * bm, gint in_out)
#endif /* HAVE_HTML_WIDGET */
-#ifdef HAVE_GPGME
/*
* collected GPG(ME) helper stuff to make the source more readable
*/
@@ -3319,7 +3296,6 @@ message_recheck_crypto_cb(GtkWidget * button, BalsaMessage * bm)
g_object_unref(G_OBJECT(message));
}
-#endif /* HAVE_GPGME */
/*
* Public method for find-in-message.
diff --git a/src/balsa-message.h b/src/balsa-message.h
index 20a99424b..8fd06f57b 100644
--- a/src/balsa-message.h
+++ b/src/balsa-message.h
@@ -136,12 +136,10 @@ gboolean balsa_message_can_zoom(BalsaMessage * bm);
void balsa_message_zoom(BalsaMessage * bm, gint in_out);
#endif /* HAVE_HTML_WIDGET */
-#ifdef HAVE_GPGME
void balsa_message_perform_crypto(LibBalsaMessage * message,
LibBalsaChkCryptoMode chk_mode,
gboolean no_mp_signed,
guint max_ref);
-#endif
void balsa_message_find_in_message (BalsaMessage * bm);
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index 4a0d75774..1d93db928 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -22,7 +22,6 @@
#endif /* HAVE_CONFIG_H */
#include "balsa-mime-widget-crypto.h"
-#ifdef HAVE_GPGME
#include "balsa-app.h"
#include "balsa-icons.h"
#include <glib/gi18n.h>
@@ -359,5 +358,3 @@ create_import_keys_widget(GtkBox *box, const gchar *key_buf, GError **error)
return success;
}
-
-#endif /* HAVE_GPGME */
diff --git a/src/balsa-mime-widget-crypto.h b/src/balsa-mime-widget-crypto.h
index 3e72fe92c..0a3e88977 100644
--- a/src/balsa-mime-widget-crypto.h
+++ b/src/balsa-mime-widget-crypto.h
@@ -24,8 +24,6 @@
# error "Include config.h before this file."
#endif
-#ifdef HAVE_GPGME
-
#include "balsa-app.h"
#include "balsa-message.h"
#include "balsa-mime-widget.h"
@@ -50,5 +48,4 @@ const gchar *balsa_mime_widget_signature_icon_name(LibBalsaMsgProtectState prote
G_END_DECLS
-#endif /* HAVE_GPGME */
#endif /* __BALSA_MIME_WIDGET_IMAGE_H__ */
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index 8e8dc692b..2778394a0 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -32,9 +32,7 @@
#include "balsa-mime-widget.h"
#include "balsa-mime-widget-callbacks.h"
#include "sendmsg-window.h"
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
-#endif
typedef enum _rfc_extbody_t {
RFC2046_EXTBODY_FTP,
@@ -77,10 +75,8 @@ static void extbody_send_mail(GtkWidget * button,
/* message/rfc822 related stuff */
static GtkWidget *bm_header_widget_new(BalsaMessage * bm,
GtkWidget * const * buttons);
-#ifdef HAVE_GPGME
static void add_header_sigstate(GtkGrid * grid,
GMimeGpgmeSigstat * siginfo);
-#endif
static void bmw_message_set_headers(BalsaMessage * bm,
BalsaMimeWidget * mw,
@@ -779,7 +775,6 @@ bmw_message_set_headers_d(BalsaMessage * bm,
g_free(hdr);
}
-#ifdef HAVE_GPGME
if (part) {
if (libbalsa_message_body_multipart_signed(part)) {
/* top-level part is RFC 3156 or RFC 8551 multipart/signed */
@@ -789,7 +784,6 @@ bmw_message_set_headers_d(BalsaMessage * bm,
add_header_sigstate(grid, part->sig_info);
}
}
-#endif
}
static void
@@ -831,7 +825,6 @@ balsa_mime_widget_message_set_headers_d(BalsaMessage * bm,
bm->shown_headers == HEADERS_ALL);
}
-#ifdef HAVE_GPGME
/*
* Add the short status of a signature info siginfo to the message headers in
* view
@@ -857,4 +850,3 @@ add_header_sigstate(GtkGrid * grid, GMimeGpgmeSigstat * siginfo)
gtk_grid_attach_next_to(grid, label, NULL, GTK_POS_BOTTOM, 2, 1);
}
-#endif
diff --git a/src/balsa-mime-widget-multipart.c b/src/balsa-mime-widget-multipart.c
index 687279e6a..ef9f5be8c 100644
--- a/src/balsa-mime-widget-multipart.c
+++ b/src/balsa-mime-widget-multipart.c
@@ -41,14 +41,12 @@ balsa_mime_widget_new_multipart(BalsaMessage * bm,
mw = g_object_new(BALSA_TYPE_MIME_WIDGET, NULL);
mw->widget = mw->container = gtk_box_new(GTK_ORIENTATION_VERTICAL, BMW_MESSAGE_PADDING);
-#ifdef HAVE_GPGME
if (!g_ascii_strcasecmp("multipart/signed", content_type) &&
mime_body->parts && mime_body->parts->next &&
mime_body->parts->next->sig_info)
mw->widget =
balsa_mime_widget_crypto_frame(mime_body->parts->next, mw->widget,
mime_body->was_encrypted, FALSE, NULL);
-#endif
return mw;
}
diff --git a/src/balsa-mime-widget.c b/src/balsa-mime-widget.c
index d782f5c87..1f5c360e0 100644
--- a/src/balsa-mime-widget.c
+++ b/src/balsa-mime-widget.c
@@ -116,12 +116,10 @@ static mime_delegate_t mime_delegate[] =
{TRUE, "text/", balsa_mime_widget_new_text},
{TRUE, "multipart/", balsa_mime_widget_new_multipart},
{TRUE, "image/", balsa_mime_widget_new_image},
-#ifdef HAVE_GPGME
{FALSE, "application/pgp-signature", balsa_mime_widget_new_signature},
{FALSE, "application/pkcs7-signature", balsa_mime_widget_new_signature},
{FALSE, "application/x-pkcs7-signature", balsa_mime_widget_new_signature},
{FALSE, "application/pgp-keys", balsa_mime_widget_new_pgpkey},
-#endif
{FALSE, NULL, NULL}
};
@@ -161,7 +159,6 @@ balsa_mime_widget_new(BalsaMessage * bm, LibBalsaMessageBody * mime_body, gpoint
g_signal_connect(G_OBJECT(mw->widget), "focus_out_event",
G_CALLBACK(balsa_mime_widget_unlimit_focus),
(gpointer) bm);
-#ifdef HAVE_GPGME
if (mime_body->sig_info &&
g_ascii_strcasecmp("application/pgp-signature", content_type) &&
g_ascii_strcasecmp("application/pkcs7-signature", content_type) &&
@@ -176,7 +173,6 @@ balsa_mime_widget_new(BalsaMessage * bm, LibBalsaMessageBody * mime_body, gpoint
mw->widget = balsa_mime_widget_crypto_frame(mime_body, mw->widget,
TRUE, TRUE, NULL);
}
-#endif
g_object_ref_sink(mw->widget);
if (GTK_IS_LAYOUT(mw->widget)) {
diff --git a/src/balsa-print-object-header.c b/src/balsa-print-object-header.c
index 389685e6a..798245008 100644
--- a/src/balsa-print-object-header.c
+++ b/src/balsa-print-object-header.c
@@ -27,9 +27,7 @@
#include "balsa-print-object.h"
#include "balsa-print-object-decor.h"
#include "balsa-print-object-default.h"
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
-#endif
/* object related functions */
static void balsa_print_object_header_class_init(BalsaPrintObjectHeaderClass * klass);
@@ -222,7 +220,6 @@ balsa_print_object_header_new_real(GList * list,
/* add a small space between label and value */
p_label_width += C_TO_P(C_LABEL_SEP);
-#ifdef HAVE_GPGME
/* add a signature status to the string */
if (balsa_app.shown_headers != HEADERS_NONE) {
gchar *info_str = NULL;
@@ -240,7 +237,6 @@ balsa_print_object_header_new_real(GList * list,
g_free(info_str);
}
}
-#endif /* HAVE_GPGME */
/* strip the trailing '\n' */
header_buf = g_string_truncate(header_buf, header_buf->len - 1);
@@ -354,7 +350,6 @@ balsa_print_object_header_from_body(GList *list,
}
-#ifdef HAVE_GPGME
GList *
balsa_print_object_header_crypto(GList *list, GtkPrintContext * context,
LibBalsaMessageBody * body,
@@ -431,7 +426,6 @@ balsa_print_object_header_crypto(GList *list, GtkPrintContext * context,
return list;
}
-#endif
static void
diff --git a/src/balsa-print-object-header.h b/src/balsa-print-object-header.h
index 2c09318b5..d072146f8 100644
--- a/src/balsa-print-object-header.h
+++ b/src/balsa-print-object-header.h
@@ -67,12 +67,10 @@ GList *balsa_print_object_header_from_body(GList *list,
GtkPrintContext * context,
LibBalsaMessageBody * body,
BalsaPrintSetup * psetup);
-#ifdef HAVE_GPGME
GList *balsa_print_object_header_crypto(GList *list,
GtkPrintContext * context,
LibBalsaMessageBody * body,
BalsaPrintSetup * psetup);
-#endif
G_END_DECLS
diff --git a/src/balsa-print-object.c b/src/balsa-print-object.c
index 48fec33d9..fbb9d0ed6 100644
--- a/src/balsa-print-object.c
+++ b/src/balsa-print-object.c
@@ -116,7 +116,6 @@ balsa_print_object_emb_headers(GList * list, GtkPrintContext * context,
return balsa_print_object_frame_end(list, psetup);
}
-#ifdef HAVE_GPGME
static GList *
balsa_print_object_mp_crypto(GList * list, GtkPrintContext * context,
LibBalsaMessageBody * mime_body,
@@ -124,7 +123,6 @@ balsa_print_object_mp_crypto(GList * list, GtkPrintContext * context,
{
return balsa_print_object_header_crypto(list, context, mime_body, psetup);
}
-#endif /* HAVE_GPGME */
GList *
@@ -150,11 +148,9 @@ balsa_print_objects_append_from_body(GList * list,
{ "text/", 5, balsa_print_object_text },
{ "image/", 6, balsa_print_object_image },
{ "message/rfc822", -1, balsa_print_object_emb_message },
-#ifdef HAVE_GPGME
{ "application/pgp-signature", -1, balsa_print_object_mp_crypto },
{ "application/pkcs7-signature", -1, balsa_print_object_mp_crypto },
{ "application/x-pkcs7-signature", -1, balsa_print_object_mp_crypto },
-#endif /* HAVE_GPGME */
{ NULL, -1, balsa_print_object_default }
};
gchar *conttype;
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 79cba5898..6826d473a 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -66,9 +66,7 @@ struct _BalsaMailboxConfView {
GtkWidget *identity_combo_box;
GtkWidget *show_to;
GtkWidget *subscribe;
-#ifdef HAVE_GPGME
GtkWidget *chk_crypt;
-#endif
GtkWidget *thread_messages;
GtkWidget *subject_gather;
LibBalsaMailbox *mailbox;
@@ -885,35 +883,30 @@ mailbox_conf_view_new_full(LibBalsaMailbox * mailbox,
gtk_grid_attach(GTK_GRID(grid), widget, 1, row, 1, 1);
if (callback)
- g_signal_connect_swapped(widget, "changed", callback, window);
-
-#ifdef HAVE_GPGME
- {
- /* scope */
- label =
- libbalsa_create_grid_label(_("_Decrypt and check\n"
- "signatures automatically:"),
- grid, ++row);
- if (size_group)
- gtk_size_group_add_widget(size_group, label);
-
- view_info->chk_crypt = gtk_combo_box_text_new();
- gtk_label_set_mnemonic_widget(GTK_LABEL(label), view_info->chk_crypt);
- gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(view_info->chk_crypt), _("Never"));
- gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(view_info->chk_crypt), _("If Possible"));
- gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(view_info->chk_crypt), _("Always"));
- gtk_combo_box_set_active(GTK_COMBO_BOX(view_info->chk_crypt),
- libbalsa_mailbox_get_crypto_mode(mailbox));
- if (mcw)
- g_signal_connect(view_info->chk_crypt, "changed",
- G_CALLBACK(check_for_blank_fields), mcw);
- if (callback)
- g_signal_connect_swapped(view_info->chk_crypt, "changed",
- callback, window);
- gtk_widget_set_hexpand(view_info->chk_crypt, TRUE);
- gtk_grid_attach(GTK_GRID(grid), view_info->chk_crypt, 1, row, 1, 1);
- }
-#endif
+ g_signal_connect_swapped(widget, "changed", callback, window);
+
+ label =
+ libbalsa_create_grid_label(_("_Decrypt and check\n"
+ "signatures automatically:"),
+ grid, ++row);
+ if (size_group)
+ gtk_size_group_add_widget(size_group, label);
+
+ view_info->chk_crypt = gtk_combo_box_text_new();
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), view_info->chk_crypt);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(view_info->chk_crypt), _("Never"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(view_info->chk_crypt), _("If Possible"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(view_info->chk_crypt), _("Always"));
+ gtk_combo_box_set_active(GTK_COMBO_BOX(view_info->chk_crypt),
+ libbalsa_mailbox_get_crypto_mode(mailbox));
+ if (mcw)
+ g_signal_connect(view_info->chk_crypt, "changed",
+ G_CALLBACK(check_for_blank_fields), mcw);
+ if (callback)
+ g_signal_connect_swapped(view_info->chk_crypt, "changed",
+ callback, window);
+ gtk_widget_set_hexpand(view_info->chk_crypt, TRUE);
+ gtk_grid_attach(GTK_GRID(grid), view_info->chk_crypt, 1, row, 1, 1);
/* Show address check button */
view_info->show_to =
@@ -1051,11 +1044,9 @@ mailbox_conf_view_check(BalsaMailboxConfView * view_info,
(view_info->thread_messages));
balsa_window_set_thread_messages(balsa_app.main_window, active);
-#ifdef HAVE_GPGME
if (libbalsa_mailbox_set_crypto_mode(mailbox,
gtk_combo_box_get_active(GTK_COMBO_BOX(view_info->chk_crypt))))
changed = TRUE;
-#endif
if (!changed || !libbalsa_mailbox_get_open(mailbox))
return;
diff --git a/src/main.c b/src/main.c
index 8c49442f3..cf56175d9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,10 +52,8 @@
#include "libinit_balsa/assistant_init.h"
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
#include "libbalsa-gpgme-cb.h"
-#endif
/* We need separate variable for storing command line requests to check the
mail because such selection cannot be stored in balsa_app and later
@@ -519,11 +517,9 @@ balsa_startup_cb(GApplication *application,
LIBXML_TEST_VERSION
#endif
-#ifdef HAVE_GPGME
/* initialise the gpgme library and set the callback funcs */
libbalsa_gpgme_init(lb_gpgme_passphrase, lb_gpgme_select_key,
lb_gpgme_accept_low_trust_key);
-#endif
balsa_app_init();
@@ -563,12 +559,10 @@ balsa_startup_cb(GApplication *application,
return;
}
-#ifdef HAVE_GPGME
balsa_app.has_openpgp =
libbalsa_gpgme_check_crypto_engine(GPGME_PROTOCOL_OpenPGP);
balsa_app.has_smime =
libbalsa_gpgme_check_crypto_engine(GPGME_PROTOCOL_CMS);
-#endif /* HAVE_GPGME */
accel_map_load();
}
diff --git a/src/print-gtk.c b/src/print-gtk.c
index 0ac5c3b5b..a96fa875b 100644
--- a/src/print-gtk.c
+++ b/src/print-gtk.c
@@ -32,9 +32,7 @@
#include "balsa-print-object.h"
#include "balsa-print-object-decor.h"
#include "balsa-print-object-header.h"
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
-#endif
#if HAVE__NL_MEASUREMENT_MEASUREMENT
#include <langinfo.h>
@@ -159,7 +157,6 @@ find_alt_part(LibBalsaMessageBody *parts,
}
-#ifdef HAVE_GPGME
static inline GList *
begin_crypto_frame(GList *bpo_list,
BalsaPrintSetup *psetup,
@@ -179,7 +176,6 @@ begin_crypto_frame(GList *bpo_list,
}
return bpo_list;
}
-#endif /* HAVE_GPGME */
static GList *
@@ -194,9 +190,7 @@ print_single_part(GList *bpo_list,
bpo_list = balsa_print_object_separator(bpo_list, psetup);
}
if (add_signature) {
-#ifdef HAVE_GPGME
bpo_list = begin_crypto_frame(bpo_list, psetup, TRUE, body->was_encrypted);
-#endif /* HAVE_GPGME */
}
return balsa_print_objects_append_from_body(bpo_list, context, body, psetup);
}
@@ -210,15 +204,12 @@ scan_body(GList *bpo_list, GtkPrintContext * context, BalsaPrintSetup * psetup,
LibBalsaMessageBody * body, gboolean no_first_sep)
{
gboolean add_signature = FALSE;
-#ifdef HAVE_GPGME
gboolean have_crypto_frame;
gboolean is_mp_signed;
-#endif /* HAVE_GPGME */
while (body) {
gchar *conttype;
conttype = libbalsa_message_body_get_mime_type(body);
-#ifdef HAVE_GPGME
add_signature = body->sig_info &&
g_ascii_strcasecmp(conttype, "application/pgp-signature") &&
g_ascii_strcasecmp(conttype, "application/pkcs7-signature") &&
@@ -233,19 +224,16 @@ scan_body(GList *bpo_list, GtkPrintContext * context, BalsaPrintSetup * psetup,
} else {
have_crypto_frame = FALSE;
}
-#endif /* HAVE_GPGME */
if (g_ascii_strncasecmp(conttype, "multipart/", 10)) {
bpo_list = print_single_part(bpo_list, context, psetup, body, no_first_sep, add_signature);
no_first_sep = FALSE;
-#ifdef HAVE_GPGME
} else if (add_signature && !is_mp_signed) {
if (!no_first_sep) {
bpo_list = balsa_print_object_separator(bpo_list, psetup);
no_first_sep = TRUE;
}
bpo_list = begin_crypto_frame(bpo_list, psetup, TRUE, body->was_encrypted);
-#endif /* HAVE_GPGME */
}
if (body->parts) {
@@ -261,20 +249,14 @@ scan_body(GList *bpo_list, GtkPrintContext * context, BalsaPrintSetup * psetup,
}
/* end the frame for an embedded message or encrypted stuff */
- if (!g_ascii_strcasecmp(conttype, "message/rfc822")
-#ifdef HAVE_GPGME
- || have_crypto_frame
-#endif
- )
+ if (!g_ascii_strcasecmp(conttype, "message/rfc822") || have_crypto_frame)
bpo_list = balsa_print_object_frame_end(bpo_list, psetup);
-#ifdef HAVE_GPGME
if (add_signature) {
bpo_list = balsa_print_object_separator(bpo_list, psetup);
bpo_list = balsa_print_object_header_crypto(bpo_list, context, body, psetup);
bpo_list = balsa_print_object_frame_end(bpo_list, psetup);
}
-#endif /* HAVE_GPGME */
g_free(conttype);
body = body->next;
diff --git a/src/save-restore.c b/src/save-restore.c
index 33d5030da..ec607da31 100644
--- a/src/save-restore.c
+++ b/src/save-restore.c
@@ -701,13 +701,11 @@ config_global_load(void)
geometry_manager_init("SourceView", 500, 400, FALSE);
geometry_manager_init("IMAPSubscriptions", 200, 160, FALSE);
geometry_manager_init("IMAPSelectParent", 200, 160, FALSE);
-#ifdef HAVE_GPGME
geometry_manager_init("KeyDialog", 400, 200, FALSE);
geometry_manager_init("KeyList", 300, 200, FALSE);
#ifdef ENABLE_AUTOCRYPT
geometry_manager_init("AutocryptDB", 300, 200, FALSE);
#endif /* ENABLE_AUTOCRYPT */
-#endif /* HAVE_GPGME */
/* FIXME: PKGW: why comment this out? Breaks my Transfer context menu. */
if (balsa_app.mblist_width < 100)
@@ -1067,10 +1065,8 @@ config_global_load(void)
g_free(balsa_app.compose_headers);
balsa_app.compose_headers =
libbalsa_conf_get_string("ComposeHeaders=Recipients Subject");
-#ifdef HAVE_GPGME
balsa_app.warn_reply_decrypted =
libbalsa_conf_get_bool("WarnReplyDecrypted=true");
-#endif
/* Obsolete. */
libbalsa_conf_get_bool_with_default("RequestDispositionNotification=false",
@@ -1475,9 +1471,7 @@ config_save(void)
libbalsa_conf_set_string("ComposeHeaders", balsa_app.compose_headers);
libbalsa_conf_set_bool("ExternEditorEditHeaders", balsa_app.edit_headers);
libbalsa_conf_set_string("QuoteString", balsa_app.quote_str);
-#ifdef HAVE_GPGME
libbalsa_conf_set_bool("WarnReplyDecrypted", balsa_app.warn_reply_decrypted);
-#endif
libbalsa_conf_pop_group();
@@ -1802,10 +1796,8 @@ config_load_mailbox_view(const gchar * url)
if (libbalsa_conf_has_key("Position"))
view->position = libbalsa_conf_get_int("Position");
-#ifdef HAVE_GPGME
if (libbalsa_conf_has_key("CryptoMode"))
view->gpg_chk_mode = libbalsa_conf_get_int("CryptoMode");
-#endif
if (libbalsa_conf_has_key("Total"))
view->total = libbalsa_conf_get_int("Total");
@@ -1861,10 +1853,8 @@ config_save_mailbox_view(const gchar * url, LibBalsaMailboxView * view)
if (view->position != libbalsa_mailbox_get_position(NULL))
libbalsa_conf_set_int("Position", view->position);
}
-#ifdef HAVE_GPGME
if (view->gpg_chk_mode != libbalsa_mailbox_get_crypto_mode(NULL))
libbalsa_conf_set_int("CryptoMode", view->gpg_chk_mode);
-#endif
/* To avoid accumulation of config entries with only message counts,
* we save them only if used in this session. */
if (view->used && view->mtime != 0) {
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index f54744409..cfd791a15 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -80,13 +80,11 @@
#if HAVE_GTKSOURCEVIEW
#include <gtksourceview/gtksource.h>
#endif /* HAVE_GTKSOURCEVIEW */
-#ifdef HAVE_GPGME
#include "libbalsa-gpgme.h"
#ifdef ENABLE_AUTOCRYPT
#include "autocrypt.h"
#include "libbalsa-gpgme-keys.h"
#endif /* ENABLE_AUTOCRYPT */
-#endif /* HAVE_GPGME */
typedef struct {
pid_t pid_editor;
@@ -101,12 +99,10 @@ static gint message_postpone(BalsaSendmsg * bsmsg);
static void balsa_sendmsg_destroy_handler(BalsaSendmsg * bsmsg);
static void check_readiness(BalsaSendmsg * bsmsg);
static void init_menus(BalsaSendmsg *);
-#ifdef HAVE_GPGME
static void bsmsg_setup_gpg_ui(BalsaSendmsg *bsmsg);
static void bsmsg_update_gpg_ui_on_ident_change(BalsaSendmsg *bsmsg,
LibBalsaIdentity *new_ident);
static void bsmsg_setup_gpg_ui_by_mode(BalsaSendmsg *bsmsg, gint mode);
-#endif
#if !HAVE_GSPELL && !HAVE_GTKSPELL_3_0_3
static void sw_spell_check_weak_notify(BalsaSendmsg * bsmsg);
@@ -1294,9 +1290,7 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
}
sw_action_set_active(bsmsg, "send-html", bsmsg->ident->send_mp_alternative);
-#ifdef HAVE_GPGME
bsmsg_update_gpg_ui_on_ident_change(bsmsg, ident);
-#endif
g_free(old_sig);
g_free(new_sig);
@@ -3094,9 +3088,7 @@ tree_add_quote_body(LibBalsaMessageBody *body,
}
/* mark decrypted parts, including those in a decrypted container */
-#ifdef HAVE_GPGME
decrypted |= body->was_encrypted;
-#endif
description = g_string_new(decrypted ? _("decrypted: ") : NULL);
/* attachment information */
@@ -3177,12 +3169,7 @@ scan_bodies(GtkTreeStore *bodies,
mime_type = libbalsa_message_body_get_mime_type(body);
scan_bodies(bodies, parent, body->parts, ignore_html,
!g_ascii_strcasecmp(mime_type, "multipart/alternative"),
-#ifdef HAVE_GPGME
- body->was_encrypted | decrypted,
-#else
- FALSE,
-#endif
- stats);
+ body->was_encrypted | decrypted, stats);
g_free(mime_type);
break;
@@ -3347,7 +3334,6 @@ append_parts(GString * q_body, LibBalsaMessage *message, GtkTreeModel * model,
} while (gtk_tree_model_iter_next(model, iter));
}
-#ifdef HAVE_GPGME
static gboolean
unselect_decrypted(GtkTreeModel *model,
GtkTreePath G_GNUC_UNUSED *path,
@@ -3363,7 +3349,6 @@ unselect_decrypted(GtkTreeModel *model,
}
return FALSE;
}
-#endif
static gboolean
quote_parts_select_dlg(GtkTreeStore *tree_store,
@@ -3415,7 +3400,6 @@ quote_parts_select_dlg(GtkTreeStore *tree_store,
content_box = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
gtk_box_pack_start(content_box, hbox, TRUE, TRUE, 0);
-#ifdef HAVE_GPGME
if (stats->decrypted > 0U) {
GtkWidget *warning;
@@ -3438,7 +3422,6 @@ quote_parts_select_dlg(GtkTreeStore *tree_store,
gtk_widget_set_valign(warning, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(vbox), warning, FALSE, FALSE, 0);
}
-#endif
gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 5);
@@ -3493,7 +3476,6 @@ tree_find_single_part(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
return FALSE;
}
-#ifdef HAVE_GPGME
static void
show_decrypted_warning(GtkWindow *parent)
{
@@ -3517,7 +3499,6 @@ show_decrypted_warning(GtkWindow *parent)
balsa_app.warn_reply_decrypted = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remind_btn));
gtk_widget_destroy(dialog);
}
-#endif
static GString *
collect_for_quote(BalsaSendmsg * bsmsg,
@@ -3552,11 +3533,9 @@ collect_for_quote(BalsaSendmsg * bsmsg,
* we have to search the tree store... */
LibBalsaMessageBody *this_body;
-#ifdef HAVE_GPGME
if ((stats.decrypted > 0U) && balsa_app.warn_reply_decrypted) {
show_decrypted_warning(GTK_WINDOW(bsmsg->window));
}
-#endif
gtk_tree_model_foreach(GTK_TREE_MODEL(tree_store), tree_find_single_part,
&this_body);
if (this_body)
@@ -4287,10 +4266,8 @@ static const BalsaToolbarEntry compose_toolbar[] = {
static const BalsaToolbarEntry compose_toolbar_extras[] = {
{ "postpone", BALSA_PIXMAP_POSTPONE },
{ "request-mdn", BALSA_PIXMAP_REQUEST_MDN },
-#ifdef HAVE_GPGME
{ "sign", BALSA_PIXMAP_GPG_SIGN },
{ "encrypt", BALSA_PIXMAP_GPG_ENCRYPT },
-#endif /* HAVE_GPGME */
{ "edit", "gtk-edit" },
{ "queue", BALSA_PIXMAP_QUEUE }
};
@@ -4372,12 +4349,10 @@ bsm_prepare_for_setup(LibBalsaMessage *message)
/* fill in that info:
* ref the message so that we have all needed headers */
libbalsa_message_body_ref(message, TRUE, TRUE);
-#ifdef HAVE_GPGME
/* scan the message for encrypted parts - this is only possible if
there is *no* other ref to it */
balsa_message_perform_crypto(message, LB_MAILBOX_CHK_CRYPT_NEVER,
TRUE, 1);
-#endif
}
/* libbalsa_message_body_unref() may destroy the @param part - this is
@@ -5045,7 +5020,6 @@ bsmsg2message(BalsaSendmsg * bsmsg)
attachment2message, message);
message->headers->date = time(NULL);
-#ifdef HAVE_GPGME
if (balsa_app.has_openpgp || balsa_app.has_smime) {
message->gpg_mode =
(bsmsg->gpg_mode & LIBBALSA_PROTECT_MODE) != 0 ? bsmsg->gpg_mode : 0;
@@ -5055,7 +5029,6 @@ bsmsg2message(BalsaSendmsg * bsmsg)
message->gpg_mode = 0;
message->att_pubkey = FALSE;
}
-#endif
/* remember the parent window */
g_object_set_data(G_OBJECT(message), "parent-window",
@@ -5156,8 +5129,6 @@ subject_not_empty(BalsaSendmsg * bsmsg)
return response == GTK_RESPONSE_OK;
}
-#ifdef HAVE_GPGME
-
static void
config_dlg_button(GtkDialog *dialog, gint response_id, const gchar *icon_id)
{
@@ -5412,7 +5383,6 @@ check_autocrypt_recommendation(BalsaSendmsg *bsmsg)
return result;
}
#endif /* ENABLE_AUTOCRYPT */
-#endif /* HAVE_GPGME */
/* "send message" menu and toolbar callback.
@@ -5423,9 +5393,7 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
LibBalsaMsgCreateResult result;
LibBalsaMessage *message;
LibBalsaMailbox *fcc;
-#ifdef HAVE_GPGME
GtkTreeIter iter;
-#endif
GError * error = NULL;
if (!bsmsg->ready_to_send)
@@ -5434,7 +5402,6 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
if(!subject_not_empty(bsmsg))
return FALSE;
-#ifdef HAVE_GPGME
#ifdef ENABLE_AUTOCRYPT
if (!check_autocrypt_recommendation(bsmsg)) {
return FALSE;
@@ -5492,17 +5459,14 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
return FALSE;
}
}
-#endif
message = bsmsg2message(bsmsg);
fcc = balsa_find_mailbox_by_url(bsmsg->fcc_url);
-#ifdef HAVE_GPGME
balsa_information_parented(GTK_WINDOW(bsmsg->window),
LIBBALSA_INFORMATION_DEBUG,
_("sending message with GPG mode %d"),
message->gpg_mode);
-#endif
if(queue_only)
result = libbalsa_message_queue(message, balsa_app.outbox, fcc,
@@ -5536,12 +5500,10 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
msg = _("Message could not be saved in sentbox"); break;
case LIBBALSA_MESSAGE_SEND_ERROR:
msg = _("Message could not be sent"); break;
-#ifdef HAVE_GPGME
case LIBBALSA_MESSAGE_SIGN_ERROR:
msg = _("Message could not be signed"); break;
case LIBBALSA_MESSAGE_ENCRYPT_ERROR:
msg = _("Message could not be encrypted"); break;
-#endif
}
if (error)
balsa_information_parented(GTK_WINDOW(bsmsg->window),
@@ -5609,12 +5571,10 @@ message_postpone(BalsaSendmsg * bsmsg)
g_ptr_array_add(headers, g_strdup_printf("%d", bsmsg->req_mdn));
g_ptr_array_add(headers, g_strdup("X-Balsa-DSN"));
g_ptr_array_add(headers, g_strdup_printf("%d", bsmsg->req_dsn));
-#ifdef HAVE_GPGME
g_ptr_array_add(headers, g_strdup("X-Balsa-Crypto"));
g_ptr_array_add(headers, g_strdup_printf("%d", bsmsg->gpg_mode));
g_ptr_array_add(headers, g_strdup("X-Balsa-Att-Pubkey"));
g_ptr_array_add(headers, g_strdup_printf("%d", bsmsg->attach_pubkey));
-#endif
#if HAVE_GSPELL || HAVE_GTKSPELL
if (sw_action_get_active(bsmsg, "spell-check")) {
@@ -6230,7 +6190,6 @@ sw_send_html_change_state(GSimpleAction * action, GVariant * state, gpointer dat
g_simple_action_set_state(action, state);
}
-#ifdef HAVE_GPGME
static void
sw_gpg_helper(GSimpleAction * action,
GVariant * state,
@@ -6299,7 +6258,6 @@ sw_gpg_mode_change_state(GSimpleAction * action,
g_simple_action_set_state(action, state);
}
-#endif /* HAVE_GPGME */
/* init_menus:
@@ -6679,7 +6637,6 @@ sendmsg_window_set_title(BalsaSendmsg * bsmsg)
g_free(title);
}
-#ifdef HAVE_GPGME
static void
bsmsg_update_gpg_ui_on_ident_change(BalsaSendmsg * bsmsg,
LibBalsaIdentity * ident)
@@ -6751,7 +6708,6 @@ bsmsg_setup_gpg_ui_by_mode(BalsaSendmsg *bsmsg, gint mode)
else
g_action_change_state(action, g_variant_new_string("mime"));
}
-#endif /* HAVE_GPGME */
static GActionEntry win_entries[] = {
{"include-file", sw_include_file_activated },
@@ -6801,7 +6757,6 @@ static GActionEntry win_entries[] = {
sw_flowed_change_state },
{"send-html", libbalsa_toggle_activated, NULL, "false",
sw_send_html_change_state },
-#ifdef HAVE_GPGME
{"sign", libbalsa_toggle_activated, NULL, "false",
sw_sign_change_state },
{"encrypt", libbalsa_toggle_activated, NULL, "false",
@@ -6814,7 +6769,6 @@ static GActionEntry win_entries[] = {
sw_gpg_mode_change_state },
{"attpubkey", libbalsa_toggle_activated, NULL, "false",
sw_att_pubkey_change_state },
-#endif /* HAVE_GPGME */
/* Only a toolbar button: */
{"toolbar-send", sw_toolbar_send_activated }
};
@@ -6877,10 +6831,8 @@ sendmsg_window_new()
#if !HAVE_GTKSPELL && !HAVE_GSPELL
bsmsg->spell_checker = NULL;
#endif /* HAVE_GTKSPELL */
-#ifdef HAVE_GPGME
bsmsg->gpg_mode = LIBBALSA_PROTECT_RFC3156;
bsmsg->attach_pubkey = FALSE;
-#endif
bsmsg->autosave_timeout_id = /* autosave every 5 minutes */
g_timeout_add_seconds(60*5, (GSourceFunc)sw_autosave_timeout_cb, bsmsg);
@@ -6950,9 +6902,7 @@ sendmsg_window_new()
sw_action_set_active(bsmsg, "send-html", bsmsg->ident->send_mp_alternative);
sw_action_set_active(bsmsg, "show-toolbar", balsa_app.show_compose_toolbar);
-#ifdef HAVE_GPGME
bsmsg_setup_gpg_ui(bsmsg);
-#endif
/* Paned window for the addresses at the top, and the content at the
* bottom: */
@@ -7195,7 +7145,6 @@ sendmsg_window_continue(LibBalsaMailbox * mailbox, guint msgno)
bsmsg->in_reply_to =
g_strconcat("<", message->in_reply_to->data, ">", NULL);
-#ifdef HAVE_GPGME
if ((postpone_hdr =
libbalsa_message_get_user_header(message, "X-Balsa-Crypto")))
bsmsg_setup_gpg_ui_by_mode(bsmsg, atoi(postpone_hdr));
@@ -7203,7 +7152,6 @@ sendmsg_window_continue(LibBalsaMailbox * mailbox, guint msgno)
if (postpone_hdr != NULL) {
sw_action_set_active(bsmsg, "attpubkey", atoi(postpone_hdr) != 0);
}
-#endif
if ((postpone_hdr =
libbalsa_message_get_user_header(message, "X-Balsa-MDN")))
sw_action_set_active(bsmsg, "request-mdn", atoi(postpone_hdr) != 0);
diff --git a/src/sendmsg-window.h b/src/sendmsg-window.h
index fca1bbbe5..9eafdd8ac 100644
--- a/src/sendmsg-window.h
+++ b/src/sendmsg-window.h
@@ -93,10 +93,8 @@ G_BEGIN_DECLS
gboolean req_dsn; /* send a delivery status notification */
gboolean quit_on_close; /* quit balsa after the compose window */
/* is closed. */
-#ifdef HAVE_GPGME
guint gpg_mode;
gboolean attach_pubkey;
-#endif
#if !HAVE_GTKSOURCEVIEW
GtkTextBuffer *buffer2; /* Undo buffer. */
diff --git a/src/toolbar-factory.c b/src/toolbar-factory.c
index 23b8cb688..f26b29f94 100644
--- a/src/toolbar-factory.c
+++ b/src/toolbar-factory.c
@@ -166,10 +166,8 @@ button_data toolbar_buttons[]={
{BALSA_PIXMAP_SHOW_HEADERS, N_("All\nheaders"), FALSE},
{"gtk-cancel", N_("Reset\nFilter"), FALSE},
{BALSA_PIXMAP_SHOW_PREVIEW, N_("Message Preview"), FALSE},
-#ifdef HAVE_GPGME
{BALSA_PIXMAP_GPG_SIGN, N_("Sign"), FALSE},
{BALSA_PIXMAP_GPG_ENCRYPT, N_("Encrypt"), FALSE},
-#endif
{"edit-undo", N_("Undo"), FALSE},
{"edit-redo", N_("Redo"), FALSE},
{"edit-clear", N_("Expunge"), FALSE},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]