Avoid blacklisting the webmail

master
kaiyou 7 years ago
parent e625bc9adb
commit baff8dd043

@ -1,6 +1,19 @@
from flask import Blueprint
from mailu import limiter
import socket
import flask
internal = Blueprint('internal', __name__)
internal = flask.Blueprint('internal', __name__)
@limiter.request_filter
def whitelist_webmail():
try:
return flask.request.headers["Client-Ip"] ==\
socket.gethostbyname("webmail")
except:
return False
from mailu.internal import views

Loading…
Cancel
Save