core icon indicating copy to clipboard operation
core copied to clipboard

provider-info for invalid email address "tt" returns "gmail"

Open r10s opened this issue 4 years ago • 4 comments

entering tt as the email address on login shows the provider-information for google.

entering rr or ss or ttt returns no provider-information as expected.

i first encountered that behavior on ios and thought it was a ui-bug, but it is the same for android using core52:

desktop using core50 does not have that issue, probably as MX-lookup was added later.

EDIT: investigate a bit more: the function dc_provider_new_from_email() takes an email-address which is passed to rust's provider::get_provider_info() which wants a domain and states that the email-address is only accepted for "compatibility reasons" - therefore, the function does not check for an email address and treats tt as the domain.

for whatever reason, resolver.mx_lookup() returns gmail for that tt domain. but also the corresponding command tool says so,

> nslookup -q=MX tt
Server:		192.168.178.1
Address:	192.168.178.1#53

Non-authoritative answer:
tt	mail exchanger = 10 ALT1.ASPMX.L.GOOGLE.COM.
tt	mail exchanger = 1 ASPMX.L.GOOGLE.COM.

first thought that is my wifi, but also online tools return that result.

might be tt is actually a valid fqdn ...

but anyway, maybe the fix is just to check that the parameter given to dc_provider_new_from_email() is actually an email address (contains a @) - either by changing get_provider_info() or by adding a dedicated function.

r10s avatar Apr 15 '21 14:04 r10s

Just tried it now, Delta Chat on Android is completely freezed for some time and then says to give a valid email address. My DNS also does not give MX answer for tt, seems to be something with your DNS configuration.

Update: it shows the gmail note after that, hmm.

link2xt avatar Dec 06 '21 05:12 link2xt

If I query via 8.8.8.8 or 1.1.1.1, it returns MX record:

$ dig MX @8.8.8.8 tt
$ dig MX @1.1.1.1 tt

Delta Chat core uses 8.8.8.8 too.

link2xt avatar Dec 06 '21 05:12 link2xt

The solution is probably not to query for MX record if a valid address with @ is not entered.

link2xt avatar Dec 06 '21 05:12 link2xt

I think we should set a timeout for the mx lookup and instead of returning fire an event with the result string/json. We just disabled provider info on desktop as it's causing too much trouble here. And such a bug is really critical as user face it in their first minute of using deltachat.

Jikstra avatar Mar 03 '22 20:03 Jikstra

Made a fix: #4747

link2xt avatar Sep 25 '23 14:09 link2xt