mirror of
				https://github.com/optim-enterprises-bv/Mailu.git
				synced 2025-10-31 18:18:05 +00:00 
			
		
		
		
	Rename the authentication endpoint
This commit is contained in:
		| @@ -6,6 +6,7 @@ import urllib | |||||||
|  |  | ||||||
| SUPPORTED_AUTH_METHODS = ["none", "plain"] | SUPPORTED_AUTH_METHODS = ["none", "plain"] | ||||||
|  |  | ||||||
|  |  | ||||||
| STATUSES = { | STATUSES = { | ||||||
|     "authentication": ("Authentication credentials invalid", { |     "authentication": ("Authentication credentials invalid", { | ||||||
|         "imap": "AUTHENTICATIONFAILED", |         "imap": "AUTHENTICATIONFAILED", | ||||||
|   | |||||||
| @@ -4,8 +4,10 @@ from mailu.internal import internal, nginx | |||||||
| import flask | import flask | ||||||
|  |  | ||||||
|  |  | ||||||
| @internal.route("/nginx") | @internal.route("/auth/email") | ||||||
| def nginx_authentication(): | def nginx_authentication(): | ||||||
|  |     """ Main authentication endpoint for Nginx email server | ||||||
|  |     """ | ||||||
|     headers = nginx.handle_authentication(flask.request.headers) |     headers = nginx.handle_authentication(flask.request.headers) | ||||||
|     response = flask.Response() |     response = flask.Response() | ||||||
|     for key, value in headers.items(): |     for key, value in headers.items(): | ||||||
|   | |||||||
| @@ -89,15 +89,15 @@ http { | |||||||
|     server { |     server { | ||||||
|       listen 127.0.0.1:8000; |       listen 127.0.0.1:8000; | ||||||
|  |  | ||||||
|       location /internal { |       location / { | ||||||
|         proxy_pass http://admin; |         proxy_pass http://admin/internal/; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| mail { | mail { | ||||||
|     server_name {{ HOSTNAMES.split(",")[0] }}; |     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; |     proxy_pass_error_message on; | ||||||
|  |  | ||||||
|     {% if TLS and not TLS_ERROR %} |     {% if TLS and not TLS_ERROR %} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 kaiyou
					kaiyou