Skip to content

mailbot: decode base64 bodies - #146

Open
matttbe wants to merge 1 commit into
linux-netdev:mainfrom
matttbe:mailbot-base64
Open

matttbe wants to merge 1 commit into
linux-netdev:mainfrom
matttbe:mailbot-base64

Conversation

@matttbe

@matttbe matttbe commented Nov 23, 2026

Copy link
Copy Markdown
Member

Some emails are sent with 'Content-Transfer-Encoding: base64'. In this case, _body() returned the raw base64 content, and the 'pw-bot:' and 'doc-bot:' lines could not be found.

Use get_content() to decode base64 parts, for both single-part and multi-part emails. The previous behaviour is kept for other encodings.

While at it, errors while decoding the body of a single-part email are now also caught, and extract_actions() handles a missing body.

Some emails are sent with 'Content-Transfer-Encoding: base64'. In this
case, _body() returned the raw base64 content, and the 'pw-bot:' and
'doc-bot:' lines could not be found.

Use get_content() to decode base64 parts, for both single-part and
multi-part emails. The previous behaviour is kept for other encodings.

While at it, errors while decoding the body of a single-part email are
now also caught, and extract_actions() handles a missing body.

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
@matttbe
matttbe requested a review from kuba-moo November 23, 2026 10:10
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.

1 participant