spam_email 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a9800651f6555e720b38e4409194faa24f4a2f71
4
+ data.tar.gz: 6892ad93b399ad998a7d74c2ece72630f298291f
5
+ SHA512:
6
+ metadata.gz: aac6b8804d1374e92ca516545d097c6cf747adba26169ca73dab8cdf9726a2021dca09e879c06655ae702714a0021fcf2f562e04a562aaba05c8716b0ecdec16
7
+ data.tar.gz: 9032aeb177ca62e61b5991123fc255a7196f97abf43372100146928a0b3ed41e4a2a610e46bd3ad3d20f6f75341026a7fdf979e712b01042ed498e8d7143c8e8
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in spam_email.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,5 @@
1
+ Copyright (c) 2013 Phillipp Röll
2
+
3
+ Use as you wish :-)
4
+
5
+ Blacklist by Chris Birner <cbhp@lima-city.de>
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # SpamEmail
2
+
3
+ If you have to reach out to your users with important information and they signed
4
+ up with a trash e-mail address you're not like to get the desired attention.This
5
+ gem checks the e-mail address domain against a blcklist of trash mail providers.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'spam_email'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install spam_email
20
+
21
+ ## Usage
22
+
23
+ **Be advised that the validation checks NOT if a correct e-mail address is given.
24
+ Validation will pass with empty string/`nil` value! Checking the input with
25
+ `valid_email` or at least checking `presence: true` is strongly recommendend!**
26
+
27
+ ``class User < ActiveRecord::Base
28
+ validates :email, presence: true, spam_email: true
29
+ end
30
+ ``
31
+
32
+ or specify a custom message with (the gem comes with en/de/fr locales):
33
+
34
+ `validates :email, presence: true, spam_email: { message: "is a blacklisted provider!" }`
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it
39
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
41
+ 4. Push to the branch (`git push origin my-new-feature`)
42
+ 5. Create new Pull Request
43
+
44
+ ## Thanks
45
+
46
+ Thanks go to Chris Birner (cbhp@lima-city.de) for the (inital) blacklist and
47
+ to https://github.com/hallelujah/valid_email for inspiration.
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ desc "Run specs"
4
+ RSpec::Core::RakeTask.new do |t|
5
+ t.pattern = 'spec/**/*_spec.rb'
6
+ end
7
+
8
+ task :default => [:spec]
9
+ task :build => [:spec]
@@ -0,0 +1,5 @@
1
+ de:
2
+ spam_email:
3
+ validations:
4
+ email:
5
+ blacklisted: "ist ein gesperrter E-Mail-Provider"
@@ -0,0 +1,5 @@
1
+ en:
2
+ spam_email:
3
+ validations:
4
+ email:
5
+ blacklisted: "is a blacklisted email provider"
@@ -0,0 +1,5 @@
1
+ fr:
2
+ spam_email:
3
+ validations:
4
+ email:
5
+ blacklisted: "est un fournisseur e-mail interdit"
@@ -0,0 +1,776 @@
1
+ module SpamEmail
2
+ BLACKLIST = [ "0815.ru",
3
+ "0clickemail.com",
4
+ "0-mail.com",
5
+ "10minutemail.com",
6
+ "10minutemail.net",
7
+ "10x9.com",
8
+ "126.com",
9
+ "12houremail.com",
10
+ "12minutemail.com",
11
+ "1337-crew.to",
12
+ "139.com",
13
+ "163.com",
14
+ "188.com",
15
+ "1pad.de",
16
+ "2012pollingstatistics.com",
17
+ "20minutemail.com",
18
+ "21cn.com",
19
+ "21cn.net",
20
+ "2prong.com",
21
+ "30minutemail.com",
22
+ "30minutenmail.eu",
23
+ "30minutesmail.com",
24
+ "3dayemail.com",
25
+ "3dl.am",
26
+ "3d-painting.com",
27
+ "4warding.com",
28
+ "4warding.net",
29
+ "4warding.org",
30
+ "60minutemail.com",
31
+ "6ip.us",
32
+ "6url.com",
33
+ "8127ep.com",
34
+ "advertfast.com",
35
+ "agedmail.com",
36
+ "ahsa.ws",
37
+ "aichyna.com",
38
+ "ajman.us",
39
+ "ajman.ws",
40
+ "akapost.com",
41
+ "alex4all.com",
42
+ "ama-trade.de",
43
+ "ama-trans.de",
44
+ "amilegit.com",
45
+ "anhorn.de",
46
+ "ano-mail.net",
47
+ "anonbox.net",
48
+ "anonmail.de",
49
+ "anon-mail.de",
50
+ "anonmails.de",
51
+ "anon-me.de",
52
+ "anonymbox.com",
53
+ "anonymousmail.de",
54
+ "anonymousspeech.com",
55
+ "antichef.net",
56
+ "antireg.ru",
57
+ "antispam.de",
58
+ "antispam24.de",
59
+ "antispammail.de",
60
+ "arar.ws",
61
+ "armyspy.com",
62
+ "asdasd.ru",
63
+ "au.ru",
64
+ "autorambler.ru",
65
+ "b2cmail.de",
66
+ "baseoftrash.de",
67
+ "beefmilk.com",
68
+ "berahe.info",
69
+ "bi-dating.info",
70
+ "bigmir.net",
71
+ "binkmail.com",
72
+ "bio-muesli.info",
73
+ "bio-muesli.net",
74
+ "bk.ru",
75
+ "blackmarket.to",
76
+ "blida.info",
77
+ "bobmail.info",
78
+ "bodhi.lawlita.com",
79
+ "bofthew.com",
80
+ "bookee.com",
81
+ "bootybay.de",
82
+ "breakthru.com",
83
+ "brefmail.com",
84
+ "brennendesreich.de",
85
+ "bsnow.net",
86
+ "bspamfree.org",
87
+ "buffemail.com",
88
+ "bugmenever.com",
89
+ "bugmenot.com",
90
+ "bumpymail.com",
91
+ "bund.us",
92
+ "bymail.org",
93
+ "casema.org",
94
+ "cash.com",
95
+ "cashette.com",
96
+ "ccatv.org",
97
+ "ccxt.info",
98
+ "centermail.com",
99
+ "centermail.net",
100
+ "chammy.info",
101
+ "chcb.info",
102
+ "cheatmail.de",
103
+ "chogmail.com",
104
+ "correo10.com",
105
+ "cosmorph.com",
106
+ "courrieltemporaire.com",
107
+ "crapmail.org",
108
+ "cubiclink.com",
109
+ "curryworld.de",
110
+ "cust.in",
111
+ "cuvox.de",
112
+ "dacoolest.com",
113
+ "dandikmail.com",
114
+ "dayrep.com",
115
+ "dbunker.com",
116
+ "deadaddress.com",
117
+ "deagot.com",
118
+ "delikkt.de",
119
+ "despam.it",
120
+ "despammed.com",
121
+ "devnullmail.com",
122
+ "diablo-hell.de",
123
+ "dingbone.com",
124
+ "discardmail.com",
125
+ "discardmail.de",
126
+ "disposeamail.com",
127
+ "disposemail.com",
128
+ "dispostable.com",
129
+ "docmail.cz",
130
+ "dodgeit.com",
131
+ "dodgit.com",
132
+ "dodgit.org",
133
+ "domain141.com",
134
+ "donemail.ru",
135
+ "dontassrape.us",
136
+ "dontreg.com",
137
+ "dontsendmespam.de",
138
+ "dotman.de",
139
+ "drdrb.com",
140
+ "dropcake.de",
141
+ "dspsbl.com",
142
+ "dudmail.com",
143
+ "dump-email.info",
144
+ "dumpmail.de",
145
+ "dumpyemail.com",
146
+ "duskmail.com",
147
+ "dyndns.org",
148
+ "e4ward.com",
149
+ "easy.com",
150
+ "edv.to",
151
+ "einmalmail.de",
152
+ "einrot.com",
153
+ "eintagsmail.de",
154
+ "email60.com",
155
+ "emaildienst.de",
156
+ "emailgo.de",
157
+ "emailias.com",
158
+ "emailigo.de",
159
+ "emailinfive.com",
160
+ "emaillime.com",
161
+ "emailmiser.com",
162
+ "emailsensei.com",
163
+ "emailtemporanea.com",
164
+ "emailtemporanea.net",
165
+ "emailtemporario.com.br",
166
+ "emailwarden.com",
167
+ "emailx.at.hm",
168
+ "epost4you.de",
169
+ "e-postkasten.com",
170
+ "e-postkasten.de",
171
+ "e-postkasten.eu",
172
+ "e-postkasten.info",
173
+ "ero-tube.org",
174
+ "europe.com",
175
+ "example.com",
176
+ "example.org",
177
+ "eyepaste.com",
178
+ "facebook.com",
179
+ "fakedemail.com",
180
+ "fakeinbox.com",
181
+ "fakeinbox.net",
182
+ "fakeinbox.org",
183
+ "fakeinformation.com",
184
+ "fakemail.fr",
185
+ "fakemail24.de",
186
+ "fanaticars.info",
187
+ "fansworldwide.de",
188
+ "fastacura.com",
189
+ "fastchevy.com",
190
+ "fastchrysler.com",
191
+ "fastkawasaki.com",
192
+ "fastmazda.com",
193
+ "fastmitsubishi.com",
194
+ "fastnissan.com",
195
+ "fastsubaru.com",
196
+ "fastsuzuki.com",
197
+ "fasttoyota.com",
198
+ "fastyamaha.com",
199
+ "faza.ru",
200
+ "film-blog.biz",
201
+ "filzmail.com",
202
+ "find-love.info",
203
+ "fivemail.de",
204
+ "fizmail.com",
205
+ "flyspam.com",
206
+ "fly-ts.de",
207
+ "for-fun.info",
208
+ "fornow.eu",
209
+ "foteret.info",
210
+ "foxmail.com",
211
+ "fr33mail.info",
212
+ "frapmail.com",
213
+ "freefreemail.info",
214
+ "freemail.ms",
215
+ "freespambox.com",
216
+ "freestuffo1.com",
217
+ "freestuffo2.com",
218
+ "freestuffo3.com",
219
+ "freestuffo4.com",
220
+ "fromru.com",
221
+ "fromru.ru",
222
+ "front.ru",
223
+ "front14.org",
224
+ "fudgerub.com",
225
+ "fujairah.us",
226
+ "fujairah.ws",
227
+ "garbagemail.org",
228
+ "garliclife.com",
229
+ "gawab.com",
230
+ "geschenkt.biz",
231
+ "geschent.biz",
232
+ "get1mail.com",
233
+ "get2mail.fr",
234
+ "getmails.eu",
235
+ "getonemail.com",
236
+ "getonemail.net",
237
+ "ghosttexter.de",
238
+ "giantmail.de",
239
+ "gishpuppy.com",
240
+ "glumplich.de",
241
+ "gmail.de",
242
+ "go.ru",
243
+ "gold2world.biz",
244
+ "gold-profits.info",
245
+ "golfilla.info",
246
+ "google.com",
247
+ "google.de",
248
+ "great-host.in",
249
+ "greensloth.com",
250
+ "grifon.info",
251
+ "guerillamail.com",
252
+ "guerillamail.org",
253
+ "guerrillamail.biz",
254
+ "guerrillamail.com",
255
+ "guerrillamail.de",
256
+ "guerrillamail.info",
257
+ "guerrillamail.net",
258
+ "guerrillamail.org",
259
+ "guerrillamailblock.com",
260
+ "gustr.com",
261
+ "hacker.tl",
262
+ "haltospam.com",
263
+ "halyava.ru",
264
+ "hasakah.com",
265
+ "hebron.tv",
266
+ "hidemail.de",
267
+ "hidzz.com",
268
+ "hinet.net",
269
+ "hmamail.com",
270
+ "hochsitze.com",
271
+ "hollister.susangmail.com",
272
+ "homedns.org",
273
+ "hotbox.ru",
274
+ "hotmail.ru",
275
+ "hotpop.com",
276
+ "hulapla.de",
277
+ "humaility.com",
278
+ "humality.com",
279
+ "hush.ai",
280
+ "hush.com",
281
+ "hushmail.com",
282
+ "hushmail.me",
283
+ "id.ru",
284
+ "ieatspam.eu",
285
+ "ieatspam.info",
286
+ "ieh-mail.de",
287
+ "iespana.es",
288
+ "ignoremail.com",
289
+ "image-space.biz",
290
+ "imails.info",
291
+ "inbox.ru",
292
+ "inbox.si",
293
+ "inboxclean.com",
294
+ "incognitomail.com",
295
+ "incognitomail.net",
296
+ "incognitomail.org",
297
+ "ingetspam.com",
298
+ "insorg-mail.info",
299
+ "instant-mail.de",
300
+ "ip6.li",
301
+ "ipoo.org",
302
+ "irbid.ws",
303
+ "irish2me.com",
304
+ "irishspringrealty.com",
305
+ "is.af",
306
+ "islammail.net",
307
+ "isuisse.com",
308
+ "ivym.de",
309
+ "jadida.org",
310
+ "jetable.com",
311
+ "jetable.net",
312
+ "jetable.org",
313
+ "jnxjn.com",
314
+ "jourrapide.com",
315
+ "junk.to",
316
+ "junk1e.com",
317
+ "junkmaniac.info",
318
+ "kaktusmail.de",
319
+ "kasmail.com",
320
+ "keepmymail.com",
321
+ "key-mail.net",
322
+ "klzlk.com",
323
+ "kokusu.net",
324
+ "korsun.pp.ru",
325
+ "kuh.mu",
326
+ "kulturbetrieb.info",
327
+ "kurzepost.de",
328
+ "kuwaiti.tv",
329
+ "lags.us",
330
+ "land.ru",
331
+ "lawlita.com",
332
+ "lenta.ru",
333
+ "less.b0ne.com",
334
+ "less.ns0.it",
335
+ "letthemeatspam.com",
336
+ "lhsdv.com",
337
+ "lifebyfood.com",
338
+ "link2mail.net",
339
+ "list.ru",
340
+ "litedrop.com",
341
+ "livedoor.com",
342
+ "llogin.ru",
343
+ "localhost",
344
+ "localhost.com",
345
+ "localhost.localdomain",
346
+ "localhost.net",
347
+ "localhost.org",
348
+ "lolfreak.net",
349
+ "lookugly.com",
350
+ "losemymail.com",
351
+ "lr78.com",
352
+ "lubnan.ws",
353
+ "luckymail.org",
354
+ "m4ilweb.info",
355
+ "mail.by",
356
+ "mail.ru",
357
+ "mail15.com",
358
+ "mail333.com",
359
+ "mail4trash.com",
360
+ "mailbiz.biz",
361
+ "mailcatch.com",
362
+ "mailde.de",
363
+ "mailde.info",
364
+ "maileater.com",
365
+ "maileimer.de",
366
+ "mailexpire.com",
367
+ "mailfish.de",
368
+ "mailforspam.com",
369
+ "mailgate.ru",
370
+ "mailin8r.com",
371
+ "mailinater.com",
372
+ "mailinator.com",
373
+ "mailinator.net",
374
+ "mailinator2.com",
375
+ "mailinator99.com",
376
+ "mail-it24.com",
377
+ "mailme.ir",
378
+ "mailme.lv",
379
+ "mailme24.com",
380
+ "mailmetrash.com",
381
+ "mailmoat.com",
382
+ "mailms.com",
383
+ "mailnator.com",
384
+ "mailnesia.com",
385
+ "mailnull.com",
386
+ "mailorg.org",
387
+ "mailscrap.com",
388
+ "mailseal.de",
389
+ "mailshell.com",
390
+ "mailslite.com",
391
+ "mailswift.net",
392
+ "mail-temporaire.fr",
393
+ "mailtome.de",
394
+ "mailtrash.net",
395
+ "mailtv.net",
396
+ "mailtv.tv",
397
+ "mailzilla.org",
398
+ "makemetheking.com",
399
+ "malahov.de",
400
+ "mansoura.tv",
401
+ "marketingops.com",
402
+ "marsmail.de",
403
+ "marsmail.eu",
404
+ "mascara.ws",
405
+ "masterhost.ru",
406
+ "mega.yt",
407
+ "mega.zik.dj",
408
+ "meltmail.com",
409
+ "messagebeamer.de",
410
+ "mezimages.net",
411
+ "mickey1a.com",
412
+ "mierdamail.com",
413
+ "minelab.ru",
414
+ "ministry-of-silly-walks.de",
415
+ "mintemail.com",
416
+ "misterpinball.de",
417
+ "moburl.com",
418
+ "moyareklama.ru",
419
+ "msa.minsmail.com",
420
+ "mt2009.com",
421
+ "mufmail.com",
422
+ "muscat.tv",
423
+ "muscat.ws",
424
+ "muuh.info",
425
+ "muzikutusu.com",
426
+ "mx0.www.new.eu",
427
+ "my10minutemail.com",
428
+ "mycleaninbox.net",
429
+ "my-inbox.in",
430
+ "mypartyclip.de",
431
+ "myphantomemail.com",
432
+ "myrambler.ru",
433
+ "mysamp.de",
434
+ "mytempemail.com",
435
+ "mytempmail.com",
436
+ "mytrashmail.com",
437
+ "myxost.com",
438
+ "nabeul.info",
439
+ "nabuma.com",
440
+ "nepwk.com",
441
+ "ne-quid-nimis.info",
442
+ "nervmich.net",
443
+ "nervtmich.net",
444
+ "netmails.net",
445
+ "netzidiot.de",
446
+ "neverbox.com",
447
+ "nevermail.com",
448
+ "nevermail.de",
449
+ "newmail.ru",
450
+ "nextmail.ru",
451
+ "nice-4u.com",
452
+ "nightmail.ru",
453
+ "nil-admirari.info",
454
+ "nlogn.de",
455
+ "nlspam.it",
456
+ "nm.ru",
457
+ "nobugmail.com",
458
+ "nobulk.com",
459
+ "nobuma.com",
460
+ "noclickemail.com",
461
+ "nodns.org",
462
+ "nogmailspam.info",
463
+ "nomail2me.com",
464
+ "no-more-spam.com",
465
+ "nomorespamemails.com",
466
+ "nospam.blafussel.com",
467
+ "no-spam.hu",
468
+ "no-spam.ws",
469
+ "nospam.ze.tc",
470
+ "nospam4.us",
471
+ "nospamfor.us",
472
+ "nospammail.net",
473
+ "nospamthanks.info",
474
+ "notmail.ru",
475
+ "notmailinator.com",
476
+ "notmyemail.com",
477
+ "notsharingmy.info",
478
+ "nowmymail.com",
479
+ "nurfuerspam.de",
480
+ "nwldx.com",
481
+ "objectmail.com",
482
+ "obobbo.com",
483
+ "octivian.com",
484
+ "odnorazovoe.ru",
485
+ "ohaaa.de",
486
+ "ok.ru",
487
+ "oleco.net",
488
+ "omail.pro",
489
+ "omani.ws",
490
+ "one.lt",
491
+ "oneoffemail.com",
492
+ "oneoffmail.com",
493
+ "onewaymail.com",
494
+ "onlatedotcom.info",
495
+ "online.ms",
496
+ "opayq.com",
497
+ "otherinbox.com",
498
+ "oued.info",
499
+ "oued.org",
500
+ "oujda.biz",
501
+ "ouyamaichang.com",
502
+ "ovpn.to",
503
+ "owlpic.com",
504
+ "pakistani.ws",
505
+ "palmyra.ws",
506
+ "pisem.net",
507
+ "pjjkp.com",
508
+ "pleasantphoto.com",
509
+ "plexolan.de",
510
+ "pochta.ru",
511
+ "pochtamt.ru",
512
+ "politikerclub.de",
513
+ "pookmail.com",
514
+ "pooperduperzgmail.com",
515
+ "pop3.ru",
516
+ "porn.com",
517
+ "pornoroxx.net",
518
+ "prescrip.pl",
519
+ "privacy.net",
520
+ "privacybox.net",
521
+ "privatdemail.net",
522
+ "privy-mail.com",
523
+ "privymail.de",
524
+ "privy-mail.de",
525
+ "proxymail.eu",
526
+ "prtnx.com",
527
+ "punkass.com",
528
+ "put2.net",
529
+ "putthisinyourspamdatabase.com",
530
+ "qlfg.com",
531
+ "qq.com",
532
+ "quickinbox.com",
533
+ "r0.ru",
534
+ "rambler.ru",
535
+ "rbcmail.ru",
536
+ "rcpt.at",
537
+ "receiveee.com",
538
+ "recode.me",
539
+ "regbypass.com",
540
+ "reitkopf.com",
541
+ "rfc822.org",
542
+ "rhyta.com",
543
+ "rmqkr.net",
544
+ "ro.ru",
545
+ "rppkn.com",
546
+ "rtrtr.com",
547
+ "ru.ru",
548
+ "s0ny.net",
549
+ "safat.biz",
550
+ "safat.info",
551
+ "safat.us",
552
+ "safat.ws",
553
+ "safe-mail.net",
554
+ "safersignup.com",
555
+ "safersignup.de",
556
+ "safetymail.info",
557
+ "safetypost.de",
558
+ "salmiya.biz",
559
+ "sandelf.de",
560
+ "sawoe.com",
561
+ "saynotospams.com",
562
+ "schafmail.de",
563
+ "schrott-email.de",
564
+ "secmail.in",
565
+ "secretemail.de",
566
+ "secure-email.org",
567
+ "secure-mail.biz",
568
+ "selfdestructingmail.com",
569
+ "sendmail.ru",
570
+ "sendspamhere.com",
571
+ "senseless-entertainment.com",
572
+ "server.ms",
573
+ "sfax.ws",
574
+ "sharklasers.com",
575
+ "shieldemail.com",
576
+ "shitmail.me",
577
+ "shitmail.org",
578
+ "sibmail.com",
579
+ "sina.com",
580
+ "sinnlos-mail.de",
581
+ "skeefmail.com",
582
+ "skim.com",
583
+ "sky-ts.de",
584
+ "slopsbox.com",
585
+ "smeh.info",
586
+ "smellfear.com",
587
+ "smtp.ru",
588
+ "snakemail.com",
589
+ "sneakemail.com",
590
+ "snkmail.com",
591
+ "sofimail.com",
592
+ "sofort-mail.com",
593
+ "sofortmail.de",
594
+ "sofort-mail.de",
595
+ "sogetthis.com",
596
+ "soodonims.com",
597
+ "spam.la",
598
+ "spam4.me",
599
+ "spamail.de",
600
+ "spamavert.com",
601
+ "spamavert.no",
602
+ "spambob",
603
+ "spambob.com",
604
+ "spambob.net",
605
+ "spambob.org",
606
+ "spambog.com",
607
+ "spambog.de",
608
+ "spambog.ru",
609
+ "spambooger.com",
610
+ "spambox.info",
611
+ "spambox.us",
612
+ "spamcero.com",
613
+ "spamcorptastic.com",
614
+ "spamday.com",
615
+ "spamex.com",
616
+ "spamfence.net",
617
+ "spamfoodie.com",
618
+ "spamfree.eu",
619
+ "spamfree24.com",
620
+ "spamfree24.de",
621
+ "spamfree24.eu",
622
+ "spamfree24.info",
623
+ "spamfree24.net",
624
+ "spamfree24.org",
625
+ "spamgourmet.com",
626
+ "spamherelots.com",
627
+ "spamhereplease.com",
628
+ "spamhole.com",
629
+ "spamify.com",
630
+ "spaminator.de",
631
+ "spamkill.info",
632
+ "spaml.com",
633
+ "spaml.de",
634
+ "spammotel.com",
635
+ "spamobox.com",
636
+ "spamscams.net",
637
+ "spamspot.com",
638
+ "spamthis.co.uk",
639
+ "spamthisplease.com",
640
+ "spamtrail.com",
641
+ "spamx.ru",
642
+ "speed.1s.fr",
643
+ "speedmail.de",
644
+ "spoofmail.de",
645
+ "squizzy.de",
646
+ "sriaus.com",
647
+ "stinkefinger.net",
648
+ "stuffmail.de",
649
+ "super-auswahl.de",
650
+ "supergreatmail.com",
651
+ "superstachel.de",
652
+ "suremail.info",
653
+ "teewars.org",
654
+ "tele-vision.info",
655
+ "teleworm.com",
656
+ "tempail.com",
657
+ "tempalias.com",
658
+ "tempemail.biz",
659
+ "tempemail.com",
660
+ "tempe-mail.com",
661
+ "tempemail.net",
662
+ "tempinbox.co.uk",
663
+ "tempinbox.com",
664
+ "tempmail.info",
665
+ "tempmail.it",
666
+ "tempmail.org",
667
+ "temp-mail.org",
668
+ "temp-mail.ru",
669
+ "tempmail2.com",
670
+ "tempmaildemo.com",
671
+ "tempmailer.com",
672
+ "tempmailer.de",
673
+ "tempomail.fr",
674
+ "temporarily.de",
675
+ "temporarioemail.com.br",
676
+ "temporaryemail.net",
677
+ "temporaryemailid.com",
678
+ "temporaryforwarding.com",
679
+ "temporaryinbox.com",
680
+ "temporarymailaddress.com",
681
+ "thanksnospam.info",
682
+ "thankyou2010.com",
683
+ "thc.st",
684
+ "theanonymousemail.com",
685
+ "thecannabishunter.com",
686
+ "thisisnotmyrealemail.com",
687
+ "thismail.net",
688
+ "throwawayaddress.com",
689
+ "throwawayemailaddress.com",
690
+ "throwawaymail.com",
691
+ "tilien.com",
692
+ "tmailinator.com",
693
+ "tom.com",
694
+ "topranklist.de",
695
+ "tormail.org",
696
+ "tradedoubling.co.uk",
697
+ "tradermail.info",
698
+ "trash2009.com",
699
+ "trash-amil.com",
700
+ "trashbox.eu",
701
+ "trashdevil.com",
702
+ "trashdevil.de",
703
+ "trashemail.de",
704
+ "trashinbox.com",
705
+ "trashmail.at",
706
+ "trash-mail.at",
707
+ "trashmail.com",
708
+ "trash-mail.com",
709
+ "trashmail.de",
710
+ "trash-mail.de",
711
+ "trashmail.me",
712
+ "trashmail.net",
713
+ "trashmail.ws",
714
+ "trashmailer.com",
715
+ "trashymail.com",
716
+ "trashymail.net",
717
+ "trialmail.de",
718
+ "trillianpro.com",
719
+ "tut.by",
720
+ "twinmail.de",
721
+ "tyldd.com",
722
+ "uggsrock.com",
723
+ "ukr.net",
724
+ "us.af",
725
+ "users.1go.dk",
726
+ "veryrealemail.com",
727
+ "vistomail.com",
728
+ "vpn.st",
729
+ "vpnsmail.me",
730
+ "vxaz.com",
731
+ "w00ttech.com",
732
+ "watchfull.net",
733
+ "watch-harry-potter.com",
734
+ "webm4il.info",
735
+ "wegwerfadresse.de",
736
+ "wegwerfemail.com",
737
+ "wegwerfemail.de",
738
+ "weg-werf-email.de",
739
+ "wegwerf-email.net",
740
+ "wegwerfemailadresse.com",
741
+ "wegwerf-email-adressen.de",
742
+ "wegwerf-emails.de",
743
+ "wegwerfmail.de",
744
+ "wegwerfmail.net",
745
+ "wegwerfmail.org",
746
+ "wh4f.org",
747
+ "whyspam.me",
748
+ "willhackforfood.biz",
749
+ "willselfdestruct.com",
750
+ "wreckedmail.net",
751
+ "wreckedmail.org",
752
+ "wuzup.net",
753
+ "wuzupmail.net",
754
+ "x3n.in",
755
+ "xents.com",
756
+ "xyzfree.net",
757
+ "yandex.ru",
758
+ "yeah.net",
759
+ "yestoa.com",
760
+ "yopmail.com",
761
+ "yopmail.fr",
762
+ "yopmail.net",
763
+ "youmailr.com",
764
+ "yourdomain.com",
765
+ "yufz.com",
766
+ "yuurok.com",
767
+ "yxzx.net",
768
+ "z1p.biz",
769
+ "zehnminuten.de",
770
+ "zehnminutenmail.de",
771
+ "zippymail.info",
772
+ "zmail.ru",
773
+ "zoaxe.com",
774
+ "zoemail.com",
775
+ "zoemail.net" ]
776
+ end
@@ -0,0 +1,3 @@
1
+ module SpamEmail
2
+ VERSION = "0.0.1"
3
+ end
data/lib/spam_email.rb ADDED
@@ -0,0 +1,20 @@
1
+ require "spam_email/version"
2
+ require "spam_email/domains"
3
+ require 'active_model'
4
+ require 'active_model/validations'
5
+ require 'mail'
6
+
7
+ I18n.load_path += Dir.glob(File.expand_path('../../config/locales/**/*',__FILE__))
8
+
9
+ class SpamEmailValidator < ActiveModel::EachValidator
10
+ def validate_each(record,attribute,value)
11
+ begin
12
+ m = Mail::Address.new(value)
13
+ return if m.domain.nil?
14
+ r = SpamEmail::BLACKLIST.include?(m.domain.downcase)
15
+ rescue Exception => e
16
+ r = false
17
+ end
18
+ record.errors[attribute] << (options[:message] || I18n.t(:blacklisted, scope: "spam_email.validations.email")) if r
19
+ end
20
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'spam_email/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "spam_email"
8
+ spec.version = SpamEmail::VERSION
9
+ spec.authors = ["Phillipp Röll"]
10
+ spec.email = ["phillipp@roell.ph"]
11
+ spec.description = %q{ActiveModel validation that checks email addresses against a blacklist of trash-mail providers}
12
+ spec.summary = %q{ActiveModel validation for spam/one-time email addresses}
13
+ spec.homepage = "https://github.com/phillipp/spam_email"
14
+ spec.license = "whatever"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^spec/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "rspec"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_runtime_dependency "mail"
24
+ spec.add_runtime_dependency "activemodel"
25
+ end
@@ -0,0 +1,57 @@
1
+ require 'spec_helper'
2
+
3
+ describe SpamEmailValidator do
4
+ record_class = Class.new do
5
+ include ActiveModel::Validations
6
+ attr_accessor :email
7
+ validates :email, :spam_email => true
8
+ end
9
+
10
+ shared_examples_for "Validating emails" do
11
+ before { I18n.locale = locale }
12
+
13
+ describe "#validate_each" do
14
+ subject { record_class.new }
15
+ before { subject.email = email }
16
+ before { subject.valid? }
17
+
18
+ context "email domain is listed in in blacklisted domains" do
19
+ let(:email) { 'johndoe@12minutemail.com' }
20
+ its(:valid?) { should be_false }
21
+ specify { subject.errors[:email].should == errors }
22
+ end
23
+
24
+ context "upcase provided email domain is listed in in blacklisted domains" do
25
+ let(:email) { 'johndoe@12MINUTEMAIL.com' }
26
+ its(:valid?) { should be_false }
27
+ specify { subject.errors[:email].should == errors }
28
+ end
29
+
30
+ context "email domain is not listed in in blacklisted domains" do
31
+ let(:email) { 'johndoe@lima-city.de' }
32
+ its(:valid?) { should be_true }
33
+ specify { subject.errors[:email].should be_empty }
34
+ end
35
+ end
36
+ end
37
+
38
+ context "german translation" do
39
+ let!(:locale) { :de }
40
+ let!(:errors) { [ "ist ein gesperrter E-Mail-Provider" ] }
41
+ it_should_behave_like "Validating emails"
42
+ end
43
+
44
+ context "english translation" do
45
+ let!(:locale) { :en }
46
+ let!(:errors) { [ "is a blacklisted email provider" ] }
47
+ it_should_behave_like "Validating emails"
48
+ end
49
+
50
+ context "french translation" do
51
+ let!(:locale) { :fr }
52
+
53
+ # sorry, google translate ;-D
54
+ let!(:errors) { [ "est un fournisseur e-mail interdit" ] }
55
+ it_should_behave_like "Validating emails"
56
+ end
57
+ end
@@ -0,0 +1,2 @@
1
+ $:.unshift File.expand_path('../../lib',__FILE__)
2
+ require 'spam_email'
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spam_email
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Phillipp Röll
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mail
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: activemodel
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: ActiveModel validation that checks email addresses against a blacklist
70
+ of trash-mail providers
71
+ email:
72
+ - phillipp@roell.ph
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - config/locales/de.yml
83
+ - config/locales/en.yml
84
+ - config/locales/fr.yml
85
+ - lib/spam_email.rb
86
+ - lib/spam_email/domains.rb
87
+ - lib/spam_email/version.rb
88
+ - spam_email.gemspec
89
+ - spec/spam_email_validator_spec.rb
90
+ - spec/spec_helper.rb
91
+ homepage: https://github.com/phillipp/spam_email
92
+ licenses:
93
+ - whatever
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.1.10
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: ActiveModel validation for spam/one-time email addresses
115
+ test_files:
116
+ - spec/spam_email_validator_spec.rb
117
+ - spec/spec_helper.rb