mirror of
https://github.com/optim-enterprises-bv/Mailu-OIDC.git
synced 2025-11-02 02:57:49 +00:00
Merge branch 'master' of https://github.com/Mailu/Mailu into HEAD
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
"""
|
||||
|
||||
import os
|
||||
import smtplib
|
||||
import json
|
||||
|
||||
from datetime import date
|
||||
@@ -420,14 +419,19 @@ class Email(object):
|
||||
|
||||
def sendmail(self, subject, body):
|
||||
""" send an email to the address """
|
||||
f_addr = f'{app.config["POSTMASTER"]}@{idna.encode(app.config["DOMAIN"]).decode("ascii")}'
|
||||
with smtplib.SMTP(app.config['HOST_AUTHSMTP'], port=10025) as smtp:
|
||||
to_address = f'{self.localpart}@{idna.encode(self.domain_name).decode("ascii")}'
|
||||
msg = text.MIMEText(body)
|
||||
msg['Subject'] = subject
|
||||
msg['From'] = f_addr
|
||||
msg['To'] = to_address
|
||||
smtp.sendmail(f_addr, [to_address], msg.as_string())
|
||||
try:
|
||||
f_addr = f'{app.config["POSTMASTER"]}@{idna.encode(app.config["DOMAIN"]).decode("ascii")}'
|
||||
ip, port = app.config['HOST_LMTP'].rsplit(':')
|
||||
with smtplib.LMTP(ip, port=port) as lmtp:
|
||||
to_address = f'{self.localpart}@{idna.encode(self.domain_name).decode("ascii")}'
|
||||
msg = text.MIMEText(body)
|
||||
msg['Subject'] = subject
|
||||
msg['From'] = f_addr
|
||||
msg['To'] = to_address
|
||||
lmtp.sendmail(f_addr, [to_address], msg.as_string())
|
||||
return True
|
||||
except smtplib.SMTPException:
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def resolve_domain(cls, email):
|
||||
@@ -772,6 +776,8 @@ class Fetch(Base):
|
||||
username = db.Column(db.String(255), nullable=False)
|
||||
password = db.Column(db.String(255), nullable=False)
|
||||
keep = db.Column(db.Boolean, nullable=False, default=False)
|
||||
scan = db.Column(db.Boolean, nullable=False, default=False)
|
||||
folders = db.Column(CommaSeparatedList, nullable=True, default=list)
|
||||
last_check = db.Column(db.DateTime, nullable=True)
|
||||
error = db.Column(db.String(1023), nullable=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user