@ -6,6 +6,7 @@ import urllib
SUPPORTED_AUTH_METHODS = ["none", "plain"]
STATUSES = {
"authentication": ("Authentication credentials invalid", {
"imap": "AUTHENTICATIONFAILED",
@ -4,8 +4,10 @@ from mailu.internal import internal, nginx
import flask
@internal.route("/nginx")
@internal.route("/auth/email")
def nginx_authentication():
""" Main authentication endpoint for Nginx email server
"""
headers = nginx.handle_authentication(flask.request.headers)
response = flask.Response()
for key, value in headers.items():
@ -89,15 +89,15 @@ http {
server {
listen 127.0.0.1:8000;
location /internal {
proxy_pass http://admin;
location / {
proxy_pass http://admin/internal/;
}
mail {
server_name {{ HOSTNAMES.split(",")[0] }};
auth_http http://127.0.0.1:8000/internal/nginx;
auth_http http://127.0.0.1:8000/auth/email;
proxy_pass_error_message on;
{% if TLS and not TLS_ERROR %}