app-MAIL-temp/app/email/headers.py

49 lines
1.4 KiB
Python
Raw Normal View History

"""Email headers"""
MESSAGE_ID = "Message-ID"
IN_REPLY_TO = "In-Reply-To"
REFERENCES = "References"
DATE = "date"
2021-10-11 12:10:18 +02:00
SUBJECT = "Subject"
FROM = "From"
TO = "To"
CONTENT_TYPE = "Content-Type"
2021-10-11 12:19:21 +02:00
CONTENT_DISPOSITION = "Content-Disposition"
CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding"
2021-10-11 12:10:18 +02:00
MIME_VERSION = "Mime-Version"
REPLY_TO = "Reply-To"
RECEIVED = "Received"
CC = "Cc"
DKIM_SIGNATURE = "DKIM-Signature"
X_SPAM_STATUS = "X-Spam-Status"
LIST_UNSUBSCRIBE = "List-Unsubscribe"
LIST_UNSUBSCRIBE_POST = "List-Unsubscribe-Post"
2021-10-11 12:10:18 +02:00
# headers used to DKIM sign in order of preference
DKIM_HEADERS = [
[MESSAGE_ID.encode(), DATE.encode(), SUBJECT.encode(), FROM.encode(), TO.encode()],
[FROM.encode(), TO.encode()],
[MESSAGE_ID.encode(), DATE.encode()],
[FROM.encode()],
]
2021-10-11 12:19:21 +02:00
SL_DIRECTION = "X-SimpleLogin-Type"
SL_EMAIL_LOG_ID = "X-SimpleLogin-EmailLog-ID"
SL_ENVELOPE_FROM = "X-SimpleLogin-Envelope-From"
SL_ENVELOPE_TO = "X-SimpleLogin-Envelope-To"
# to let Rspamd know that the message should be signed
SL_WANT_SIGNING = "X-SimpleLogin-Want-Signing"
2021-10-11 12:19:21 +02:00
MIME_HEADERS = [
MIME_VERSION,
CONTENT_TYPE,
CONTENT_DISPOSITION,
CONTENT_TRANSFER_ENCODING,
]
# convert to lowercase to facilitate header look up
MIME_HEADERS = [h.lower() for h in MIME_HEADERS]
# if any of these headers are present, that means automatic out of office email
AUTO_REPLY1 = "X-Autoreply"
AUTO_REPLY2 = "Auto-Submitted"