/**************************************************/
/* Domain conversions */
+/* the *err string pointer should be null before the call */
uschar *
string_domain_utf8_to_alabel(const uschar * utf8, uschar ** err)
uschar * s1;
uschar * s;
int rc;
+
if ( (rc = idna_to_unicode_8z8z(CCS alabel, CSS &s1, IDNA_USE_STD3_ASCII_RULES))
!= IDNA_SUCCESS)
{
/**************************************************/
/* localpart conversions */
+/* the *err string pointer should be null before the call */
uschar *
}
+/**************************************************/
+/* whole address conversion */
+/* the *err string pointer should be null before the call */
+
+uschar *
+string_address_utf8_to_alabel(const uschar * utf8, uschar ** err)
+{
+const uschar * s;
+uschar * l;
+uschar * d;
+
+for (s = utf8; *s; s++)
+ if (*s == '@')
+ {
+ l = string_copyn(utf8, s - utf8);
+ return (l = string_localpart_utf8_to_alabel(l, err), err && *err)
+ || (d = string_domain_utf8_to_alabel(++s, err), err && *err)
+ ? NULL
+ : string_sprintf("%s@%s", l, d);
+ }
+return string_localpart_utf8_to_alabel(utf8, err);
+}
+
+
+
/*************************************************
* Report the library versions. *
*************************************************/