1

I am trying to setup a rule to block all temporary email forwarding domains from being registered on a Drupal site. I have seen the user restrictions module but I would like to do this using rules.

I'm curious if this is the most efficient way to setup the rule? I'm not sure if account:mail should be used since the account does not exist yet?

Here is what I have so far:

{ "rules_email_domain_name_validation" : {
    "LABEL" : "Email Domain Name Validation",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "email", "validation" ],
    "REQUIRES" : [ "rules", "user_restrictions" ],
    "ON" : { "user_presave" : [] },
    "IF" : [
      { "text_matches" : {
          "text" : [ "account:mail" ],
          "match" : "(@0815.ru|@0clickemail.com|@0-mail.com|@0wnd.net|@0wnd.org|@10minutemail.com|@20minutemail.com|@2prong.com|@30minutemail.com|@33mail.com|@3d-painting.com|@4warding.com|@4warding.net|@4warding.org|@60minutemail.com|@675hosting.com|@675hosting.net|@675hosting.org|@6ip.us|@6url.com|@75hosting.com|@75hosting.net|@75hosting.org|@7tags.com|@9ox.net|@a-bc.net|@afrobacon.com|@ajaxapp.net|@ama-trade.de|@ama-trans.de|@amilegit.com|@amiri.net|@amiriindustries.com|@anonbox.net|@anonymbox.com|@antichef.com|@antichef.net|@antispam.de|@azmeil.tk|@baxomale.ht.cx|@beefmilk.com|@big-post.com|@binkmail.com|@bio-muesli.net|@bobmail.info|@bodhi.lawlita.com|@bofthew.com|@brefmail.com|@brennendesreich.de|@broadbandninja.com|@bsnow.net|@bugmenot|@bugmenot.com|@bumpymail.com|@bund.us|@casualdx.com|@centermail.com|@centermail.net|@chogmail.com|@choicemail1.com|@cool.fr.nf|@correo.blogos.net|@cosmorph.com|@courriel.fr.nf|@courrieltemporaire.com|@crazymailing.com|@cubiclink.com|@curryworld.de|@cust.in|@dacoolest.com|@dandikmail.com|@dayrep.com|@deadaddress.com|@deadspam.com|@despam.it|@despammed.com|@devnullmail.com|@dfgh.net|@digitalsanctuary.com|@discardmail.com|@discardmail.de|@disposableaddress.com|@disposeamail.com|@disposemail.com|@dispostable.com|@dm.w3internet.co.uk|@dm.w3internet.co.ukexample.com|@dodgeit.com|@dodgit.com|@dodgit.org|@doiea.com|@donemail.ru|@dontreg.com|@dontsendmespam.de|@drdrb.com|@drdrb.net|@dropcake.de|@dumpandjunk.com|@dump-email.info|@dumpmail.de|@dumpyemail.com|@e4ward.com|@email60.com|@emaildienst.de|@emailias.com|@emailigo.de|@emailinfive.com|@emailmiser.com|@emailsensei.com|@emailtemporario.com.br|@emailto.de|@emailwarden.com|@emailx.at.hm|@emailxfer.com|@emeil.ir|@emz.net|@enterto.com|@ephemail.net|@e-postkasten.com|@e-postkasten.de|@e-postkasten.eu|@e-postkasten.info|@etranquil.com|@etranquil.net|@etranquil.org|@evopo.com|@explodemail.com|@faecesmail.me|@fakeinbox.com|@fakeinformation.com|@falseaddress.com|@fastacura.com|@fastchevy.com|@fastchrysler.com|@fastkawasaki.com|@fastmazda.com|@fastmitsubishi.com|@fastnissan.com|@fastsubaru.com|@fastsuzuki.com|@fasttoyota.com|@fastyamaha.com|@filzmail.com|@fizmail.com|@fly-ts.de|@fr33mail.info|@frapmail.com|@front14.org|@fux0ringduh.com|@garliclife.com|@get1mail.com|@get2mail.fr|@getonemail.com|@getonemail.net|@ghosttexter.de|@girlsundertheinfluence.com|@gishpuppy.com|@gowikibooks.com|@gowikicampus.com|@gowikicars.com|@gowikifilms.com|@gowikigames.com|@gowikimusic.com|@gowikinetwork.com|@gowikitravel.com|@gowikitv.com|@great-host.in|@greensloth.com|@grr.la|@gsrv.co.uk|@guerillamail.biz|@guerillamail.com|@guerillamail.net|@guerillamail.org|@guerrillamail.biz|@guerrillamail.com|@guerrillamail.de|@guerrillamail.net|@guerrillamail.org|@guerrillamailblock.com|@h.mintemail.com|@h8s.org|@haltospam.com|@hatespam.org|@hidemail.de|@hochsitze.com|@hotpop.com|@hulapla.de|@ieatspam.eu|@ieatspam.info|@ieh-mail.de|@ihateyoualot.info|@iheartspam.org|@imails.info|@inbax.tk|@inboxalias.com|@inboxclean.com|@inboxclean.org|@incognitomail.com|@incognitomail.net|@incognitomail.org|@insorg-mail.info|@ipoo.org|@irish2me.com|@iwi.net|@jetable.com|@jetable.fr.nf|@jetable.net|@jetable.org|@jnxjn.com|@junk1e.com|@kasmail.com|@kaspop.com|@keepmymail.com|@killmail.com|@killmail.net|@kir.ch.tc|@klassmaster.com|@klassmaster.net|@klzlk.com|@koszmail.pl|@kulturbetrieb.info|@kurzepost.de|@lags.us|@letthemeatspam.com|@lhsdv.com|@lifebyfood.com|@link2mail.net|@litedrop.com|@lol.ovpn.to|@lookugly.com|@lopl.co.cc|@lortemail.dk|@lr78.com|@m4ilweb.info|@maboard.com|@mail.by|@mail.mezimages.net|@mail2rss.org|@mail333.com|@mail-4server.com|@mail4trash.com|@mailbidon.com|@mailblocks.com|@mailcatch.com|@maildrop.cc|@maileater.com|@mailexpire.com|@mailfa.tk|@mailfreeonline.com|@mailimate.com|@mailin8r.com|@mailinater.com|@mailinator.com|@mailinator.net|@mailinator2.com|@mailincubator.com|@mailismagic.com|@mailme.ir|@mailme.lv|@mailmetrash.com|@mailmoat.com|@mailnator.com|@mailnesia.com|@mailnull.com|@mailshell.com|@mailsiphon.com|@mailslite.com|@mailtemp.info|@mail-temporaire.fr|@mailzilla.com|@mailzilla.org|@malahov.de|@mbx.cc|@mega.zik.dj|@meinspamschutz.de|@meltmail.com|@messagebeamer.de|@mierdamail.com|@mintemail.com|@moburl.com|@moncourrier.fr.nf|@monemail.fr.nf|@monmail.fr.nf|@msa.minsmail.com|@mt2009.com|@mt2014.com|@mx0.wwwnew.eu|@mycleaninbox.net|@mymailoasis.com|@mypartyclip.de|@myphantomemail.com|@myspaceinc.com|@myspaceinc.net|@myspaceinc.org|@myspacepimpedup.com|@myspamless.com|@mytrashmail.com|@neomailbox.com|@nepwk.com|@nervmich.net|@nervtmich.net|@netmails.com|@netmails.net|@netzidiot.de|@neverbox.com|@nnot.net|@nobulk.com|@noclickemail.com|@nogmailspam.info|@nomail.xl.cx|@nomail2me.com|@nomorespamemails.com|@no-spam.ws|@nospam.ze.tc|@nospam4.us|@nospamfor.us|@nospamthanks.info|@notmailinator.com|@nowmymail.com|@nurfuerspam.de|@nus.edu.sg|@nwldx.com|@objectmail.com|@obobbo.com|@oneoffemail.com|@onewaymail.com|@online.ms|@oopi.org|@opayq.com|@ordinaryamerican.net|@otherinbox.com|@ourklips.com|@outlawspam.com|@ovpn.to|@owlpic.com|@pancakemail.com|@pimpedupmyspace.com|@pjjkp.com|@politikerclub.de|@poofy.org|@pookmail.com|@privacy.net|@proxymail.eu|@prtnx.com|@punkass.com|@putthisinyourspamdatabase.com|@qq.com|@quickinbox.com|@rcpt.at|@recode.me|@recursor.net|@regbypass.com|@regbypass.comsafe-mail.net|@rejectmail.com|@rklips.com|@rmqkr.net|@rppkn.com|@rtrtr.com|@s0ny.net|@safe-mail.net|@safersignup.de|@safetymail.info|@safetypost.de|@sandelf.de|@saynotospams.com|@selfdestructingmail.com|@sendspamhere.com|@sharklasers.com|@shiftmail.com|@shitmail.me|@shortmail.net|@sibmail.com|@skeefmail.com|@sky-ts.de|@slaskpost.se|@slopsbox.com|@smellfear.com|@snakemail.com|@sneakemail.com|@sofimail.com|@sofort-mail.de|@sogetthis.com|@soodonims.com|@spam.la|@spam.su|@spam4.me|@spamavert.com|@spambob.com|@spambob.net|@spambob.org|@spambog.com|@spambog.de|@spambog.net|@spambog.ru|@spambox.info|@spambox.irishspringrealty.com|@spambox.us|@spamcannon.com|@spamcannon.net|@spamcero.com|@spamcon.org|@spamcorptastic.com|@spamcowboy.com|@spamcowboy.net|@spamcowboy.org|@spamday.com|@spamex.com|@spamfree24.com|@spamfree24.de|@spamfree24.eu|@spamfree24.info|@spamfree24.net|@spamfree24.org|@spamgourmet.com|@spamgourmet.net|@spamgourmet.org|@spamherelots.com|@spamhereplease.com|@spamhole.com|@spamify.com|@spaminator.de|@spamkill.info|@spaml.com|@spaml.de|@spammotel.com|@spamobox.com|@spamoff.de|@spamslicer.com|@spamspot.com|@spamthis.co.uk|@spamthisplease.com|@spamtrail.com|@speed.1s.fr|@supergreatmail.com|@supermailer.jp|@suremail.info|@tagyourself.com|@teewars.org|@teleworm.com|@teleworm.us|@tempalias.com|@tempemail.biz|@tempemail.com|@tempe-mail.com|@tempemail.net|@tempinbox.co.uk|@tempinbox.com|@tempmail.it|@tempmail2.com|@tempomail.fr|@temporarily.de|@temporarioemail.com.br|@temporaryemail.net|@temporaryforwarding.com|@temporaryinbox.com|@thanksnospam.info|@thankyou2010.com|@thisisnotmyrealemail.com|@throwawayemailaddress.com|@tilien.com|@tmailinator.com|@toiea.com|@tradermail.info|@trash2009.com|@trash-amil.com|@trashemail.de|@trashmail.at|@trash-mail.at|@trashmail.com|@trash-mail.com|@trashmail.de|@trash-mail.de|@trashmail.me|@trashmail.net|@trashmail.org|@trashmail.ws|@trashmailer.com|@trashymail.com|@trashymail.net|@trillianpro.com|@tryalert.com|@turual.com|@twinmail.de|@tyldd.com|@uggsrock.com|@upliftnow.com|@uplipht.com|@username.e4ward.com|@username.otherinbox.com|@venompen.com|@veryrealemail.com|@veryrealmail.com|@viditag.com|@viewcastmedia.com|@viewcastmedia.net|@viewcastmedia.org|@webm4il.info|@wegwerfadresse.de|@wegwerfemail.de|@wegwerfmail.de|@wegwerfmail.net|@wegwerfmail.org|@wetrainbayarea.com|@wetrainbayarea.org|@wh4f.org|@whatpaas.com|@whyspam.me|@willselfdestruct.com|@winemaven.info|@wronghead.com|@wuzup.net|@wuzupmail.net|@wwwnew.eu|@xagloo.com|@xemaps.com|@xents.com|@xmaily.com|@xoxy.net|@yep.it|@yogamaven.com|@yopmail.com|@yopmail.fr|@yopmail.net|@ypmail.webarnak.fr.eu.org|@yuurok.com|@zehnminutenmail.de|@zippymail.info|@zoaxe.com|@zoemail.org|@trbvm.com|@20mail.it|@20mail.eu)",
          "operation" : "regex"
        }
      }
    ],
    "DO" : [ { "user_restrictions_block_mail" : { "account" : [ "account" ] } } ]
  }
}
3
  • Have you tested it using account:mail? – rooby Dec 7 '15 at 3:47
  • It seems odd that your action would be user_restrictions_block_mail if you don't want to use the user restrictions module. – rooby Dec 7 '15 at 3:48
  • Good point. I was playing around with it so this is as far as I had gotten and discovered there were multiple email tokens which was confusing. – Adam Dec 8 '15 at 23:56
0

If I were to do this task I would create a custom hook_form_validate and then add it to the registration form with hook_form_alter

Then in your validate function you can do your custom php in there to check if the email address is what you want. If it's not you can use form_set_error to add an error to the form and that way you can provide a custom message to the user too

1
  • Sounds like a decent approach. Not as generic as rules like I hoped but does the trick. – Adam Dec 8 '15 at 23:56
0

Drupal has a feature that allows you to either completely block or moderate all user registrations by adopting one of them :

  1. Core approval features
  2. E-mail verification
  3. Block certain user details
  4. Captchas
  5. Honeypots / Secret form fields
  6. Block by location
  7. Secret codes
  8. 3rd party spam tools
  9. Delayed roles
  10. Warning message

More Details

3
  • This gives vague options but doesn't say how to actually set anything up. – rooby Dec 9 '15 at 0:20
  • check link details – Adi Dec 9 '15 at 5:31
  • Links without explanation are not ideal because if the link breaks the answer become much less useful to people in future. – rooby Dec 9 '15 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.