The following script uses the VRFY function of the SMTP standard to check the validity of e-mail addresses.

You need to specify at least the server you want to query and the email address. You can also specify a file with a list of email addresses and the script will iterate over it checking each of them.

The code is available on GitHub.

https://github.com/aci686/Python-VRFY-Script/blob/main/vrfy.py