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.22k stars 324 forks source link

GMAIL api validation with smtp not working #1437

Closed z3d3m0n closed 5 months ago

z3d3m0n commented 5 months ago

Email to check

driveapplication2017@gmail.com

From where did you run check-if-email-exists?

ovh

Version of check-if-email-exists (if running it yourself)

0.5.0

What happened?

Hello, i have tried the new 0.5.0 version when trying to validate gmail and googlemail i get invalid results the gmail validation is using "gmail_verify_method": "Api", as default ? i try to pass the setting "gmail_verify_method": "Smtp", to bulk but got the same results the smtp method is not supported anymore ?

**single**   
curl -X POST \
    -H'Content-Type: application/json' \
    -d'{"to_email":"driveapplication2017@gmail.com"}' \
    http://IP:8080/v0/check_email

**and bulk**

`{
    // Required fields:
    "input": [                          // Endpoint accepts a list of emails.
        "driveapplication2017@gmail.com",
        "somename1@gmail.com",
    ],

    // All fields below are optional:
    "proxy": {
        "host": "my.proxy.com",
        "port": "9080",
        "username": "user",             // Optional authentication for proxy.
        "password": "pass",
    },
    "hello_name": "my.domain.com",      // The value to use in the EHLO handshake.
    "from_email": "me@my.domain.com",   // The value to use in the MAIL FROM command.
    "from_email": "me@my.domain.com",   // The value to use in the MAIL FROM command.
}`

Relevant log output

2024-01-22T09:24:32.231760Z  INFO reacher: Done check email="driveapplication2017@gmail.com" is_reachable=Invalid

Debug

2024-01-22T10:57:17.178725Z DEBUG hyper::proto::h1::conn: incoming body is content-length (45 bytes)
2024-01-22T10:57:17.178750Z DEBUG hyper::proto::h1::conn: incoming body completed
2024-01-22T10:57:17.178868Z DEBUG reacher: [email=driveapplication2017@gmail.com] Checking email "driveapplication2017@gmail.com"    
2024-01-22T10:57:17.179727Z DEBUG reacher: [email=driveapplication2017@gmail.com] Found the following syntax validation: SyntaxDetails { address: Some(EmailAddress("driveapplication2017@gmail.com")), domain: "gmail.com", is_valid_syntax: true, username: "driveapplication2017", normalized_email: Some("driveapplication2017@gmail.com"), suggestion: None }    
2024-01-22T10:57:17.180022Z DEBUG hickory_proto::xfer::dns_handle: querying: gmail.com MX
2024-01-22T10:57:17.180101Z DEBUG hickory_resolver::name_server::name_server_pool: sending request: [Query { name: Name("gmail.com"), query_type: MX, query_class: IN }]
2024-01-22T10:57:17.180131Z DEBUG hickory_resolver::name_server::name_server: reconnecting: NameServerConfig { socket_addr: 127.0.0.53:53, protocol: Udp, tls_dns_name: None, trust_negative_responses: false, bind_addr: None }
2024-01-22T10:57:17.180160Z DEBUG hickory_proto::xfer: enqueueing message:QUERY:[Query { name: Name("gmail.com"), query_type: MX, query_class: IN }]
2024-01-22T10:57:17.180194Z DEBUG hickory_proto::udp::udp_client_stream: final message: ; header 51416:QUERY:RD:NoError:QUERY:0/0/0
; query
;; gmail.com. IN MX

2024-01-22T10:57:17.180264Z DEBUG hickory_proto::udp::udp_stream: created socket successfully
2024-01-22T10:57:17.180739Z DEBUG hickory_proto::udp::udp_client_stream: received message id: 51416
2024-01-22T10:57:17.180765Z DEBUG hickory_resolver::error: Response:; header 51416:RESPONSE:RD,RA:NoError:QUERY:5/0/0
; query
;; gmail.com. IN MX
; answers 5
gmail.com. 1757 IN MX 40 alt4.gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 20 alt2.gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 10 alt1.gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 5 gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 30 alt3.gmail-smtp-in.l.google.com.
; nameservers 0
; additionals 0

2024-01-22T10:57:17.180805Z DEBUG hickory_resolver::error: Response:; header 51416:RESPONSE:RD,RA:NoError:QUERY:5/0/0
; query
;; gmail.com. IN MX
; answers 5
gmail.com. 1757 IN MX 40 alt4.gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 20 alt2.gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 10 alt1.gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 5 gmail-smtp-in.l.google.com.
gmail.com. 1757 IN MX 30 alt3.gmail-smtp-in.l.google.com.
; nameservers 0
; additionals 0

