mirror of
https://github.com/haiwen/seahub.git
synced 2025-05-12 18:05:05 +00:00
update
This commit is contained in:
parent
97d3359899
commit
1642834e33
seahub/utils
@ -18,7 +18,6 @@ from urllib.parse import urlparse
|
||||
|
||||
from constance import config
|
||||
import seaserv
|
||||
from django.core.mail.backends.smtp import EmailBackend
|
||||
from seaserv import seafile_api, ccnet_api
|
||||
|
||||
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.utils.db_api import SeafileDB
|
||||
from seahub.onlyoffice.settings import ENABLE_ONLYOFFICE, ONLYOFFICE_FILE_EXTENSION
|
||||
from seahub.utils.mail import add_smime_sign
|
||||
|
||||
|
||||
try:
|
||||
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
|
||||
from seahub.utils.mail import add_smime_sign
|
||||
logo_path = LOGO_PATH
|
||||
custom_logo_file = os.path.join(MEDIA_ROOT, CUSTOM_LOGO_PATH)
|
||||
if os.path.exists(custom_logo_file):
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2012-2016 Seafile Ltd.
|
||||
import os
|
||||
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.serialization import pkcs7
|
||||
from cryptography import x509
|
||||
@ -52,7 +52,7 @@ def add_smime_sign(msg):
|
||||
signature_b64 = base64.b64encode(pkcs7_signature).decode()
|
||||
|
||||
# Create the S/MIME signature part
|
||||
sig_part = MIMEText(
|
||||
sig_part = MIMEApplication(
|
||||
signature_b64,
|
||||
"pkcs7-signature",
|
||||
_charset="utf-8"
|
||||
|
Loading…
Reference in New Issue
Block a user