Skip to content

Commit e8d1237

Browse files
authored
V0.2.0
New argument: email New features: attachment download, ctrl + c functioned, 'n' to make new email without exit the program
1 parent a3107df commit e8d1237

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

emailinbox.py

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,49 +70,74 @@ def goRead(login, domain, eid):
7070
else:
7171
theRes = loads(theRes)
7272
table = PrettyTable()
73-
table.field_names = [f"{flgreen}Body", f"{fcyan}Attachments{fwhite}"]
73+
print(flwhite+theRes["textBody"]+"\n\n\n")
74+
table.field_names = [f"{fcyan}Attachments{fwhite}", f"{flyellow}Type{fwhite}", f"{flmagenta}Size (Bytes){fwhite}"]
75+
print("\n\n")
7476
try:
7577
for x in range(1000):
76-
table.add_row([flwhite+theRes["textBody"], fcyan+theRes["attachments"][x]+fwhite])
78+
table.add_row([fcyan+theRes["attachments"][x]["filename"], flyellow+theRes["attachments"][x]["contentType"], flmagenta+str(theRes["attachments"][x]["size"])])
7779

7880
except IndexError:
79-
table.add_row([flwhite+theRes["textBody"], ""])
80-
print(table)
81-
os.system('pause')
82-
tableTheInbox(login, domain)
81+
print(table)
82+
if len(theRes["attachments"]) > 0:
83+
try:
84+
fi = input(f'{fcyan}[+] Attachment to download (ctrl + c to cancel): ')
85+
attachment(login, domain, eid, fi)
86+
except KeyboardInterrupt:
87+
print(f'{flmagenta}\n[#] Cancelling...')
88+
89+
os.system('pause')
90+
tableTheInbox(login, domain)
8391

8492

8593
def tableTheInbox(login, domain):
8694
resInb = inbox(login, domain)
8795
ClrScrn()
88-
print(f"{fwhite}Email address: "+bcyan+login+bgreen+"@"+domain+resetall)
96+
print(f"{fwhite}Email address: "+bcyan+login+freset+"@"+bgreen+domain+resetall)
8997
theJson = resInb
9098
table = PrettyTable()
9199
table.field_names = [f"{flcyan}id",f"{flgreen}From",f"{flmagenta}Subject",f"{flyellow}Date"]
92100
for x in range(len(theJson)):
93101
table.add_row([flcyan+str(theJson[x]['id']),flgreen+theJson[x]['from'],flmagenta+theJson[x]['subject'],flyellow+theJson[x]['date']+freset])
94102
print(table)
95-
inp = input(f"{fgreen}[+] Message id to read (r to refresh inbox): ")
103+
print(f'{fyellow}r - Refresh the inbox\nn - Create new email.')
104+
try:
105+
inp = input(f"{fgreen}[+] Message id to read: ")
106+
except KeyboardInterrupt:
107+
print(f'{fred}\n[!] Exitting...')
108+
exit()
109+
110+
print(f'{fcyan}[#] Loading message...{fwhite}')
111+
96112
if inp == "r":
97113
tableTheInbox(login, domain)
114+
elif inp == "n":
115+
log = random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ")+str(random.randint(1,10000))
116+
dom = random.choice(["1secmail.com","1secmail.net","1secmail.org"])
117+
118+
119+
tableTheInbox(log, dom)
98120
else:
99121
goRead(login, domain, str(inp))
100122
def hlp():
101123
ClrScrn()
102124
table = PrettyTable()
103125
table.field_names = [f"{flred}Full Argument", f"{flgreen}Less Argument", f"{fwhite}Description"]
104126
table.add_row([f"{fred}--help", f"{fgreen}-h", f"{fwhite}Help. show this message"])
127+
table.add_row([f"{fred}--email", f"{fgreen}-e", f"{fwhite}A combination of login and domain like this, [email protected]\nPS: type it all for easy use including '@'"])
105128
table.add_row([f"{fred}--login", f"{fgreen}-l", f"{fwhite}username of email (ex. {bcyan}hanzo221{bmagenta}@{bgreen}1secmail.com{resetall} the cyan colored is 'login')"])
106129
table.add_row([f"{fred}--domain", f"{fgreen}-d", f"{fwhite}host of email (ex. {bcyan}hanzo221{bmagenta}@{bgreen}1secmail.com{resetall} the green colored is 'domain')"])
107130
print(table)
108131

109132
def initme():
110133
global arg_login
111134
global arg_domain
135+
global arg_email
112136

113137
parser = argparse.ArgumentParser(description="Disposable Email Generator and Inbox", add_help=False)
114138
parser.add_argument("-h", "--help", help="Help Menu", action="store_true")
115139

140+
parser.add_argument("-e", "--email", type=str)
116141
parser.add_argument("-l", "--login", type=str)
117142
parser.add_argument("-d", "--domain", type=str)
118143

@@ -127,6 +152,10 @@ def initme():
127152
arg_domain = args.domain
128153

129154
tableTheInbox(arg_login, arg_domain)
155+
elif '@' in args.email:
156+
arg_email = args.email.split('@')
157+
158+
tableTheInbox(arg_email[0], arg_email[1])
130159
else:
131160
log = random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ")+str(random.randint(1,10000))
132161
dom = random.choice(["1secmail.com","1secmail.net","1secmail.org"])

0 commit comments

Comments
 (0)