mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 22:36:12 +01:00
correct function name
This commit is contained in:
@@ -350,6 +350,17 @@ class CloudManager:
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
TemFilePath = statusFile.split('panel/')[1]
|
||||||
|
|
||||||
|
try:
|
||||||
|
value = int(TemFilePath)
|
||||||
|
print(value)
|
||||||
|
except:
|
||||||
|
data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", }
|
||||||
|
json_data = json.dumps(data_ret)
|
||||||
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
statusData = open(statusFile, 'r').readlines()
|
statusData = open(statusFile, 'r').readlines()
|
||||||
try:
|
try:
|
||||||
lastLine = statusData[-1]
|
lastLine = statusData[-1]
|
||||||
|
|||||||
@@ -1,40 +1,50 @@
|
|||||||
|
#
|
||||||
|
# import imaplib
|
||||||
|
# import getpass
|
||||||
|
# from email import message_from_string
|
||||||
|
#
|
||||||
|
# # IMAP server settings
|
||||||
|
# imap_server = 'mail.wpmautic.net'
|
||||||
|
# imap_port = 993
|
||||||
|
#
|
||||||
|
# # User credentials
|
||||||
|
# email_address = 'usman@wpmautic.net'
|
||||||
|
# password = getpass.getpass("Enter your email password: ")
|
||||||
|
#
|
||||||
|
# # Connect to the IMAP server
|
||||||
|
# mail = imaplib.IMAP4_SSL(imap_server, imap_port)
|
||||||
|
#
|
||||||
|
# # Log in to the mailbox
|
||||||
|
# mail.login(email_address, password)
|
||||||
|
#
|
||||||
|
# # Select the INBOX
|
||||||
|
# mail.select("inbox")
|
||||||
|
#
|
||||||
|
# # Search for all emails in the INBOX
|
||||||
|
# result, data = mail.search(None, "ALL")
|
||||||
|
# email_ids = data[0].split()
|
||||||
|
#
|
||||||
|
# # Fetch and print header information for each email
|
||||||
|
# for email_id in email_ids:
|
||||||
|
# result, message_data = mail.fetch(email_id, "(BODY[HEADER.FIELDS (FROM TO SUBJECT DATE)])")
|
||||||
|
# raw_email = message_data[0][1].decode('utf-8')
|
||||||
|
# msg = message_from_string(raw_email)
|
||||||
|
# print(f"Email ID: {email_id}")
|
||||||
|
# print(f"From: {msg['From']}")
|
||||||
|
# print(f"To: {msg['To']}")
|
||||||
|
# print(f"Subject: {msg['Subject']}")
|
||||||
|
# print(f"Date: {msg['Date']}")
|
||||||
|
# print("-" * 30)
|
||||||
|
#
|
||||||
|
# # Logout
|
||||||
|
# mail.logout()
|
||||||
|
|
||||||
import imaplib
|
statusFile = '/home/cyberpanel/aASA'
|
||||||
import getpass
|
|
||||||
from email import message_from_string
|
|
||||||
|
|
||||||
# IMAP server settings
|
TemFilePath = statusFile.split('panel/')[1]
|
||||||
imap_server = 'mail.wpmautic.net'
|
|
||||||
imap_port = 993
|
|
||||||
|
|
||||||
# User credentials
|
try:
|
||||||
email_address = 'usman@wpmautic.net'
|
print(TemFilePath)
|
||||||
password = getpass.getpass("Enter your email password: ")
|
value = int(TemFilePath)
|
||||||
|
except BaseException as msg:
|
||||||
# Connect to the IMAP server
|
print(str(msg))
|
||||||
mail = imaplib.IMAP4_SSL(imap_server, imap_port)
|
|
||||||
|
|
||||||
# Log in to the mailbox
|
|
||||||
mail.login(email_address, password)
|
|
||||||
|
|
||||||
# Select the INBOX
|
|
||||||
mail.select("inbox")
|
|
||||||
|
|
||||||
# Search for all emails in the INBOX
|
|
||||||
result, data = mail.search(None, "ALL")
|
|
||||||
email_ids = data[0].split()
|
|
||||||
|
|
||||||
# Fetch and print header information for each email
|
|
||||||
for email_id in email_ids:
|
|
||||||
result, message_data = mail.fetch(email_id, "(BODY[HEADER.FIELDS (FROM TO SUBJECT DATE)])")
|
|
||||||
raw_email = message_data[0][1].decode('utf-8')
|
|
||||||
msg = message_from_string(raw_email)
|
|
||||||
print(f"Email ID: {email_id}")
|
|
||||||
print(f"From: {msg['From']}")
|
|
||||||
print(f"To: {msg['To']}")
|
|
||||||
print(f"Subject: {msg['Subject']}")
|
|
||||||
print(f"Date: {msg['Date']}")
|
|
||||||
print("-" * 30)
|
|
||||||
|
|
||||||
# Logout
|
|
||||||
mail.logout()
|
|
||||||
Reference in New Issue
Block a user