diff options
author | Kevin McCarthy <kevin@8t8.us> | 2015-11-24 15:49:28 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2015-11-24 15:49:28 -0800 |
commit | 64fa378e2de09b42aa8812a0e9757446be3b47bf (patch) | |
tree | e3547ff4fab3b26c3b24af3d5de95b9521911d1a /mutt_idna.c | |
parent | 24bab5179e031eb5f66dc3be381dabfca00f7bd0 (diff) |
Add option 'idn_encode'; rename option 'use_idn' to 'idn_decode'.
This is patch 3 of 4 implementing support for SMTPUTF8 (RFC 6531).
Add an option to control whether international domains are encoded with
IDN or not. This defaults to set, for backward compatibility.
Rename the use_idn option to idn_decode, since that more properly
reflects its purpose.
Diffstat (limited to 'mutt_idna.c')
-rw-r--r-- | mutt_idna.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mutt_idna.c b/mutt_idna.c index 04a7c4ca..03b1dd82 100644 --- a/mutt_idna.c +++ b/mutt_idna.c @@ -104,7 +104,7 @@ static char *intl_to_local (ADDRESS *a, int flags) #ifdef HAVE_LIBIDN is_idn_encoded = check_idn (domain); - if (is_idn_encoded && option (OPTUSEIDN)) + if (is_idn_encoded && option (OPTIDNDECODE)) { if (idna_to_unicode_8z8z (domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS) goto cleanup; @@ -141,7 +141,7 @@ static char *intl_to_local (ADDRESS *a, int flags) * produce a non-matching domain! Thus we only want to do the * idna_to_ascii_8z() if the original domain was IDNA encoded. */ - if (is_idn_encoded && option (OPTUSEIDN)) + if (is_idn_encoded && option (OPTIDNDECODE)) { if (idna_to_ascii_8z (reversed_domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS) { @@ -191,9 +191,12 @@ static char *local_to_intl (ADDRESS *a) goto cleanup; #ifdef HAVE_LIBIDN - if (idna_to_ascii_8z (domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS) - goto cleanup; - mutt_str_replace (&domain, tmp); + if (option (OPTIDNENCODE)) + { + if (idna_to_ascii_8z (domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS) + goto cleanup; + mutt_str_replace (&domain, tmp); + } #endif /* HAVE_LIBIDN */ mailbox = safe_malloc (mutt_strlen (user) + mutt_strlen (domain) + 2); |