From 8866a2ab768f7c419e2e31604772f0687986ffa2 Mon Sep 17 00:00:00 2001 From: Geno Shamugia <48299520+shamo0@users.noreply.github.com> Date: Mon, 26 Dec 2022 20:49:54 +0000 Subject: [PATCH] Added Bash script example, + spymail.com domain (#350) --- README.md | 23 +++++++++++++++++++++++ disposable_email_blocklist.conf | 1 + 2 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 5d560fc..7592403 100644 --- a/README.md +++ b/README.md @@ -163,3 +163,26 @@ var addr = new MailAddress(email); if (IsBlocklisted(addr.Host))) throw new ApplicationException("Email is blocklisted."); ``` + +### Bash + +``` +#!/bin/bash + +# This script checks if an email address is temporary. + +# Read blocklist file into a bash array +mapfile -t blocklist < disposable_email_blocklist.conf + +# Check if email domain is in blocklist +if [[ " ${blocklist[@]} " =~ " ${email#*@} " ]]; then + message="Please enter your permanent email address." + return_value=false +else + return_value=true +fi + +# Return result +echo "$return_value" +``` + diff --git a/disposable_email_blocklist.conf b/disposable_email_blocklist.conf index ce2bccc..9881587 100644 --- a/disposable_email_blocklist.conf +++ b/disposable_email_blocklist.conf @@ -2775,6 +2775,7 @@ spr.io spritzzone.de spruzme.com spybox.de +spymail.com squizzy.de squizzy.net sroff.com