lua_mime
This module contains helper functions to modify mime parts
Functions:
Function | Description |
---|---|
lua_mime.add_text_footer(task, html_footer, text_footer) |
Adds a footer to all text parts in a message. |
lua_mime.multipattern_text_replace(task, mp, replacements) |
Replaces text according to multipattern matches. |
lua_mime.modify_headers(task, {add = {hname = {value = 'value', order = 1}}, remove = {hname = {1,2}}}) |
Adds/removes headers both internal and in the milter reply. |
lua_mime.message_to_ucl(task, [stringify_content]) |
Exports a message to an ucl object. |
lua_mime.message_to_ucl_schema() |
Returns schema for a message to verify result/document fields. |
lua_mime.remove_attachments(task, settings) |
Removes all attachments from a message, keeping only text parts. |
lua_mime.get_displayed_text_part(task) |
Returns the most relevant displayed content from an email. |
lua_mime.get_distinct_text_parts(task) |
Returns the list of parts that are visible or have a distinct content. |
lua_mime.anonymize_message(task, settings) |
Anonymizes message content by replacing sensitive data. |
The module lua_mime
defines the following functions.
lua_mime.add_text_footer(task, html_footer, text_footer)
Adds a footer to all text parts in a message. It returns a table with the following fields:
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_mime.multipattern_text_replace(task, mp, replacements)
Replaces text according to multipattern matches. It returns a table with the following fields:
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_mime.modify_headers(task, {add = {hname = {value = 'value', order = 1}}, remove = {hname = {1,2}}})
Adds/removes headers both internal and in the milter reply Mode defines to be compatible with Rspamd <=3.2 and is the default (equal to ‘compat’)
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_mime.message_to_ucl(task, [stringify_content])
Exports a message to an ucl object
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_mime.message_to_ucl_schema()
Returns schema for a message to verify result/document fields
Parameters:
No parameters
Returns:
No return
Back to module description.
lua_mime.remove_attachments(task, settings)
Removes all attachments from a message, keeping only text parts
Parameters:
task {task}
: Rspamd task objectsettings {table}
: Table with the following fields:Returns:
{table}
: modified message state similar to other modification functions:Back to module description.
lua_mime.get_displayed_text_part(task)
Returns the most relevant displayed content from an email
Parameters:
task {task}
: Rspamd task objectReturns:
{text_part}
: a selected partBack to module description.
lua_mime.get_distinct_text_parts(task)
Returns the list of parts that are visible or have a distinct content
Parameters:
task {task}
: Rspamd task objectReturns:
Back to module description.
lua_mime.anonymize_message(task, settings)
Anonymizes message content by replacing sensitive data
Parameters:
task {task}
: Rspamd task objectsettings {table}
: Table with the following fields:Returns:
{table}
: modified message state similar to other modification functionsBack to module description.
Back to top.