17 lines
447 B
Python
17 lines
447 B
Python
import threading
|
|
from app import create_app
|
|
from app.utils import start_smtp_server
|
|
|
|
app = create_app()
|
|
|
|
def run_smtp_server():
|
|
start_smtp_server(host='0.0.0.0', port=25)
|
|
|
|
if __name__ == '__main__':
|
|
# 在单独的线程中启动 SMTP 服务器
|
|
smtp_thread = threading.Thread(target=run_smtp_server)
|
|
smtp_thread.daemon = True
|
|
smtp_thread.start()
|
|
|
|
# 启动 Flask 应用
|
|
app.run(host='0.0.0.0', port=5000, debug=True) |