diff options
author | Phil Pennock <pdp@exim.org> | 2011-02-13 00:19:26 -0500 |
---|---|---|
committer | Phil Pennock <pdp@exim.org> | 2011-02-13 00:19:26 -0500 |
commit | 76aa570c217ad2fad1e73fb91e2aa39ce5e3c4ff (patch) | |
tree | 73145e4fc8512d46d513dc0bade79a799715433a /src | |
parent | 2fe767453007d1b015f52313d16dc61635085621 (diff) |
Don't reveal SQL expansion failure details in SMTP.
fixes bug 1061
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 14 | ||||
-rw-r--r-- | src/src/route.c | 16 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c index 807f03817..41e4a66f3 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -744,17 +744,15 @@ malformed, it won't ever have gone near LDAP.) */ if (addr->message != NULL) { addr->message = string_printing(addr->message); - if (Ustrstr(addr->message, "failed to expand") != NULL && - (Ustrstr(addr->message, "ldap:") != NULL || + if (((Ustrstr(addr->message, "failed to expand") != NULL) || (Ustrstr(addr->message, "expansion of ") != NULL)) && + (Ustrstr(addr->message, "mysql") != NULL || + Ustrstr(addr->message, "pgsql") != NULL || + Ustrstr(addr->message, "sqlite") != NULL || + Ustrstr(addr->message, "ldap:") != NULL || Ustrstr(addr->message, "ldapdn:") != NULL || Ustrstr(addr->message, "ldapm:") != NULL)) { - uschar *p = Ustrstr(addr->message, "pass="); - if (p != NULL) - { - p += 5; - while (*p != 0 && !isspace(*p)) *p++ = 'x'; - } + addr->message = string_sprintf("Temporary internal error"); } } diff --git a/src/src/route.c b/src/src/route.c index 324de2ab8..346a7c6a7 100644 --- a/src/src/route.c +++ b/src/src/route.c @@ -1952,6 +1952,22 @@ if (unseen && r->next != NULL) /* Unset the address expansions, and return the final result. */ ROUTE_EXIT: +if (yield == DEFER) { + if ( + ((Ustrstr(addr->message, "failed to expand") != NULL) || (Ustrstr(addr->message, "expansion of ") != NULL)) && + ( + Ustrstr(addr->message, "mysql") != NULL || + Ustrstr(addr->message, "pgsql") != NULL || + Ustrstr(addr->message, "sqlite") != NULL || + Ustrstr(addr->message, "ldap:") != NULL || + Ustrstr(addr->message, "ldapdn:") != NULL || + Ustrstr(addr->message, "ldapm:") != NULL + ) + ) { + addr->message = string_sprintf("Temporary internal error"); + } +} + deliver_set_expansions(NULL); disable_logging = FALSE; return yield; |