Files
mail-autoconfig/app.py
mifi 21a35cb8e2
Some checks failed
continuous-integration/drone Build is failing
first commit
2025-07-23 21:33:16 -03:00

21 lines
695 B
Python

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')