mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FEATURE: Remove attachments and truncate raw field for incoming emails (#8253)
Adds the settings: raw_email_max_length, raw_rejected_email_max_length, delete_rejected_email_after_days. These settings control retention of the "raw" emails logs. raw_email_max_length ensures that if we get incoming email that is huge we will truncate it removing uploads from the raw log. raw_rejected_email_max_length introduces an even more aggressive truncation for rejected incoming mail. delete_rejected_email_after_days controls how many days we will keep rejected emails for (default 90)
This commit is contained in:
@ -128,7 +128,12 @@ module Email
|
||||
end
|
||||
|
||||
def set_incoming_email_rejection_message(incoming_email, message)
|
||||
incoming_email.update!(rejection_message: message) if incoming_email
|
||||
if incoming_email
|
||||
incoming_email.update!(
|
||||
rejection_message: message,
|
||||
raw: Email::Cleaner.new(incoming_email.raw, rejected: true).execute
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def log_email_process_failure(mail_string, exception)
|
||||
|
Reference in New Issue
Block a user