email-verifier icon indicating copy to clipboard operation
email-verifier copied to clipboard

Option to Enable/Disable MX Records Check

Open fabl3ss opened this issue 2 years ago • 1 comments

We encountered an issue with the CheckMX functionality as it currently lacks a configurable option for disabling this check. It would be highly beneficial to have a similar functionality to that of CheckSMTP, which already implements an option to enable or disable SMTP checks using a bool variable:

func (v *Verifier) CheckSMTP(domain, username string) (*SMTP, error) {
    if !v.smtpCheckEnabled {
        return nil, nil
    }
    // ...
}

To address this limitation, I propose introducing a new field specifically for enabling or disabling MX checks in the Verifier. This approach would align with the existing implementation in CheckSMTP.

For example, the modified code snippet could look like this:

func (v *Verifier) CheckMX(domain string) (*Mx, error) {
    if !v.mxCheckEnabled {
        return nil, nil
    }
    // ...
}

I think it makes sense to set mxCheckEnabled value to true by default, so it won't change current behavior.

I am enthusiastic about contributing to this enhancement if my proposal aligns with your vision.

fabl3ss avatar May 30 '23 15:05 fabl3ss

Hi @fabl3ss Thanks for the business scenarios and suggestions you mentioned, your suggestions are very useful! Feel free to PR 😃

lryong avatar Jun 09 '23 05:06 lryong