reacherhq / check-if-email-exists

Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.
https://reacher.email
Other
4.34k stars 340 forks source link

'index out of bounds' error when checking @ok.de emails #1288

Closed GitFrol closed 1 year ago

GitFrol commented 1 year ago

Email Provider

ok.de

What happened?

Hi. Noticed interesting behaviour, service faces this error when checking addressed from domain @ok.de. The log is below, I replaced real email address with ***.

Relevant log output

[2023-03-20T11:57:01Z DEBUG reacher] [email=***@ok.de] Checking email "***@ok.de"
[2023-03-20T11:57:01Z DEBUG reacher] [email=***@ok.de] Found the following syntax validation: SyntaxDetails { address: Some(EmailAddress("***@ok.de")), domain: "ok.de", is_valid_syntax: true, username: "***", normalized_email: Some("***@ok.de"), suggestion: None }
[2023-03-20T11:57:01Z DEBUG trust_dns_proto::xfer::dns_handle] querying: ok.de MX
[2023-03-20T11:57:01Z DEBUG trust_dns_resolver::name_server::name_server_pool] sending request: [Query { name: Name("ok.de"), query_type: MX, query_class: IN }]
[2023-03-20T11:57:01Z DEBUG trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: 127.0.0.11:53, protocol: Udp, tls_dns_name: None, trust_nx_responses: false, bind_addr: None }
[2023-03-20T11:57:01Z DEBUG trust_dns_proto::xfer] enqueueing message: [Query { name: Name("ok.de"), query_type: MX, query_class: IN }]
[2023-03-20T11:57:01Z DEBUG trust_dns_proto::udp::udp_stream] created socket successfully
[2023-03-20T11:57:01Z DEBUG trust_dns_proto::udp::udp_client_stream] received message id: 33801
[2023-03-20T11:57:01Z DEBUG trust_dns_resolver::error] Response:33801:RD,RA:NoError:4/0/0
[2023-03-20T11:57:01Z DEBUG trust_dns_resolver::error] Response:33801:RD,RA:NoError:4/0/0
[2023-03-20T11:57:01Z DEBUG reacher] [email=***@ok.de] Found the following MX hosts: ["10 mx2-eu.spamexperts.com.", "20 mx1-eu.spamexperts.com.", "30 mx3-eu.spamexperts.com.", "40 mx4-eu.spamexperts.com."]
[2023-03-20T11:57:01Z DEBUG trust_dns_proto::xfer::dns_exchange] io_stream is done, shutting down
[2023-03-20T11:57:01Z DEBUG reacher] [email=***@ok.de] Found the following misc details: MiscDetails { is_disposable: false, is_role_account: false, gravatar_url: None }
thread 'tokio-runtime-worker' panicked at 'index out of bounds: the len is 0 but the index is 18446744073709551615', /usr/src/reacher/core/src/lib.rs:209:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
   2: core::panicking::panic_bounds_check
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:147:5
   3: check_if_email_exists::check_email::{{closure}}
   4: <warp::filter::and_then::AndThenFuture<T,F> as core::future::future::Future>::poll
   5: <warp::filters::log::internal::WithLogFuture<FN,F> as core::future::future::Future>::poll
   6: <warp::filter::or::EitherFuture<T,U> as core::future::future::Future>::poll
   7: <warp::filter::recover::RecoverFuture<T,F> as core::future::future::Future>::poll
   8: hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
   9: hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_catch
  10: <hyper::server::conn::upgrades::UpgradeableConnection<I,S,E> as core::future::future::Future>::poll
  11: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  12: tokio::runtime::task::core::Core<T,S>::poll
  13: tokio::runtime::task::harness::Harness<T,S>::poll
  14: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  15: tokio::runtime::scheduler::multi_thread::worker::Context::run
  16: tokio::macros::scoped_tls::ScopedKey<T>::set
  17: tokio::runtime::scheduler::multi_thread::worker::run
  18: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  19: tokio::runtime::task::core::Core<T,S>::poll
  20: tokio::runtime::task::harness::Harness<T,S>::poll
  21: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
amaury1093 commented 1 year ago

Thanks for the detailed logs. Which version of check-if-email-exists are you using?

GitFrol commented 1 year ago

Sorry, I forgot to mention it. I'm using the latest version of docker image (reacherhq/backend:latest) DIGEST:sha256:9d39357dda465e4dd04baa222b65ab0c90bcae7e6e0fc9461a4278e17d2b0b3c

yaiqsa commented 1 year ago

I have exactly the same issue with *@ja.nl addresses.

RUST_BACKTRACE=1 RUST_LOG=debug ./check_if_email_exists --from-email me@domain.tld --hello-name smtp.domain.tld test@ja.nl
[2023-09-21T14:58:14Z DEBUG reacher] [email=test@ja.nl] Checking email "test@ja.nl"
[2023-09-21T14:58:14Z DEBUG reacher] [email=test@ja.nl] Found the following syntax validation: SyntaxDetails { address: Some(EmailAddress("test@ja.nl")), domain: "ja.nl", is_valid_syntax: true, username: "test", normalized_email: Some("test@ja.nl"), suggestion: None }
[2023-09-21T14:58:14Z DEBUG trust_dns_proto::xfer::dns_handle] querying: ja.nl MX
[2023-09-21T14:58:14Z DEBUG trust_dns_resolver::name_server::name_server_pool] sending request: [Query { name: Name("ja.nl"), query_type: MX, query_class: IN }]
[2023-09-21T14:58:14Z DEBUG trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: 127.0.0.53:53, protocol: Udp, tls_dns_name: None, trust_nx_responses: false, bind_addr: None }
[2023-09-21T14:58:14Z DEBUG trust_dns_proto::xfer] enqueueing message: [Query { name: Name("ja.nl"), query_type: MX, query_class: IN }]
[2023-09-21T14:58:14Z DEBUG trust_dns_proto::udp::udp_stream] created socket successfully
[2023-09-21T14:58:14Z DEBUG trust_dns_proto::udp::udp_client_stream] received message id: 8803
[2023-09-21T14:58:14Z DEBUG trust_dns_resolver::error] Response:8803:RD,RA:NoError:3/0/3
[2023-09-21T14:58:14Z DEBUG trust_dns_resolver::error] Response:8803:RD,RA:NoError:3/0/3
[2023-09-21T14:58:14Z DEBUG reacher] [email=test@ja.nl] Found the following MX hosts: ["10 filter10.antispamcloud.com.", "20 filter20.antispamcloud.com.", "30 filter30.antispamcloud.com."]
[2023-09-21T14:58:14Z DEBUG reacher] [email=test@ja.nl] Found the following misc details: MiscDetails { is_disposable: false, is_role_account: true, gravatar_url: None, haveibeenpwned: None }
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 18446744073709551615', PATH/check-if-email-exists/core/src/lib.rs:215:9
stack backtrace:
[2023-09-21T14:58:14Z DEBUG trust_dns_proto::xfer::dns_exchange] io_stream is done, shutting down
   0: rust_begin_unwind
             at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/panicking.rs:65:14
   2: core::panicking::panic_bounds_check
             at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/panicking.rs:151:5
   3: check_if_email_exists::check_email::{{closure}}
   4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   5: tokio::runtime::park::CachedParkThread::block_on
   6: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
   7: tokio::runtime::runtime::Runtime::block_on
   8: check_if_email_exists::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I'm running check-if-email-exists-cli 0.9.1 on Ubuntu 22.04.3

Can I do something to help you resolve the issue?

amaury1093 commented 1 year ago

Fixed by #1337