Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

USENET would be a better laboratory if there were more labor and less oratory. -- Elizabeth Haley


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

SubjectAuthor
* Re: Checking if email is validdn
`- Re: Checking if email is validDan Purgert

1
Re: Checking if email is valid

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonList@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: Checking if email is valid
Date: Thu, 2 Nov 2023 20:11:27 +1300
Organization: DWM
Lines: 69
Message-ID: <mailman.125.1698909102.3828.python-list@python.org>
References: <nze9mu-VI8ExA3VA9RA07qMo9Oj03xuWoTe-FL6N_AbOGK0QC6LdqaeKq-OvcrilFYqqT5tc9LsvSqHRKDYMGaBXzlVzyOdX9Ae0Xp_ACtg=@protonmail.com>
<CAPTjJmoUis6+RV5um=pnocr=K54f2c4d5zN2Zvo10pxh79yUGg@mail.gmail.com>
<-9noVuOpUQAkPbuiynyonZmXsAiNxRiuOlqaSXQrxmsQreDAE5R-MIt72P3SLBqmntdEd5QI2eSl969CcTVWUUz416g4T8nqC8xB1wZxkCc=@protonmail.com>
<a24730e8-5c1e-4c5d-a7af-875fd8497290@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de /MnKupRPk70DPVRhIDf+uggXSsLaeYbAtizM9b8fvGZw==
Cancel-Lock: sha1:d80qEgQ1h8oU9IkAQ+0UHha+md4= sha256:DN+sl3FXQhkQrfnIYddacXCetEX0Joap9SsezprtG68=
Return-Path: <PythonList@DancesWithMice.info>
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=danceswithmice.info header.i=@danceswithmice.info
header.b=G/ReF+cb; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'looks': 0.02; '(for':
0.05; '2023': 0.07; 'please?': 0.07; 'string': 0.07; 'suggestion':
0.07; 'wanting': 0.07; '=dn': 0.09; 'dns': 0.09;
'from:addr:danceswithmice.info': 0.09; 'from:addr:pythonlist':
0.09; 'received:192.168.1.64': 0.09; 'tons': 0.09; '(eg': 0.16;
'addresses.': 0.16; 'bounces': 0.16; 'database.': 0.16;
'expectation': 0.16; 'inspecting': 0.16; 'locate': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'received:cloud': 0.16;
'received:rangi.cloud': 0.16; 'removes': 0.16; 'simon': 0.16;
'solved': 0.16; 'somewhat': 0.16; 'though?': 0.16; 'wrote:': 0.16;
'problem': 0.16; 'addresses': 0.19; 'thu,': 0.19; 'to:addr:python-
list': 0.20; 'exception': 0.22; 'goal': 0.23; "i'd": 0.24;
'stuff': 0.25; '>>>': 0.28; 'example,': 0.28; 'wrong': 0.28;
'header:User-Agent:1': 0.30; 'header:Organization:1': 0.31;
'assume': 0.32; 'guess': 0.32; 'python-list': 0.32;
'received:192.168.1': 0.32; 'but': 0.32; "i'm": 0.33; 'mailing':
0.33; 'there': 0.33; 'script': 0.33; 'server': 0.33; 'someone':
0.34; 'able': 0.34; 'header:In-Reply-To:1': 0.34; 'trying': 0.35;
'close': 0.35; 'fix': 0.36; 'addressed': 0.36; 'built': 0.36;
'people': 0.36; 'those': 0.36; 'really': 0.37; 'using': 0.37;
"it's": 0.37; 'class': 0.37; 'others': 0.37; 'received:192.168':
0.37; 'way': 0.38; 'could': 0.38; 'two': 0.39; 'otherwise': 0.39;
'sending': 0.39; 'valid': 0.39; 'list': 0.39; 'something': 0.40;
'want': 0.40; 'should': 0.40; 'lack': 0.60; 'today': 0.61;
'likely': 0.61; "there's": 0.61; 'forward': 0.62; 'email': 0.63;
'send': 0.63; "you'd": 0.64; 'source.': 0.64; 'your': 0.64;
'spam': 0.65; 'well': 0.65; 'let': 0.66; 'address:': 0.67;
'earlier': 0.67; 'right': 0.68; 'order': 0.69; 'businesses': 0.69;
'drop': 0.69; 'care': 0.71; 'deal': 0.73; 'accurate': 0.74;
'records': 0.75; 'yourself': 0.75; 'die': 0.76; 'domain': 0.77;
'unusual': 0.81; 'left': 0.83; 'garbage': 0.84; 'illegal': 0.84;
'messages,': 0.84; 'valid,': 0.84
DKIM-Filter: OpenDKIM Filter v2.11.0 vps.rangi.cloud 11BAF30BC
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1698909094;
bh=sTRtLJkMIlV4xeLOttIbKdCwIL1noXPoDlDAkh0V/Jw=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=G/ReF+cbaxZ63HD4oxxlxH158CyLCK/a/+XDmYEoZ4OAIInKIpQo5GGllaChvA37G
+dpctxRrYOKdE3qpH+unYjG0jYp4Bzu+1yVH2FGCB6LQLFEYpegk1aIMdQUOrz0M1T
fu6qL5f9X0H1Y+zhF1R/kAnBmtaTugw4PB0Q8bDBVMs8lwdIBIGeYqyqyEzU1w3Jpi
r0kDQ1rm8e+7+1sp2FRSc3RbMd3IJMYdOntEApwrymJS+/DIJvq3a2ZdrC82sRgcsF
obrO9UqBvU3vyUebP/hs3toMy51SfcFA3evgW+UI15ZDftmii7ZeY5nuNoFS6PgPhf
rCXz+5xIngQPQ==
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <-9noVuOpUQAkPbuiynyonZmXsAiNxRiuOlqaSXQrxmsQreDAE5R-MIt72P3SLBqmntdEd5QI2eSl969CcTVWUUz416g4T8nqC8xB1wZxkCc=@protonmail.com>
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: <a24730e8-5c1e-4c5d-a7af-875fd8497290@DancesWithMice.info>
X-Mailman-Original-References: <nze9mu-VI8ExA3VA9RA07qMo9Oj03xuWoTe-FL6N_AbOGK0QC6LdqaeKq-OvcrilFYqqT5tc9LsvSqHRKDYMGaBXzlVzyOdX9Ae0Xp_ACtg=@protonmail.com>
<CAPTjJmoUis6+RV5um=pnocr=K54f2c4d5zN2Zvo10pxh79yUGg@mail.gmail.com>
<-9noVuOpUQAkPbuiynyonZmXsAiNxRiuOlqaSXQrxmsQreDAE5R-MIt72P3SLBqmntdEd5QI2eSl969CcTVWUUz416g4T8nqC8xB1wZxkCc=@protonmail.com>
 by: dn - Thu, 2 Nov 2023 07:11 UTC

On 02/11/2023 19.46, Simon Connah via Python-list wrote:
>> On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list
>> python-list@python.org wrote:
>>
>
>>> Could someone push me in the right direction please? I just want to find out if a string is a valid email address.
>>
>
>>
>
>> There is only one way to know that a string is a valid email address,
>> and that's to send an email to it.
>>
>
>> What is your goal though? For example, if you're trying to autolink
>> email addresses in text, you don't really care whether it's valid,
>> only that it looks like an address.
>>
>
>
> My goal is to make a simple mailing list platform. I guess I could just send email to an address and if it bounces then I can remove it from the database. Thing is I'm not sure how close to a real email address an email has to be in order to be bounced. If it was completely wrong it might just swallowed up.

Exactly!

Build a complementary script which inspects the returned/bounced
messages, and removes those addresses.

Given that the list of addresses is built from people signing-up in the
first place, one has to presume that people know their own addresses and
can type - there's no real defence against 'stupid'*. It's not as if you
are making-up addresses yourself (in many jurisdictions it is illegal
without opt-in).

An email address: account@domain, has to be accurate in two ways:
1 the domain - otherwise the DNS (Domain Name System) won't be able to
locate the destination email server
2 the account - otherwise the email server won't know to which mail-box
the message should be delivered.

The (1) is why there was some suggestion of using MX records (but may as
well just send the message).

The problem with (2) is that some servers will 'bounce' a message, but
others will let it die silently (not wanting to add to email-spam by
sending stuff 'back' if the message was spam in the first place!)

The exception to (2) is a "catch-all" address, which accepts every
message not addressed to a (legal) mail-box. These are sometimes used to
deal with messages addressed to a staff-member who has left (for
example). However, are somewhat problematic because they pick-up tons of
garbage (eg earlier today I received a message to 456789@domain.tld.
This is not, and never has been, a mail-box on the domain; but would
drop into a catch-all mail-box.

It would be an unusual MailAdmin inspecting a catch-all address, who
would return a mis-addressed email to its source. If the message was
addressed to Smon@domain.tld, I'd be more likely to assume it was for
you, and forward it to you (in the expectation that you'd fix the
problem with the sender...). However, ...

There are some large businesses doing what you've outlined. They have
not solved this problem - and not through lack of trying!

* as fast as you make something idiot-proof, the world will show you an
'improved' class of idiot!
--
Regards,
=dn

Re: Checking if email is valid

<slrnuk6slj.2u2.dan@djph.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dan@djph.net (Dan Purgert)
Newsgroups: comp.lang.python
Subject: Re: Checking if email is valid
Date: Thu, 2 Nov 2023 09:56:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <slrnuk6slj.2u2.dan@djph.net>
References: <nze9mu-VI8ExA3VA9RA07qMo9Oj03xuWoTe-FL6N_AbOGK0QC6LdqaeKq-OvcrilFYqqT5tc9LsvSqHRKDYMGaBXzlVzyOdX9Ae0Xp_ACtg=@protonmail.com>
<CAPTjJmoUis6+RV5um=pnocr=K54f2c4d5zN2Zvo10pxh79yUGg@mail.gmail.com>
<-9noVuOpUQAkPbuiynyonZmXsAiNxRiuOlqaSXQrxmsQreDAE5R-MIt72P3SLBqmntdEd5QI2eSl969CcTVWUUz416g4T8nqC8xB1wZxkCc=@protonmail.com>
<a24730e8-5c1e-4c5d-a7af-875fd8497290@DancesWithMice.info>
<mailman.125.1698909102.3828.python-list@python.org>
Injection-Date: Thu, 2 Nov 2023 09:56:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2896df106ab0fa3e7d258463bd462e57";
logging-data="2243803"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18oUU3XesDbhyVLlbHbIdFN1fkDxvE2Ue0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:87DK8lpeZhzhPCYqJm1gqranmfY=
 by: Dan Purgert - Thu, 2 Nov 2023 09:56 UTC

On 2023-11-02, dn wrote:
> On 02/11/2023 19.46, Simon Connah via Python-list wrote:
>> [...]
>> My goal is to make a simple mailing list platform. I guess I could
>> just send email to an address and if it bounces then I can remove it
>> from the database. Thing is I'm not sure how close to a real email
>> address an email has to be in order to be bounced. If it was
>> completely wrong it might just swallowed up.
>
> Exactly!
>
> Build a complementary script which inspects the returned/bounced
> messages, and removes those addresses.
>
> Given that the list of addresses is built from people signing-up in the
> first place, one has to presume that people know their own addresses and
> can type - there's no real defence against 'stupid'*. It's not as if you
> are making-up addresses yourself (in many jurisdictions it is illegal
> without opt-in).

Isn't opt-in usually to the effect of "send a message with the subject
SUBSCRIBE to listname-requests@mailinglist.domain.tld " ? Then the
trick becomes filtering out the spam; but the "is the email valid" check
is somewhat done as a matter of processing that inbound subscribe
message.

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860


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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor