1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-24 09:41:04 +00:00
This commit is contained in:
r350178982 2025-04-18 16:07:31 +08:00
parent 97d3359899
commit 1642834e33
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,6 @@ from urllib.parse import urlparse
from constance import config from constance import config
import seaserv import seaserv
from django.core.mail.backends.smtp import EmailBackend
from seaserv import seafile_api, ccnet_api from seaserv import seafile_api, ccnet_api
from django.urls import reverse from django.urls import reverse
@ -40,7 +39,7 @@ from seahub.settings import MEDIA_URL, LOGO_PATH, \
from seahub.constants import PERMISSION_READ_WRITE from seahub.constants import PERMISSION_READ_WRITE
from seahub.utils.db_api import SeafileDB from seahub.utils.db_api import SeafileDB
from seahub.onlyoffice.settings import ENABLE_ONLYOFFICE, ONLYOFFICE_FILE_EXTENSION from seahub.onlyoffice.settings import ENABLE_ONLYOFFICE, ONLYOFFICE_FILE_EXTENSION
from seahub.utils.mail import add_smime_sign
try: try:
from seahub.settings import EVENTS_CONFIG_FILE from seahub.settings import EVENTS_CONFIG_FILE
@ -1003,6 +1002,7 @@ def send_html_email(subject, con_template, con_context, from_email, to_email,
""" """
# get logo path # get logo path
from seahub.utils.mail import add_smime_sign
logo_path = LOGO_PATH logo_path = LOGO_PATH
custom_logo_file = os.path.join(MEDIA_ROOT, CUSTOM_LOGO_PATH) custom_logo_file = os.path.join(MEDIA_ROOT, CUSTOM_LOGO_PATH)
if os.path.exists(custom_logo_file): if os.path.exists(custom_logo_file):

View File

@ -1,7 +1,7 @@
# Copyright (c) 2012-2016 Seafile Ltd. # Copyright (c) 2012-2016 Seafile Ltd.
import os import os
import logging import logging
from email.mime.text import MIMEText from email.mime.application import MIMEApplication
from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.serialization import pkcs7 from cryptography.hazmat.primitives.serialization import pkcs7
from cryptography import x509 from cryptography import x509
@ -52,7 +52,7 @@ def add_smime_sign(msg):
signature_b64 = base64.b64encode(pkcs7_signature).decode() signature_b64 = base64.b64encode(pkcs7_signature).decode()
# Create the S/MIME signature part # Create the S/MIME signature part
sig_part = MIMEText( sig_part = MIMEApplication(
signature_b64, signature_b64,
"pkcs7-signature", "pkcs7-signature",
_charset="utf-8" _charset="utf-8"