blackstack-core 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/functions.rb +16 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e20eda958e546f00eac3c382b48fed8db4f1135af8812aa7528451874a6062a6
4
- data.tar.gz: f80428ef50682e92675171df3bacaf3ace9fbf27c058ac06c33f8fc98cd6ebec
3
+ metadata.gz: 9592570e271e03c770578f608c104b7e558a100b0b91255f7f75cf5fab7e4444
4
+ data.tar.gz: 6ed68ac325242d9322b245d0eb8bf2ab122e2382fd037fdd548d13803e5d0bbc
5
5
  SHA512:
6
- metadata.gz: d20b57b719e81cf67cacd0f0b0138ac6e1d00a964fdb9f238f44f28d4f181580a38eaf80037b2ad39ddaaa02628b1d0e6a3d52edb8336dbb66ea10a586ad18fc
7
- data.tar.gz: aa8b0f4a23e5120eda417b785425fbe28d1990fba701c1d0b9e01ff8ecc3ca72defa45a601ef0ae2ee874973ad41d96915b2be51a720efe1b2427372eb18ca3b
6
+ metadata.gz: 837d52cbacb341147b22bb6f7fee9788498aa9efebcbeaf27cd0040536b8d6c5c4a4fe2f7c0d59ddcbf4b782ebf733c5c6318b86a7875ca8735e1e1963e26613
7
+ data.tar.gz: 4cb67494f9c10e06c72b465fc916076e7d1955fd552f0793505f5bab409fd8761cac90f5f8e4fabb0694653a9f0545a35cd3a66221754313d9ac02d0829bd9ba
data/lib/functions.rb CHANGED
@@ -819,6 +819,22 @@ module BlackStack
819
819
  return a
820
820
  end
821
821
 
822
+ # raise an exception if `email` is not a valid email address.
823
+ # return an array with the companies who are hosting an email address, by running the linux command `host`.
824
+ def self.getMailHandler(email)
825
+ value = email
826
+ # raise an exception if the data type is an email, but the email is not valid.
827
+ raise "Email #{value} is not valid" if !value.email?
828
+ # extract the domain from the email
829
+ domain = value.split('@').last
830
+ # run the `host` command
831
+ s = `host -t mx #{domain}`
832
+ # extract the domains from the output
833
+ a = s.split("\n").map { |l| l.split.last }
834
+ # extract the company who is hosting the mail
835
+ a.map { |d| d.split('.').last(2).join('.') }.uniq
836
+ end
837
+
822
838
  end # module Netting
823
839
 
824
840
  end # module BlackStack
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackstack-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-28 00:00:00.000000000 Z
11
+ date: 2023-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: content_spinning