DEV: mbox importer improvements (#16557)

* FIX: support specifying parent_category_id in mbox import metadata
* FIX: elide tabs from topic titles
* FIX: optionally fix Mailman from: addresses
* DEV: optionally elide anything up to the last = in email addresses
* Fix Mailmain broken from: detection
This commit is contained in:
Leonardo Mosquera
2022-04-29 13:24:29 -03:00
committed by GitHub
parent 0f772bdf5b
commit 3e5faffb0d
6 changed files with 69 additions and 13 deletions

View File

@ -458,7 +458,16 @@ class ImportScripts::Base
.where("LOWER(name) = ?", opts[:name].downcase.strip)
.first
return existing if existing
if existing
if import_id && existing.custom_fields["import_id"] != import_id
existing.custom_fields["import_id"] = import_id
existing.save!
add_category(import_id, existing)
end
return existing
end
post_create_action = opts.delete(:post_create_action)