Updated imap-acct to be created independently

Committer: Tracker-Friendly <jliwin98@danwin1210.de>
This commit is contained in:
root 2023-11-04 17:27:55 +00:00
parent 1096ce0852
commit 33d6e8dbff
1 changed files with 4 additions and 1 deletions

5
app.py
View File

@ -17,7 +17,10 @@ def create_email_account(username, password):
cmd = ["echo", password, "|", "doas", "-u", "maddy", "maddy", "creds", "create", f"{username}@hectabit.org"]
result = subprocess.run(" ".join(cmd), shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode == 0:
cmd2 = ["doas", "-u", "maddy", "maddy", "imap-acct", "create", f"{username}@hectabit.org"]
result2 = subprocess.run(" ".join(cmd2), shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode == 0 and result2.returncode == 0:
# Command executed successfully
return True
else: