jmail
jmail copied to clipboard
domain valition error while validating using mx records(JMail.validator().requireValidMXRecord();)
Is this bug report about an incorrectly validated email address?
- [x] Yes
If yes, what is the email address? [email protected]
- [x] Invalid
If no, please describe the bug
Additional context
I have added JMail into my project And I have passed a email address ([email protected]) which I have validated in my project using ( JMail.validator().requireValidMXRecord(); ) is giving me out put false which means it is invalid .but while I am using (https://www.rohannagar.com/jmail/) it is showing it as valid email address
Hi @sai-ram-1661, thank you very much for the bug report. I am also seeing this behavior (invalid locally but valid with the online validator).
Unfortunately validating based on the domain having a valid MX record can be a little dependent on the system that JMail is being run on since it uses the local DNS resolver to determine if there is an MX record.
Can you tell me what you expect for this email address? Do you expect it to be valid or invalid?
Hi @sai-ram-1661 I finally figured out this mystery!
It turns out that the gmail.co
domain has a null MX record (which means the domain has specifically marked the domain as one that cannot accept mail).
There was a bug related to this in JMail that was addressed in November 2023 that fixed the issue (see #191). It seems like this code never got deployed to the backend that the online validator uses!
I just deployed the latest version of JMail and I now see that the online validator at https://www.rohannagar.com/jmail/ correctly shows [email protected]
as invalid (see screenshot).
Thanks so much for reporting this and sorry for the super long delay in figuring this out!