Skip to content

Commit

Permalink
merge: mutt-stable
Browse files Browse the repository at this point in the history
 * Fix IDNA functions for systems without iconv.
 * Fix mutt_protect() when INLINE is set. (closes #3828)
  • Loading branch information
flatcap committed Apr 15, 2016
2 parents aa72ef9 + b259bf9 commit fc12fdf
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Expand Up @@ -33,7 +33,7 @@ mutt_SOURCES = \
rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \
score.c send.c sendlib.c signal.c sort.c \
status.c system.c thread.c charset.c history.c lib.c \
muttlib.c editmsg.c mbyte.c mutt_idna.c \
muttlib.c editmsg.c mbyte.c \
url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c version.c

nodist_mutt_SOURCES = $(BUILT_SOURCES)
Expand All @@ -53,7 +53,7 @@ AM_CPPFLAGS=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(GPGME_CFLAGS) -Iintl
EXTRA_mutt_SOURCES = account.c bcache.c crypt-gpgme.c crypt-mod-pgp-classic.c \
crypt-mod-pgp-gpgme.c crypt-mod-smime-classic.c \
crypt-mod-smime-gpgme.c dotlock.c gnupgparse.c hcache.c md5.c \
mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \
pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \
smime.c smtp.c utf8.c wcwidth.c \
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Expand Up @@ -1202,6 +1202,13 @@ fi # libiconv

dnl -- IDN depends on iconv

dnl mutt_idna.c will perform charset transformations (for smtputf8
dnl support) as long as at least iconv is installed. If there is no
dnl iconv, then it doesn't need to be included in the build.
if test "$am_cv_func_iconv" = yes; then
MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_idna.o"
fi

AC_ARG_WITH(idn, AS_HELP_STRING([--with-idn=@<:@PFX@:>@],[Use GNU libidn for internationalized domain names]),
[
if test "$with_idn" != "no" ; then
Expand Down
3 changes: 3 additions & 0 deletions crypt.c
Expand Up @@ -137,6 +137,9 @@ int mutt_protect (HEADER *msg, char *keylist)
if (!WithCrypto)
return -1;

if (!(msg->security & (ENCRYPT | SIGN)))
return 0;

if ((msg->security & SIGN) && !crypt_valid_passphrase (msg->security))
return (-1);

Expand Down
27 changes: 27 additions & 0 deletions mutt_idna.h
Expand Up @@ -45,13 +45,40 @@
#endif /* HAVE_LIBIDN */


#ifdef HAVE_ICONV
int mutt_addrlist_to_intl (ADDRESS *, char **);
int mutt_addrlist_to_local (ADDRESS *);

void mutt_env_to_local (ENVELOPE *);
int mutt_env_to_intl (ENVELOPE *, char **, char **);

const char *mutt_addr_for_display (ADDRESS *a);
#else
static inline int mutt_addrlist_to_intl (ADDRESS *addr, char **err)
{
return 0;
}

static inline int mutt_addrlist_to_local (ADDRESS *addr)
{
return 0;
}

static inline void mutt_env_to_local (ENVELOPE *env)
{
return;
}

static inline int mutt_env_to_intl (ENVELOPE *env, char **tag, char **err)
{
return 0;
}

static inline const char *mutt_addr_for_display (ADDRESS *a)
{
return a->mailbox;
}
#endif /* HAVE_LIBICONV */


#endif
5 changes: 3 additions & 2 deletions send.c
Expand Up @@ -1723,7 +1723,7 @@ ci_send_message (int flags, /* send mode */

if (WithCrypto)
{
if (msg->security)
if (msg->security & (ENCRYPT | SIGN))
{
/* save the decrypted attachments */
clear_content = msg->content;
Expand Down Expand Up @@ -1787,14 +1787,15 @@ ci_send_message (int flags, /* send mode */
BODY *save_sig = NULL;
BODY *save_parts = NULL;

if (WithCrypto && msg->security && option (OPTFCCCLEAR))
if (WithCrypto && (msg->security & (ENCRYPT | SIGN)) && option (OPTFCCCLEAR))
msg->content = clear_content;

/* check to see if the user wants copies of all attachments */
if (query_quadoption (OPT_FCCATTACH, _("Save attachments in Fcc?")) != M_YES &&
msg->content->type == TYPEMULTIPART)
{
if (WithCrypto
&& (msg->security & (ENCRYPT | SIGN))
&& (mutt_strcmp (msg->content->subtype, "encrypted") == 0 ||
mutt_strcmp (msg->content->subtype, "signed") == 0))
{
Expand Down

0 comments on commit fc12fdf

Please sign in to comment.