discourse/app/jobs/scheduled/weekly.rb
Krzysztof Kotlarek c32bd8ae48 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)
2019-10-30 16:54:35 +11:00

20 lines
482 B
Ruby

# frozen_string_literal: true
module Jobs
# This job will run on a regular basis to update statistics and denormalized data.
# If it does not run, the site will not function properly.
class Weekly < ::Jobs::Scheduled
every 1.week
def execute(args)
ScoreCalculator.new.calculate
MiniScheduler::Stat.purge_old
Draft.cleanup!
UserAuthToken.cleanup!
Upload.reset_unknown_extensions!
Email::Cleaner.delete_rejected!
end
end
end