Loading Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -13,4 +13,4 @@ RUN apk add --no-cache openssl \ COPY app/ . CMD [ "python3", "./main.py" ] No newline at end of file CMD [ "python3", "-u", "./main.py" ] app/main.py +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ class MyHandler(BaseHTTPRequestHandler): ssh.connect(hostname='postfixadmin', username='pfexec', password=os.environ['POSTFIXADMIN_SSH_PASSWORD']) stdin, stdout, stderr = ssh.exec_command(f'/postfixadmin/scripts/postfixadmin-cli mailbox view "{target_email}"') if "error: the email is not valid!" in stderr.read().lower(): if b"error: the email is not valid!" in stderr.read().lower(): self.respond(403, 'this username is already used') return Loading Loading
Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -13,4 +13,4 @@ RUN apk add --no-cache openssl \ COPY app/ . CMD [ "python3", "./main.py" ] No newline at end of file CMD [ "python3", "-u", "./main.py" ]
app/main.py +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ class MyHandler(BaseHTTPRequestHandler): ssh.connect(hostname='postfixadmin', username='pfexec', password=os.environ['POSTFIXADMIN_SSH_PASSWORD']) stdin, stdout, stderr = ssh.exec_command(f'/postfixadmin/scripts/postfixadmin-cli mailbox view "{target_email}"') if "error: the email is not valid!" in stderr.read().lower(): if b"error: the email is not valid!" in stderr.read().lower(): self.respond(403, 'this username is already used') return Loading