Add function set_mail_hostname

This commit is contained in:
2025-12-22 12:11:13 +01:00
parent 481e179833
commit e3100e77b2
3 changed files with 17 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ import sqlite3
import os
from shutil import copy
from socket import gethostname
from tools.utils import email_disp, append_to_log, gen_token, valid_passwd, login_required
from tools.utils import email_disp, append_to_log, gen_token, valid_passwd, login_required, set_mail_domain
@@ -28,11 +28,9 @@ MAIL_SERVER = app.config['MAIL_SERVER']
XMPP_SERVER = app.config['XMPP_SERVER']
SETUID = app.config['SETUID']
BASE_URL = app.config['BASE_URL']
MAIL_DOMAIN = app.config['MAIL_DOMAIN']
MAIL_WEBSERVICE = app.config['MAIL_WEBSERVICE']
XMPP_WEBSERVICE = app.config['XMPP_WEBSERVICE']
##################################################################################################
@@ -42,7 +40,7 @@ XMPP_WEBSERVICE = app.config['XMPP_WEBSERVICE']
@login_required
def mymessaging():
hostname=MAIL_DOMAIN
hostname=set_mail_domain()
user='%s' % escape(session['username'])
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
cursor = conn.cursor() # Création de l'objet "curseur"
@@ -67,7 +65,9 @@ def mymessaging():
@mymailbox.route('/mymailbox/alias', methods=['GET', 'POST'] )
@login_required
def myalias():
hostname=MAIL_DOMAIN
hostname = set_mail_domain()
user='%s' % escape(session['username'])
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
cursor = conn.cursor() # Création de l'objet "curseur"