X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/63720cfa82319c427f2c869c51a86b64fada9ad8..fa1c8faf169384bebaa8d172f491574c45ae2aa4:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index 1d0ddec2a..9a88d38ca 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1804,20 +1804,19 @@ return g; /* A recipients list is available only during system message filtering, during ACL processing after DATA, and while expanding pipe commands generated from a system filter, but not elsewhere. Note that this does -not check for comman in the elements, and uses comma-space as seperator - +not check for commas in the elements, and uses comma-space as seperator - so cannot be used as an exim list as-is. */ static uschar * fn_recipients(void) { -uschar * s; gstring * g = NULL; if (!f.enable_dollar_recipients) return NULL; for (int i = 0; i < recipients_count; i++) { - s = recipients_list[i].address; + const uschar * s = recipients_list[i].address; g = string_append2_listele_n(g, US", ", s, Ustrlen(s)); } gstring_release_unused(g); @@ -2763,9 +2762,17 @@ switch(cond_type = identify_operator(&s, &opname)) case ECOND_ISIP: case ECOND_ISIP4: case ECOND_ISIP6: - rc = string_is_ip_address(sub[0], NULL); - *yield = ((cond_type == ECOND_ISIP)? (rc != 0) : - (cond_type == ECOND_ISIP4)? (rc == 4) : (rc == 6)) == testfor; + { + const uschar *errp; + const uschar **errpp; + DEBUG(D_expand) errpp = &errp; else errpp = 0; + if (0 == (rc = string_is_ip_addressX(sub[0], NULL, errpp))) + DEBUG(D_expand) debug_printf("failed: %s\n", errp); + + *yield = ( cond_type == ECOND_ISIP ? rc != 0 : + cond_type == ECOND_ISIP4 ? rc == 4 : rc == 6) == testfor; + } + break; /* Various authentication tests - all optionally compiled */