Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

To be is to program.


devel / comp.lang.python / Re: Checking if email is valid

SubjectAuthor
o Re: Checking if email is validGrant Edwards

1
Re: Checking if email is valid

<mailman.109.1698872905.3828.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24282&group=comp.lang.python#24282

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b....@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: Checking if email is valid
Date: Wed, 01 Nov 2023 14:08:20 -0700 (PDT)
Lines: 25
Message-ID: <mailman.109.1698872905.3828.python-list@python.org>
References: 6LdqaeKq-OvcrilFYqqT5tc9LsvSqHRKDYMGaBXzlVzyOdX9Ae0Xp_ACtg=
@protonmail.com>
<6542be44.050a0220.e7b44.2143@mx.google.com>
X-Trace: news.uni-berlin.de I2REbppEuiWuxmjvjcugmQe/X11k9jC3/hs0ovl6Zy4A==
Cancel-Lock: sha1:wyBwC43v4EgSzX1dqkKIu8+Jymw= sha256:pL62RM259L+9gQ3/R5LuvA+zcq8qU7xIHm7TFGleT6Q=
Return-Path: <grant.b.edwards@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=Z9+e4OzJ;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.076
X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'please?': 0.07; 'string':
0.07; 'regex': 0.09; 'corresponds': 0.16;
'from:addr:grant.b.edwards': 0.16; 'from:name:grant edwards':
0.16; 'simon': 0.16; 'sounds': 0.16; 'wrote:': 0.16; 'it?': 0.19;
'to:addr:python-list': 0.20; "i've": 0.22; 'idea': 0.24;
'anything': 0.25; 'party': 0.26; 'header:User-Agent:1': 0.30;
'python-list': 0.32; 'but': 0.32; "i'm": 0.33; 'server': 0.33;
'someone': 0.34; 'received:google.com': 0.34; 'trying': 0.35;
'question.': 0.35; 'from:addr:gmail.com': 0.35; 'possibly': 0.36;
'using': 0.37; "it's": 0.37; 'could': 0.38; 'least': 0.39;
'valid': 0.39; 'services.': 0.39; 'define': 0.40; 'want': 0.40;
'e-mail,': 0.61; 'e-mail': 0.61; 'email': 0.63; 'send': 0.63;
'your': 0.64; 'required': 0.65; 'bad': 0.67; 'right': 0.68;
"you'll": 0.73; 'unit': 0.81; 'wasting': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1698872901; x=1699477701; darn=python.org;
h=to:user-agent:references:subject:from:date:message-id:from:to:cc
:subject:date:message-id:reply-to;
bh=ppnZJJ9kWPEjk1FpIJbxpppJigNjG+fw6FD1mp3mepc=;
b=Z9+e4OzJEQJxHKM5U+VRd1eKK0GchvY+JZsd8XPj37QKh4boM8Qi0BW93FGK1dWr+5
A/p8+fObKEhrmG0Gh5BQNvW/0s0EM6Lncfu4rUKqtu0cVeLpGIwMRhTdLYaoe2l+Tpyb
xRb+9s1ZwtNPFGD6rMihCgEcl7x04M7WVLSmg7qNU6Zn846n9ev6CoXUHM/aGSciTRYs
3AjUoDCT09xhnnQBdI6/nuFntHcGbOeSAOi893jmvUU3w89278+2AyHkhtM7bBP8SRqF
FgZUtpOhBeSrewKvvO4NWs5Ztu7aBcM6AKclOQyJAiP4mHUR0fAEOT5qI/ufDmYeY3en
FAng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1698872901; x=1699477701;
h=to:user-agent:references:subject:from:date:message-id
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=ppnZJJ9kWPEjk1FpIJbxpppJigNjG+fw6FD1mp3mepc=;
b=gviYMGsvgXzr2w7p6f2Su5YNQz/bCPFOv2pGRHqSclpE7haX8dK++j3weDlbb4jyY8
znM0hzTLE99Dl4psclXdCuDtY3oNUIU4hxkesZH567TiAg1zo/0Lu1FENLFeXxOC9U1n
R61FPpaEgYld8L8DvJIDWqHNkw5Nzpu8xBs9ZEiHWYx0LHsM/Pg/gD8QnnN2r9cgJ6A4
+ayoMhKuXNDYoUWcKP2HpLScVqFd/pc1e3WJxT/orAvbZhZ4xvEyZx+Re4SErj8PWxD5
EMdyFrPswYfvQqQUITcYBUZWb/1BwvlieKZzN+T6bgwU4c6FATTP/vxAwykwzL5gCmJp
LBKQ==
X-Gm-Message-State: AOJu0YwoIhIjsr7J6u+lMmxFosJSYpWNAfQlWXnmKSuFoACjqt7h/Z+c
SYBRlGa+Gp0WUslLcnsGQImhi7K61t4=
X-Google-Smtp-Source: AGHT+IH2fHzBRqRsIay1T/MfM313lKLvEOcIfRTbfrnU/PDOMB/0cLp11276hiE0XjQoB8RuB97AZQ==
X-Received: by 2002:a05:6602:2cd4:b0:791:385c:f8b0 with SMTP id
j20-20020a0566022cd400b00791385cf8b0mr24828083iow.3.1698872900892;
Wed, 01 Nov 2023 14:08:20 -0700 (PDT)
User-Agent: slrn/1.0.3 (Linux)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <6542be44.050a0220.e7b44.2143@mx.google.com>
X-Mailman-Original-References: 6LdqaeKq-OvcrilFYqqT5tc9LsvSqHRKDYMGaBXzlVzyOdX9Ae0Xp_ACtg=
@protonmail.com>
 by: Grant Edwards - Wed, 1 Nov 2023 21:08 UTC

On 2023-11-01, Simon Connah via Python-list <python-list@python.org> wrote:

> I'm building a simple project using smtplib and have a
> question. I've been doing unit testing but I'm not sure how to check
> if an email message is valid.

Send an e-mail using it? If the right person gets the e-mail, then
it's valid?

> Using regex sounds like a bad idea to me and the other options I
> found required paying for third party services.
>
> Could someone push me in the right direction please? I just want to
> find out if a string is a valid email address.

You'll have to define "valid". Valid syntactically according to
<what>? Will be accepted by an SMTP server somewhere? Corresponds to
a real person?

Make sure it has an '@' in it. Possibly require at least one '.'
after the '@'.

Trying to do anything more than that is just wasting your time and
annoying the mule.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor