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

53 lines
1.6 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"
2022-03-21 10:42:58 +01:00
RSPAMD_QUEUE_ID = "X-Rspamd-Queue-Id"
2022-03-18 15:44:07 +01:00
SPAMD_RESULT = "X-Spamd-Result"
2021-10-11 12:10:18 +02:00
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"
2022-03-16 10:24:59 +01:00
SL_CLIENT_IP = "X-SimpleLogin-Client-IP"
2021-10-11 12:19:21 +02:00
# 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]
# according to https://datatracker.ietf.org/doc/html/rfc3834#section-3.1.7, this header should be set to "auto-replied"
# however on hotmail, this is set to "auto-generated"
AUTO_SUBMITTED = "Auto-Submitted"