This commit is contained in:
20
app.py
Normal file
20
app.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from flask import Flask, request, Response
|
||||
import jinja2
|
||||
|
||||
app = Flask(__name__)
|
||||
env = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader('templates'),
|
||||
autoescape=jinja2.select_autoescape(['xml'])
|
||||
)
|
||||
|
||||
@app.route('/mail/config-v1.1.xml')
|
||||
def thunderbird_config():
|
||||
domain = request.host.split('.', 1)[1]
|
||||
xml = env.get_template('config-v1.1.xml.j2').render(DOMAIN=domain)
|
||||
return Response(xml, mimetype='application/xml')
|
||||
|
||||
@app.route('/Autodiscover/Autodiscover.xml', methods=['POST','GET'])
|
||||
def outlook_autodiscover():
|
||||
domain = request.host.split('.', 1)[1]
|
||||
xml = env.get_template('Autodiscover.xml.j2').render(DOMAIN=domain)
|
||||
return Response(xml, mimetype='text/xml')
|
||||
Reference in New Issue
Block a user