2024-01-22T10:57:17.180947Z DEBUG reacher: [email=driveapplication2017@gmail.com] Found the following MX hosts: ["40 alt4.gmail-smtp-in.l.google.com.", "20 alt2.gmail-smtp-in.l.google.com.", "10 alt1.gmail-smtp-in.l.google.com.", "5 gmail-smtp-in.l.google.com.", "30 alt3.gmail-smtp-in.l.google.com."]    
2024-01-22T10:57:17.181219Z DEBUG reacher: [email=driveapplication2017@gmail.com] Found the following misc details: MiscDetails { is_disposable: false, is_role_account: false, gravatar_url: None, haveibeenpwned: None }    
2024-01-22T10:57:17.201156Z DEBUG reqwest::connect: starting new connection: https://mail.google.com/    
2024-01-22T10:57:17.201342Z DEBUG hickory_proto::xfer::dns_exchange: io_stream is done, shutting down
2024-01-22T10:57:17.201440Z DEBUG hyper::client::connect::dns: resolving host="mail.google.com"
2024-01-22T10:57:17.211706Z DEBUG hyper::client::connect::http: connecting to 216.58.204.69:443
2024-01-22T10:57:17.220976Z DEBUG hyper::client::connect::http: connected to 216.58.204.69:443
2024-01-22T10:57:17.237746Z DEBUG hyper::proto::h1::io: flushed 103 bytes
2024-01-22T10:57:17.520025Z DEBUG hyper::proto::h1::io: parsed 6 headers
2024-01-22T10:57:17.520049Z DEBUG hyper::proto::h1::conn: incoming body is empty
2024-01-22T10:57:17.520111Z DEBUG hyper::client::pool: pooling idle connection for ("https", mail.google.com)
2024-01-22T10:57:17.520157Z DEBUG reacher: [email=driveapplication2017@gmail.com] gmail response: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("mail.google.com")), port: None, path: "/mail/gxlu", query: Some("email=driveapplication2017%40gmail.com"), fragment: None }, status: 204, headers: {"cache-control": "no-cache, no-store, max-age=0, must-revalidate", "pragma": "no-cache", "expires": "Mon, 01 Jan 1990 00:00:00 GMT", "date": "Mon, 22 Jan 2024 10:57:17 GMT", "server": "GSE", "alt-svc": "clear"} }
amaury1093 commented 5 months ago

I also saw the same error, see https://github.com/reacherhq/check-if-email-exists/issues/1431. So I defaulted to SMTP in 8e79884314f0c1eec5a7964fa686e2c60e7d2209.

0.5.0 isn't patched, but I can create a 0.5.1 with default to SMTP. Would that help?

z3d3m0n commented 5 months ago

Hey, no need , will try the 0.6.0 thx

z3d3m0n commented 5 months ago

Hey @amaury1093 ,

when i try to run any docker from rep https://hub.docker.com/r/reacherhq/backend/tags v0.7.0-beta.2 v0.7.0-beta.1 v0.6.0-beta.2 eg: reacherhq/backend:v0.7.0-beta.1

i am not able to start them

docker ps ( always restarting ) 791543b7160f reacherhq/backend:v0.7.0-beta.1 "./docker.sh" 4 minutes ago Restarting (1) 3 seconds ago reacher_backend

in the log i see

2024-01-22T12:17:41.410927374Z 2024-01-22T12:17:41.410834Z ERROR lapin::io_loop: error doing IO error=IOError(Custom { kind: Other, error: "A Tokio 1.x context was found, but it is being shutdown." })
2024-01-22T12:17:41.410999920Z 2024-01-22T12:17:41.410951Z ERROR lapin::channels: Connection error error=IO error: A Tokio 1.x context was found, but it is being shutdown.

the latest version i can run from docker is v0.5.0

please advise thank you

z3d3m0n commented 5 months ago

or if you could patch the 0.5.0 if its more simple for you thx

amaury1093 commented 5 months ago

0.5.1 published on Docker: https://hub.docker.com/r/reacherhq/backend/tags

I'll close this issue, and let's track #1431. Unless of course the docker image is also not working, in which case I can re-open.