summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-12-19 09:21:39 +0100
committerYorhel <git@yorhel.nl>2020-12-19 09:21:39 +0100
commit5da40cc1dc01170251c9065beea141ac3b7696ff (patch)
treeacf4e8e32c6212e30e6443abe4d41fdd230adadc
parentd96b545dc45a0f85239dc36738ceb5fbe25d47e5 (diff)
Warn about shitty email providers upon registration & password reset
-rw-r--r--elm/Lib/Util.elm9
-rw-r--r--elm/User/PassReset.elm12
-rw-r--r--elm/User/Register.elm10
3 files changed, 30 insertions, 1 deletions
diff --git a/elm/Lib/Util.elm b/elm/Lib/Util.elm
index f3cf6433..72a0828d 100644
--- a/elm/Lib/Util.elm
+++ b/elm/Lib/Util.elm
@@ -83,6 +83,15 @@ containsNonLatin : String -> Bool
containsNonLatin = Regex.contains nonlatin_
+-- Given an email address, returns the name of the provider if it has a good chance of blocking mails from our server.
+shittyMailProvider : String -> Maybe String
+shittyMailProvider s =
+ case String.split "@" s |> List.drop 1 |> List.head |> Maybe.withDefault "" |> String.toLower of
+ "sbcglobal.net" -> Just "AT&T"
+ "att.net" -> Just "AT&T"
+ _ -> Nothing
+
+
-- Format a release resolution, first argument indicates whether empty string is to be used for "unknown"
resoFmt : Bool -> Int -> Int -> String
resoFmt empty x y =
diff --git a/elm/User/PassReset.elm b/elm/User/PassReset.elm
index dbcb1d57..5eb78313 100644
--- a/elm/User/PassReset.elm
+++ b/elm/User/PassReset.elm
@@ -8,6 +8,7 @@ import Lib.Api as Api
import Gen.Api as GApi
import Gen.UserPassReset as GUPR
import Lib.Html exposing (..)
+import Lib.Util exposing (..)
main : Program () Model Msg
@@ -68,7 +69,16 @@ view model =
, text " and we'll send you instructions to set a new password within a few minutes!"
]
, table [ class "formtable" ]
- [ formField "email::E-Mail" [ inputText "email" model.email EMail GUPR.valEmail ]
+ [ formField "email::E-Mail"
+ [ inputText "email" model.email EMail GUPR.valEmail
+ , case shittyMailProvider model.email of
+ Nothing -> text ""
+ Just n -> span []
+ [ br [] []
+ , b [ class "standout" ] [ text "WARNING: " ]
+ , text (n ++ " is known to silently drop emails from VNDB. If your password reset email does not arrive in a few hours, please send a mail to contact@vndb.org.")
+ ]
+ ]
]
]
, div [ class "mainbox" ]
diff --git a/elm/User/Register.elm b/elm/User/Register.elm
index de8e36ce..e9d8cab5 100644
--- a/elm/User/Register.elm
+++ b/elm/User/Register.elm
@@ -8,6 +8,7 @@ import Lib.Api as Api
import Gen.Api as GApi
import Gen.UserRegister as GUR
import Lib.Html exposing (..)
+import Lib.Util exposing (..)
main : Program () Model Msg
@@ -82,6 +83,15 @@ view model =
]
, formField "email::E-Mail"
[ inputText "email" model.email EMail GUR.valEmail
+ , case shittyMailProvider model.email of
+ Nothing -> text ""
+ Just n -> span []
+ [ br [] []
+ , b [ class "standout" ] [ text "WARNING: " ]
+ , text (n ++ " is known to silently drop emails from VNDB. If you have an address at another provider, you may want to use that."
+ ++ " If you want to keep using this provider, please kindly tell them to stop blocking VNDB. Thanks.")
+ , br [] []
+ ]
, br_ 1
, text "Your email address will only be used in case you lose your password. "
, text "We will never send spam or newsletters unless you explicitly ask us for it or we get hacked."