-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.py
207 lines (199 loc) · 7.48 KB
/
mail.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import requests
import json
import sys
import os
import random
import urllib3
import time
import string
s=requests.Session()
urllib3.disable_warnings()
def sendEmailF(s,fron,letter,subject,link,mail):
z = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
payload={
'action': 'score',
'senderEmail': 'support'+str(z)+'@'+str(str(link).split("/")[2]),
'senderName': str(fron),
'replyTo': '',
'subject': str(subject),
'messageLetter': str(letter),
'emailList': str(mail),
'messageType': '1',
'charset': 'UTF-8',
'encode': '8bit',
'action': 'send'
}
files=[]
headers = {
'authority': str(str(link).split("/")[2]),
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-language': 'en-US,en;q=0.9,ar;q=0.8',
'cache-control': 'max-age=0',
'cookie': 'PHPSESSID=f0ri3cqgvh28e0upaagsgcurdr',
'origin': 'https://'+str(str(link).split("/")[2]),
'referer': str(link),
'sec-ch-ua': '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'same-origin',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
}
s.post(link, headers=headers, data=payload, files=files, verify=False)
def sendEmail(s,mail,link):
z = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
payload={
'action': 'score',
'senderEmail': 'support'+str(z)+'@'+str(str(link).split("/")[2]),
'senderName': 'support'+str(z)+'@'+str(str(link).split("/")[2]),
'replyTo': '',
'subject': 'ARON-TN',
'messageLetter': 'ARON-TN',
'emailList': str(mail),
'messageType': '1',
'charset': 'UTF-8',
'encode': '8bit',
'action': 'send'
}
files=[]
headers = {
'authority': str(str(link).split("/")[2]),
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-language': 'en-US,en;q=0.9,ar;q=0.8',
'cache-control': 'max-age=0',
'cookie': 'PHPSESSID=f0ri3cqgvh28e0upaagsgcurdr',
'origin': 'https://'+str(str(link).split("/")[2]),
'referer': str(link),
'sec-ch-ua': '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'same-origin',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
}
s.post(link, headers=headers, data=payload, files=files, verify=False)
def sezz(s,link):
url = "https://api.internal.temp-mail.io/api/v3/email/new"
x = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
payload = "{\"name\":\""+str(x)+"\",\"domain\":\"best-john-boats.com\"}"
headers = {
'authority': 'api.internal.temp-mail.io',
'accept': 'application/json, text/plain, */*',
'accept-language': 'en-US,en;q=0.9,ar;q=0.8',
'application-name': 'web',
'application-version': '2.2.29',
'content-type': 'application/json;charset=UTF-8',
'cookie': '_ga=GA1.2.471563460.1673987461; _gid=GA1.2.1556396931.1673987461; _gat=1',
'origin': 'https://temp-mail.io',
'referer': 'https://temp-mail.io/',
'sec-ch-ua': '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
}
response = s.post(url, headers=headers, data=payload, verify=False).json()
while(len(str(response["token"]))<1):
x = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
payload = "{\"name\":\""+str(x)+"\",\"domain\":\"best-john-boats.com\"}"
response = s.post(url, headers=headers, data=payload, verify=False).json()
mail=str(response["email"])
sendEmail(s,str(mail),str(link))
url = "https://api.internal.temp-mail.io/api/v3/email/"+str(mail)+"/messages"
payload={}
headers = {
'authority': 'api.internal.temp-mail.io',
'accept': 'application/json, text/plain, */*',
'accept-language': 'en-US,en;q=0.9,ar;q=0.8',
'application-name': 'web',
'application-version': '2.2.29',
'cookie': '_ga=GA1.2.471563460.1673987461; _gid=GA1.2.1556396931.1673987461; _gat=1',
'origin': 'https://temp-mail.io',
'referer': 'https://temp-mail.io/',
'sec-ch-ua': '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
}
cus = 0
tyr = ""
getnotif = s.get(url, headers=headers, data=payload, verify=False).text
while("ARON-TN" not in str(getnotif)):
getnotif = s.get(url, headers=headers, data=payload, verify=False).text
print("Waiting .....")
time.sleep(4)
cus+=1
if(cus==10):
tyr = "Timeout"
break
if(tyr == "Timeout") : return False
else : return True
#letter.txt
#letterContent = "hhh.txt"
letterContent = str(input("Letter > "))
#sendername = "USPzS"
sendername = str(input("Sender Name > "))
#subject = "Subject"
subject = str(input("Subject > "))
#mail_list = "ma.txt"
mail_list = str(input("Mail list > "))
#sites_list = "sites.txt"
sites_list = str(input("Mailers list > "))
#how_many_per_mailer = 5
how_many_per_mailer = int(input("switch mailer after sending > "))
#######################################
c = []
emails=open(mail_list,'r', encoding='UTF-8', errors='ignore').read().splitlines()
for i in emails:
c.append(str(i))
#######################################
sitel = []
sites=open(sites_list,'r', encoding='UTF-8', errors='ignore').read().splitlines()
for i in sites:
sitel.append(str(i))
#######################################
tota = str(len(c))
ii = -1
sn = 0
cbon = True
while cbon:
if(len(c)==0) : cbon = False;break
if(len(sitel)==0) : cbon = False;break
if(ii==len(sitel)) : ii = -1
else : ii+= 1
print(f"Testing Site {str(sitel[ii])}")
if(sezz(s,str(sitel[ii]))) :
print(f"{str(str(sitel[ii]))} > Delivery working !")
with open(letterContent, "r") as f: contents = f.read()
if(len(c)>int(how_many_per_mailer)):
for _ in range(int(how_many_per_mailer)):
sn+=1
print(f"{str(sn)}/{str(tota)} sending to > {str(c[0])} From {str(sitel[ii])}")
sendEmailF(s,str(sendername),str(contents),str(subject),str(sitel[ii]),str(c[0]))
c.remove(str(c[0]))
else:
for _ in range(len(c)):
sn+=1
print(f"{str(sn)}/{str(tota)} sending to > {str(c[0])} From {str(sitel[ii])}")
sendEmailF(s,str(sendername),str(contents),str(subject),str(sitel[ii]),str(c[0]))
c.remove(str(c[0]))
else :
print(f"{str(str(sitel[ii]))} > Delivery not working !!!")
sitel.remove(sitel[ii])
if(len(c)==0):
print("I sent all emails !!!")
elif(len(sitel)==0):
print("Please Add more mailers !")
else:
print("Something wrong ..")