SMTP is not intended to provide the ability to verify mailbox availability.
When delivering e-mail, the following steps are usually taken:
Check MX record of mail domain
The somebody@example.com message will check for MX records for example.com . If there are some, the highest priority will be contacted to receive mail. If it does not respond, any existing MX with lower priority will be linked.
If there is no MX record, an example.com record “A” will be searched and this IP will be connected to receive mail.
Connecting to the server specified in the MX or A record
Accesses the receiving mail server. If it exists, MIGHT mail will be delivered. SMTP requires the sending mail server to send the receiving mail address, the sending mail address, and then the mailing address itself.
The receiving mail server is trying to deliver mail to the users mailbox
This may be unsuccessful for several reasons. And the important information is that this step can take place AFTER the sending mail server received a positive response that the mail was received and the connection was terminated. Therefore, the sending mail server cannot understand that the delivery failed.
The receiving mail server will send a rejection message in this case. But this fail-safe mail is sent to the mailing address, which is designed to receive errors. This may be the original mailing address, but it may be different. In addition, the responsible mail server for rejection should not be the server that sent the original mail.
At this point, it should be pretty clear that email is indeed an asynchronous means of exchanging information with virtually no reliable built-in function.
Some methods make this possible, although they hope for minor improvements: usually sending out message failures is not a good idea. Well-configured mail servers reject mail for mailboxes that have any problems, for example, they do not exist or are full.
On the other hand, a new big black hole for mail are spam filters. Usually they are user-configured, and the mail server is happy to receive any mail for an existing mailbox, but then the spam is automatically deleted or moved to the spam folder and ignored.
In addition, there is a technology such as greylisting that responds to any attempt to deliver mail with a temporary failure state. The regular mail server will try at a later time, and eventually the greylisting timer is completed (maybe more than an hour in some settings), and a REAL delivery attempt is made with a real final rejection or acceptance. Meanwhile, the mail server hopes that it has turned on spam filters to detect new waves of spam, and greylisting really only buys some time. Any regular delivery attempt by known mail servers will be executed instantly, because successful mail delivery without spam becomes white.
After all the description of how real mail works, I think you can see that there really is no way to “simply” determine if the mail address really exists. The only thing you can do is try to determine if it exists, and if you are pleasantly told that the mailbox does not exist, because the destination mail server is refusing delivery, you can assume that you probably should not try to deliver anymore mail for this purpose.
Any other result says nothing. And you will also notice that detecting whether a mailing address exists requires you to send a catch message-22.
You really need to implement proper rollback management and delivery failure detection to remove the obvious missing email addresses. Everything else is undetectable.