mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
DEV: Improve mbox import script
* Better documentation of settings * Add option to exclude trimmed parts of emails (enabled by default) to not revail email addresses
This commit is contained in:
@ -7,9 +7,8 @@ require_relative 'support/settings'
|
||||
|
||||
module ImportScripts::Mbox
|
||||
class Importer < ImportScripts::Base
|
||||
# @param settings [ImportScripts::Mbox::Settings]
|
||||
def initialize(settings)
|
||||
@settings = settings
|
||||
def initialize(settings_filename)
|
||||
@settings = Settings.load(settings_filename)
|
||||
super()
|
||||
|
||||
@database = Database.new(@settings.data_dir, @settings.batch_size)
|
||||
@ -139,7 +138,10 @@ module ImportScripts::Mbox
|
||||
body = receiver.add_attachments(body, user)
|
||||
end
|
||||
|
||||
body = "#{body}#{Email::Receiver.elided_html(elided)}" if elided.present?
|
||||
if elided.present? && @settings.show_trimmed_content
|
||||
body = "#{body}#{Email::Receiver.elided_html(elided)}"
|
||||
end
|
||||
|
||||
body
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user