Skip to content

WIP: Make mail server logs searchable - #9415

Draft
laurentS wants to merge 2 commits into
developfrom
admin-search-mailserverlogs
Draft

WIP: Make mail server logs searchable#9415
laurentS wants to merge 2 commits into
developfrom
admin-search-mailserverlogs

Conversation

@laurentS

Copy link
Copy Markdown
Collaborator

Relevant issue(s)

#8814

What does this do?

This makes MailServerLogs searchable via the new postgres based search system.

Why was this needed?

Implementation notes

See #9334 (comment) about speeding up this specific model's indexing, for the reasoning behind overriding the base reindex_all method.

Trimming log lines before indexing them will probably help with index size. The email log lines contain a lot of "trivial" text that is very unlikely to be searched (timestamps, server name which appears on every line, "postfix", etc...).
This would probably require a separate SQL function for each MTA.

Screenshots

Notes to reviewer


Have you updated the changelog? If this is not necessary, put square brackets around this: skip changelog

@laurentS

laurentS commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

We might need to get rid of the overridden reindex_all method here if we merge the more generic one in #9439

@garethrees

Copy link
Copy Markdown
Member

We might need to get rid of the overridden reindex_all method here if we merge the more generic one in #9439

Not sure if this is necessarily the best place for this comment, but just at a quick glance I wonder if we could have a setup where we have the generic reindex_all, but can then call a per-model custom implementation if defined:

class SomeRecord
  include Searchable
  # Uses the default reindex_all method
end

class AnotherRecord
  include Searchable

  def self.reindex_all
    # custom implementation
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants