[AWS] email checking function
Georg Bauhaus
bauhaus at arcor.de
Tue Jun 30 11:47:31 CEST 2015
Am 29.06.2015 um 19:18 schrieb Jacob Sparre Andersen <jacob at jacob-sparre.dk>:
> On 29/06-2015 17:59, Pascal Obry wrote:
>> Le lundi 29 juin 2015 à 15:23 +0100, tony gair a écrit :
>>> Is there a function somewhere in AWS that will validate a string as a
>>> valid email?
>> No, but it should be close to:
>>
>> Pos_A : Natural := Strings.Fixed.Index (Email, "@");
>> Pos_P : Natural := Strings.Fixed.Index (Email, ".", From => Pos_A);
>>
>> Pos_A in Email'First + 1 .. Email'Last - 2
>> and then
>> Pos_B in Pos_A + 1 .. Email'Last - 1
>>
>> Plus checks for non supported characters.
> It is a bit more complicated than that. Route-based e-mail addresses are still valid.
If you look at the very last pages of the Sendmail book, you'll see
immediately that a syntax check of an email address is quite something,
far from trivial. Good news: there might be some justification
to ignore (very) old style addresses; however, some bits have been added
in the meantime like international eMail addresses, e.g. those
involving IDNs. And Microsoft underscores, I think.
I believe that many sites just do naive, rule of thumb like checking,
and weigh any mishaps according to any rules in place, like MTAs,
marketing, legal, etc. Does it matter? Is it necessary? 80/20? If just one
program handling email transport does not follow some official syntax
rule for email addresses, having checked them properly will not help.
And conversely, if excluding email addresses that ("wrongly") use the
Microsoft underscore, say, then their owners might complain if they
don't get eMail except through Microsoft Exchange ;-)
More information about the AWS
mailing list