Advertisement
bug7sec

EMAIL FILTER (Mass Email Directory)

Feb 7th, 2020
22,683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 11.61 KB | None | 0 0
  1. # @Author: Nokia 1337
  2. # @Date:   2020-01-29 18:55:57
  3. # @Last Modified by:   Nokia 1337
  4. # @Last Modified time: 2020-02-07 17:39:20
  5.  
  6. BOLD='\e[1m'
  7. RED='\033[0;31m'
  8. GREEN='\033[0;32m'
  9. YELLOW='\033[0;33m'
  10. BLUE='\033[0;34m'
  11. MAENTA='\033[0;35m'
  12. LIGHTRED='\033[0;91m'
  13. LIGHTGREEN='\033[0;92m'
  14. LIGHTCYAN='\033[0;96m'
  15. BACKGREEN='\033[0;42m'
  16. BACKBLUE='\033[0;44m'
  17. NC='\033[0m'
  18.  
  19. mkdir "$(pwd)/backup"
  20. mkdir "$(pwd)/filter_email"
  21. mkdir "$(pwd)/filter_email/mix"
  22.  
  23. clear
  24.  
  25. printf "${YELLOW}----------------------------------------------------- ${NC}\n"
  26. printf "${LIGHTCYAN}[INFO]${NC}${LIGHTGREEN} Melakukan validasi email pada semua files${NC}\n"
  27.  
  28. hitung_files=1
  29. counter_files=$(ls *.txt | wc -l)
  30.  
  31. for namefiles in *.txt
  32. do
  33.  
  34.     printf "|------[${LIGHTGREEN}$hitung_files/$counter_files${NC}]-> ${YELLOW}$namefiles${NC} ..."
  35.     grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' $namefiles | awk '{print tolower($0)}' > temp_list && mv temp_list $namefiles
  36.     printf " ${GREEN}SELESAI!${NC}\n"
  37.  
  38.     #--------------------- PROSES FILTER ---------------------#
  39.     printf "|-----> ${YELLOW}HOTMAIL FAMILY${NC} ..."
  40.     grep -E "@hotmail|@live|@outlook|@msn" $namefiles | less >> "filter_email/hotmail.txt"
  41.     printf " ${GREEN}SELESAI!${NC} \n"
  42.  
  43.     printf "|-----> ${YELLOW}YAHOO FAMILY${NC} ..."
  44.     grep -E "@yahoo|@ymail|@rocketmail" $namefiles | less >> "filter_email/yahoo.txt"
  45.     printf " ${GREEN}SELESAI!${NC} \n"
  46.  
  47.     printf "|-----> ${YELLOW}AOL FAMILY${NC} ..."
  48.     grep -E "@aol|@aim." $namefiles | less >> "filter_email/aol.txt"
  49.     printf " ${GREEN}SELESAI!${NC} \n"
  50.  
  51.     printf "|-----> ${YELLOW}APPLE FAMILY${NC} ..."
  52.     grep -E "@me.|@icloud.|@mac." $namefiles | less >> "filter_email/applemail.txt"
  53.     printf " ${GREEN}SELESAI!${NC} \n"
  54.  
  55.     printf "|-----> ${YELLOW}SBC FAMILY${NC} ..."
  56.     grep -E "@juno.|@netzero|@optonline|@optimum|@att|@ameritech|@sbcglobal|@bellsouth|@flash|@nvbell|@pacbell|@prodigy|@snet|@swbell" $namefiles | less >> "filter_email/sbc.txt"
  57.     printf " ${GREEN}SELESAI!${NC} \n"
  58.  
  59.     printf "|-----> ${YELLOW}GMAIL FAMILY${NC} ..."
  60.     grep -E "@gmail|@google|@googlemail" $namefiles | less >> "filter_email/gmail.txt"
  61.     printf " ${GREEN}SELESAI!${NC} \n"
  62.  
  63.     printf "|-----> ${YELLOW}BIGPOND${NC} ..."
  64.     grep -E "@bigpond." $namefiles | less >> "filter_email/mix/bigpond.txt"
  65.     printf " ${GREEN}SELESAI!${NC} \n"
  66.  
  67.     printf "|-----> ${YELLOW}NTLWORLD${NC} ..."
  68.     grep -E "@ntlworld." $namefiles | less >> "filter_email/mix/ntlworld.txt"
  69.     printf " ${GREEN}SELESAI!${NC} \n"
  70.  
  71.     printf "|-----> ${YELLOW}SHAW${NC} ..."
  72.     grep -E "@shaw." $namefiles | less >> "filter_email/mix/shaw.txt"
  73.     printf " ${GREEN}SELESAI!${NC} \n"
  74.  
  75.     printf "|-----> ${YELLOW}COX${NC} ..."
  76.     grep -E "@cox." $namefiles | less >> "filter_email/mix/cox.txt"
  77.     printf " ${GREEN}SELESAI!${NC} \n"
  78.  
  79.     printf "|-----> ${YELLOW}YANDEX${NC} ..."
  80.     grep -E "@yandex." $namefiles | less >> "filter_email/mix/yandex.txt"
  81.     printf " ${GREEN}SELESAI!${NC} \n"
  82.  
  83.     printf "|-----> ${YELLOW}COMCAST${NC} ..."
  84.     grep -E "@comcast." $namefiles | less >> "filter_email/mix/comcast.txt"
  85.     printf " ${GREEN}SELESAI!${NC} \n"
  86.  
  87.     printf "|-----> ${YELLOW}VERIZON${NC} ..."
  88.     grep -E "@verizon." $namefiles | less >> "filter_email/mix/verizon.txt"
  89.     printf " ${GREEN}SELESAI!${NC} \n"
  90.  
  91.     printf "|-----> ${YELLOW}centurylink${NC} ..."
  92.     grep -E "@centurylink." $namefiles | less >> "filter_email/mix/centurylink.txt"
  93.     printf " ${GREEN}SELESAI!${NC} \n"
  94.  
  95.     printf "|-----> ${YELLOW}spectrum${NC} ..."
  96.     grep -E "@charter.|@spectrum." $namefiles | less >> "filter_email/mix/spectrum.txt"
  97.     printf " ${GREEN}SELESAI!${NC} \n"
  98.  
  99.     printf "|-----> ${YELLOW}suddenlink${NC} ..."
  100.     grep -E "@suddenlink." $namefiles | less >> "filter_email/mix/suddenlink.txt"
  101.     printf " ${GREEN}SELESAI!${NC} \n"
  102.  
  103.     printf "|-----> ${YELLOW}Onet${NC} ..."
  104.     grep -E "@onet." $namefiles | less >> "filter_email/mix/onet.txt"
  105.     printf " ${GREEN}SELESAI!${NC} \n"
  106.  
  107.     printf "|-----> ${YELLOW}t-online${NC} ..."
  108.     grep -E "@t-online.de." $namefiles | less >> "filter_email/mix/t-online.txt"
  109.     printf " ${GREEN}SELESAI!${NC} \n"
  110.  
  111.     printf "|-----> ${YELLOW}GMX FAMILY${NC} ..."
  112.     grep -E "@gmx.|@2trom.com|@accountant.com|@acdcfan.com|@activis.com|@activist.com|@adexec.com|@africamail.com|@aircraftmail.com|@allergist.com|@alumni.com|@alumnidirector.com|@angelic.com|@appraiser.net|@archaeologist.com|@arcticmail.com|@artlover.com|@asia-mail.com|@asia.com|@atheist.com|@auctioneer.net|@australiamail.com|@bartender.net|@bellair.net|@berlin.com|@bikerider.com|@birdlover.com|@blader.com|@boardermail.com|@brazilmail.com|@brew-master.com|@brew-meister.com|@bsdmail.com|@californiamail.com|@cash4u.com|@catlover.com|@cheerful.com|@chef.net|@chemist.com|@chinamail.com|@clerk.com|@clubmember.org|@collector.org|@columnist.com|@comic.com|@computer4u.com|@consultant.com|@contractor.net|@coolsite.net|@counselloer.com|@cutey.com|@cyber-wizard.com|@cyberdude.com|@cybergal.com|@cyberservices.com|@dallasmail.com|@dbzmail.com|@deleveryman.com|@diplomats.com|@disciples.com|@discofan.com|@disposable.com|@doglover.com|@doramail.com|@dr.com|@dublin.com|@dutchmail.com|@elvisfan.com|@email.com|@engineer.com|@englandmail.com|@europe.com|@europemail.com|@execs.com|@fastservice.com|@financier.com|@fireman.net|@galaxyhit.com|@gardener.com|@geologist.com|@germanymail.com|@gmx.com|@gmx.de|@graduate.org|@graphic-designer.com|@greenmail.net|@groupmail.com|@hackermail.com|@hairdresser.net|@hilarious.com|@hiphopfan.com|@homemail.com|@hot-shot.com|@housemail.com|@humanoid.net|@iname.com|@innocent.com|@inorbit.com|@instruction.com|@instructor.net|@insurer.com|@irelandmail.com|@israelmail.com|@italymail.com|@job4u.com|@jurnalist.com|@keromail.com|@kissfans.com|@kittymail.com|@koreamail.com|@legislator.com|@linuxmail.org|@lobbyist.com|@lovecat.com|@madonnafan.com|@mail-me.com|@mail.com|@marchmail.com|@metalfan.com|@mexicomail.com|@minister.com|@moscowmail.com|@munich.com|@musician.org|@muslim.com|@myself.com|@net-shopping.com|@ninfan.com|@nonpartisan.com|@null.net|@nycmail.com|@optician.com|@orthodontist.net|@pacific-ocean.com|@pacificwest.com|@pediatrician.com|@petlover.com|@photographer.net|@physicist.net|@planetmail.com|@planetmail.net|@polandmail.com|@politician.com|@post.com|@presidency.com|@priest.com|@programmer.net|@protestant.com|@publicist.com|@qualityservice.com|@radiologist.net|@raggaefan.com|@ravemail.com|@realtyagent.com|@reborn.com|@registerednurses.com|@reincarnate.com|@religious.com|@repairman.com|@representative.com|@rescueteam.com|@rocketship.com|@safrica.com|@saintly.com|@salesperson.net|@samerica.com|@sanfranmail.com|@scotlandmail.com|@secretary.net|@snakebite.com|@socialogist.com|@socialworker.net|@solution4u.com|@songwriter.com|@songwriter.net|@spainmail.com|@surgical.net|@swedenmail.com|@swissmail.com|@teachers.org|@tech-center.com|@techie.com|@techiie.com|@technologist.com|@tecnologist.com|@theplate.com|@therapist.net|@toke.com|@toothfairy.com|@torontomail.com|@tvstar.com|@umpire.com|@usa.com|@uymail.com|@webname.com|@worker.com|@workmail.com|@writeme.com" $namefiles | less >> "filter_email/gmx-family.txt"
  113.     printf " ${GREEN}SELESAI!${NC} \n"
  114.  
  115.     printf "|-----> ${YELLOW}OTHER${NC} ..."
  116.    
  117.     grep -v -E '@onet.|@hotmail.|@live.|@outlook.|@msn.|@yahoo.|@ymail.|@rocketmail.|@aol.|@aim.|@me.|@icloud.|@mac.|@juno.|@netzero.|@optonline.|@optimum.|@att.|@ameritech.|@sbcglobal.|@bellsouth.|@flash.|@nvbell.|@pacbell.|@prodigy.|@snet.|@swbell.|@gmail|@google|@googlemail|@bigpond.|@ntlworld.|@shaw.|@cox.|@yandex.|@comcast.|@verizon.|@centurylink.|@charter.|@spectrum.|@suddenlink.|@gmx.|@aim.|@2trom.com|@accountant.com|@acdcfan.com|@activis.com|@activist.com|@adexec.com|@africamail.com|@aircraftmail.com|@allergist.com|@alumni.com|@alumnidirector.com|@angelic.com|@appraiser.net|@archaeologist.com|@arcticmail.com|@artlover.com|@asia-mail.com|@asia.com|@atheist.com|@auctioneer.net|@australiamail.com|@bartender.net|@bellair.net|@berlin.com|@bikerider.com|@birdlover.com|@blader.com|@boardermail.com|@brazilmail.com|@brew-master.com|@brew-meister.com|@bsdmail.com|@californiamail.com|@cash4u.com|@catlover.com|@cheerful.com|@chef.net|@chemist.com|@chinamail.com|@clerk.com|@clubmember.org|@collector.org|@columnist.com|@comic.com|@computer4u.com|@consultant.com|@contractor.net|@coolsite.net|@counselloer.com|@cutey.com|@cyber-wizard.com|@cyberdude.com|@cybergal.com|@cyberservices.com|@dallasmail.com|@dbzmail.com|@deleveryman.com|@diplomats.com|@disciples.com|@discofan.com|@disposable.com|@doglover.com|@doramail.com|@dr.com|@dublin.com|@dutchmail.com|@elvisfan.com|@email.com|@engineer.com|@englandmail.com|@europe.com|@europemail.com|@execs.com|@fastservice.com|@financier.com|@fireman.net|@galaxyhit.com|@gardener.com|@geologist.com|@germanymail.com|@gmx.com|@gmx.de|@graduate.org|@graphic-designer.com|@greenmail.net|@groupmail.com|@hackermail.com|@hairdresser.net|@hilarious.com|@hiphopfan.com|@homemail.com|@hot-shot.com|@housemail.com|@humanoid.net|@iname.com|@innocent.com|@inorbit.com|@instruction.com|@instructor.net|@insurer.com|@irelandmail.com|@israelmail.com|@italymail.com|@job4u.com|@jurnalist.com|@keromail.com|@kissfans.com|@kittymail.com|@koreamail.com|@legislator.com|@linuxmail.org|@lobbyist.com|@lovecat.com|@madonnafan.com|@mail-me.com|@mail.com|@marchmail.com|@metalfan.com|@mexicomail.com|@minister.com|@moscowmail.com|@munich.com|@musician.org|@muslim.com|@myself.com|@net-shopping.com|@ninfan.com|@nonpartisan.com|@null.net|@nycmail.com|@optician.com|@orthodontist.net|@pacific-ocean.com|@pacificwest.com|@pediatrician.com|@petlover.com|@photographer.net|@physicist.net|@planetmail.com|@planetmail.net|@polandmail.com|@politician.com|@post.com|@presidency.com|@priest.com|@programmer.net|@protestant.com|@publicist.com|@qualityservice.com|@radiologist.net|@raggaefan.com|@ravemail.com|@realtyagent.com|@reborn.com|@registerednurses.com|@reincarnate.com|@religious.com|@repairman.com|@representative.com|@rescueteam.com|@rocketship.com|@safrica.com|@saintly.com|@salesperson.net|@samerica.com|@sanfranmail.com|@scotlandmail.com|@secretary.net|@snakebite.com|@socialogist.com|@socialworker.net|@solution4u.com|@songwriter.com|@songwriter.net|@spainmail.com|@surgical.net|@swedenmail.com|@swissmail.com|@teachers.org|@tech-center.com|@techie.com|@techiie.com|@technologist.com|@tecnologist.com|@theplate.com|@therapist.net|@toke.com|@toothfairy.com|@torontomail.com|@tvstar.com|@umpire.com|@usa.com|@uymail.com|@webname.com|@worker.com|@workmail.com|@writeme.com' $namefiles | less >> "filter_email/other.txt"
  118.  
  119.     printf " ${GREEN}SELESAI!${NC} \n"
  120.     printf "|-[ PINDAHKAN FILES ${YELLOW}$namefiles${NC} KE FOLDER BACKUP ]-\n"
  121.  
  122.     mv $namefiles backup
  123.  
  124.     ((hitung_files=hitung_files+1))
  125.  
  126. done
  127.  
  128. printf "${YELLOW}----------------------------------------------------- ${NC}\n"
  129. printf "${LIGHTCYAN}[INFO]${NC}${LIGHTGREEN}  Pencarian emailist berdasarkan Negara\n"
  130.  
  131. printf "  |--> ${YELLOW}Other Country JP${NC} ..."
  132. grep '@.\+\.jp$' "filter_email/other.txt" | less >> "filter_email/mix/country-jp.txt"
  133. printf " ${GREEN}SELESAI!${NC} \n"
  134.  
  135. printf "  |--> ${YELLOW}Other Country DE${NC} ..."
  136. grep '@.\+\.de$' "filter_email/other.txt" | less >> "filter_email/mix/country-de.txt"
  137. printf " ${GREEN}SELESAI!${NC} \n"
  138.  
  139. printf "  |--> ${YELLOW}Other Country FR${NC} ..."
  140. grep '@.\+\.fr$' "filter_email/other.txt" | less >> "filter_email/mix/country-fr.txt"
  141. printf " ${GREEN}SELESAI!${NC} \n"
  142.  
  143. printf "  |--> ${YELLOW}Other Country CA${NC} ..."
  144. grep '@.\+\.ca$' "filter_email/other.txt" | less >> "filter_email/mix/country-ca.txt"
  145. printf " ${GREEN}SELESAI!${NC} \n"
  146.  
  147. printf "  |--> ${YELLOW}Other Country AU${NC} ..."
  148. grep '@.\+\.au$' "filter_email/other.txt" | less >> "filter_email/mix/country-au.txt"
  149. printf " ${GREEN}SELESAI!${NC} \n"
  150.  
  151. cat "filter_email/other.txt" >> "filter_email/other.list"
  152. rm -rf "filter_email/other.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement