email_address 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7864361d639e8c0d2609782b1d4d02a2d8c497bf3080a6bb563e5a8eac7bdc6
4
- data.tar.gz: 1145528c90a7845ce092fae5791a8dde9d81a66709188d3a53eb9310a8e49e7e
3
+ metadata.gz: 5129f7fbc9c34749550a07cf447c0ae0ec1fadf711af9aa2f1dc193c0e1c5322
4
+ data.tar.gz: 5fb49593e6ad95576d400d9f4d3918fa2949b52a44540454c5016ccce00ca695
5
5
  SHA512:
6
- metadata.gz: a04d299269c34d29dc630335462bd8a6b778c9ce4eefa12ee5bb5a5f0e22fb6e435b4c84f413f6f194f8a2e8e4d94831d96f0cee3eef7fd28e8028bd839ffc85
7
- data.tar.gz: 44184ef5b1c631e9a7cde11b8570c49473cceda7649cc625a386bd6c5ec8cd9fae5b024db82c06a99d237b025a249db92835492f99cc781a44654fb56d6999cf
6
+ metadata.gz: cd741fa47ed63923c1cb83bce7139efe5469282d24c57bc987eda9e4686d89ac8aaa650b815324005cb792342395002c29648c0439ad5d4341bb0ae80fb58352
7
+ data.tar.gz: '0194608171e7fd2dcc68c1fb827ce12051a7cfc9e42d47cef6935503b0a6ae5f257b36e30bd977201b60193bfffa0a55bf7a11a039c8c9c5f90395cb9225cc59'
@@ -345,7 +345,7 @@ module EmailAddress
345
345
  # Returns an array of EmailAddress::Exchanger hosts configured in DNS.
346
346
  # The array will be empty if none are configured.
347
347
  def exchangers
348
- return nil if @config[:host_type] != :email || !self.dns_enabled?
348
+ #return nil if @config[:host_type] != :email || !self.dns_enabled?
349
349
  @_exchangers ||= EmailAddress::Exchanger.cached(self.dns_name, @config)
350
350
  end
351
351
 
@@ -412,7 +412,7 @@ module EmailAddress
412
412
 
413
413
  # True if the host name has valid MX servers configured in DNS
414
414
  def valid_mx?
415
- if self.exchangers.blank?
415
+ if self.exchangers.nil?
416
416
  set_error(:domain_unknown)
417
417
  elsif self.exchangers.mx_ips.size > 0
418
418
  if self.localhost? && !@config[:host_local]
@@ -430,10 +430,10 @@ module EmailAddress
430
430
  # True if the host_name passes Regular Expression match and size limits.
431
431
  def valid_format?
432
432
  if self.host_name =~ CANONICAL_HOST_REGEX && self.to_s.size <= MAX_HOST_LENGTH
433
- true
434
- else
435
- set_error(:domain_invalid)
433
+ return true if localhost?
434
+ return true if self.host_name.include?(".") # require FQDN
436
435
  end
436
+ set_error(:domain_invalid)
437
437
  end
438
438
 
439
439
  # Returns true if the IP address given in that form of the host name
@@ -307,8 +307,9 @@ module EmailAddress
307
307
  return set_error(:local_size_long) if self.local.size > STANDARD_MAX_SIZE
308
308
  if @host && @host.hosted_service?
309
309
  return false if @config[:local_private_size] && !valid_size_checks(@config[:local_private_size])
310
+ else
311
+ return false if @config[:local_size] && !valid_size_checks(@config[:local_size])
310
312
  end
311
- return false if @config[:local_size] && !valid_size_checks(@config[:local_size])
312
313
  return false if @config[:mailbox_size] && !valid_size_checks(@config[:mailbox_size])
313
314
  true
314
315
  end
@@ -1,3 +1,3 @@
1
1
  module EmailAddress
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
@@ -93,4 +93,10 @@ class TestLocal < MiniTest::Test
93
93
  assert_equal "us*****", EmailAddress::Local.new("User+tag").munge
94
94
  end
95
95
 
96
+ def test_hosted
97
+ assert EmailAddress.valid?("x@exposure.co")
98
+ assert EmailAddress.error("xxxx+subscriber@gmail.com")
99
+ assert EmailAddress.valid?("xxxxx+subscriber@gmail.com")
100
+ end
101
+
96
102
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_address
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Fair
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake