Which method to check if string index is queal to character.

Bischoop Bischoop at vimart.net
Wed Dec 30 18:20:08 EST 2020


On 2020-12-29, jak <nospam at please.ty> wrote:
>
> you could try this way:
>
> # -----------
> from dns import resolver as dns
>
> emails=['john.doe at fakeserver.bah',
>          'john.doe at gmail.com']
>
> for ue in emails:
>      try:
>          mxl = dns.resolve(ue.split('@')[1], 'MX')
>      except:
>          print(f'{ue}: bad mail server')
>      else:
>          if len(mxl) > 0:
>              print(f'{ue}: valid mail server')
> # -----------
>
> ... so, having verified the sever, you should only worry about the name.

I actually have tried, that's good idea.

--
Thanks


More information about the Python-list mailing list