Bug 33633 - Check if email exists
Summary: Check if email exists
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-27 23:11 UTC by Christopher Brannon
Modified: 2023-12-13 17:19 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2023-04-27 23:11:14 UTC
Is there any kind of mechanism available for Koha to use to test the existence of an email address before actually trying to send an email?  It seems like there should be some way to ask email servers if the address at least exists, if not asking the status of the account, so it can make an informed decision on sending notices.

Right now, Koha just sends to the address without knowing anything.  If it doesn't exist, or is full, or blocked, then it is up to staff to figure it out and pass that information along to the patron.  If there is some way to figure this out before sending, then we would be able have Koha do something else, like send to a secondary email address, text, phone, restrict the account, etc.
Comment 1 Christopher Brannon 2023-04-27 23:12:09 UTC
And yes, I know that every server is different, but we could teach Koha the responses of different mail servers.
Comment 2 David Cook 2023-04-27 23:29:40 UTC
There's no simple way to test the existence of an email address before actually trying to send an email.

There are whole software systems that combine a number of different methods to try to guess if an email address is valid, but even then it's essentially an educated guess. 

So I don't think that aspect would be something included in Koha.

--

However, perhaps there could be a better way of falling back to another method if one fails. 

Also, Koha could include an "email_verified" column. Many systems will ask you to verify your email. That could be a worthwhile addition to Koha for sure.
Comment 3 Christopher Brannon 2023-04-27 23:49:25 UTC
(In reply to David Cook from comment #2)
> There's no simple way to test the existence of an email address before
> actually trying to send an email.

There are sites that will test.  Like https://email-checker.net/.  It even seems to offer an API.  Even if it isn't 100%, it could offer a way to say to staff, hey, something might be wrong here.  Better verify.  And then we can mark if it has been verified.
 
> However, perhaps there could be a better way of falling back to another
> method if one fails. 
> 
> Also, Koha could include an "email_verified" column. Many systems will ask
> you to verify your email. That could be a worthwhile addition to Koha for
> sure.

Yes, I have actually filed another bug somewhere asking for that very thing.  Maybe someday.  :)
Comment 4 David Cook 2023-04-28 00:10:46 UTC
(In reply to Christopher Brannon from comment #3)
> (In reply to David Cook from comment #2)
> > There's no simple way to test the existence of an email address before
> > actually trying to send an email.
> 
> There are sites that will test.  Like https://email-checker.net/.  It even
> seems to offer an API.  Even if it isn't 100%, it could offer a way to say
> to staff, hey, something might be wrong here.  Better verify.  And then we
> can mark if it has been verified.

As I said before, there are entire software systems devoted to this, yes. 

If you look at the "How do we verify an email" section of https://email-checker.net/, you'll see that it's a multi-step process  and not 100%. 

Koha already checks the email address format.

Previously, we've talked a bit about checking the domain name and MX records, but it never went anywhere. 

As for simulating sending a message, that's more complex. 

Perhaps this is an area where a Koha plugin hook could be added.

> > However, perhaps there could be a better way of falling back to another
> > method if one fails. 
> > 
> > Also, Koha could include an "email_verified" column. Many systems will ask
> > you to verify your email. That could be a worthwhile addition to Koha for
> > sure.
> 
> Yes, I have actually filed another bug somewhere asking for that very thing.
> Maybe someday.  :)

If you sponsor the change, it'll be more likely to get done.
Comment 5 Katrin Fischer 2023-04-28 17:02:16 UTC
Would it not also be dangerous/a security issue if such a service existed? Guessing email addresses and testing them would be a great activity for spammers or even people who want to sell email addresses to spammers.

But I like the idea of having users verify their emails and flagging verified ones.
Comment 6 Christopher Brannon 2023-04-28 17:28:03 UTC
(In reply to Katrin Fischer from comment #5)
> Would it not also be dangerous/a security issue if such a service existed?
> Guessing email addresses and testing them would be a great activity for
> spammers or even people who want to sell email addresses to spammers.

Regardless, tools exist.
Comment 7 Katrin Fischer 2023-04-28 17:36:15 UTC
But how do those tools operate and should we be using them? If you use a web service, it will know that you requested information about a certain email, giving them more information. I might not know much about how this works, but I would not want the library to use a third party vendors software and give them my email (GDPR etc.)
Comment 8 Marcel de Rooy 2023-04-28 18:49:56 UTC
I have my doubts whether this should be part of Koha as ILS.

I suppose that you could process/parse the mail logs from an internal mail server (if being used) in a "neighboring application" and support changing mail queue status and/or patron email address etc. via REST API in order to signal that there are issues with this address. Perhaps we need a flag to temporarily block email. Just brainstorming..
Comment 9 Katrin Fischer 2023-05-01 22:04:56 UTC
I think having the library send a verification email and flagging verified or problematic emails in Koha would be totally ok. But I think using any kind of outsite tool, API or website would be a big no-no in terms of data privacy and I also agree with Marcel that we should not implement it within Koha.
Comment 10 Christopher Brannon 2023-11-14 16:49:33 UTC
Perhaps Koha could just have an option for both email and SMS that if an email or number for SMS is given, it automatically just sends a verification link to the destination.  The address is listed as unverified in the patron account and unusable until the patron responds.