Page MenuHomePhorge

kolab_contentfilter_cli crashes with unicode characters
Open, HighPublic

Description

Container image: image: quay.io/apheleiait/kolab/postfix:4.0.16

Example email for which kolab_contentfilter_cli crashes:

Date: Thu, 28 Aug 2025 18:21:30 +0000
From: test@example.com
To: test@example.com
Subject: test
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

€

Example log line:

postfix postfix/pipe[4366]: E02FFF86CA: to=<redacted>, relay=policy_mailfilter, delay=0.16, delays=0.01/0/0/0.16, dsn=4.3.0, status=deferred (temporary failure. Command output: Request failed )

Or directly from the cli:

bash-5.1# /usr/libexec/postfix/kolab_contentfilter_cli -f test -- test
Date: Thu, 28 Aug 2025 18:21:30 +0000
From: test@example.com
To: test@example.com
Subject: test
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

€

Request failed

Details

Ticket Type
Task

Event Timeline

Current git version gives the full error:

Request failed: http://kolab:80/api/webhooks/policy/mail/filter?recipient=test&sender=test, 'latin-1' codec can't encode character '\u20ac' in position 0: Body ('€') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
lennartack lowered the priority of this task from Needs Triage to High.Aug 28 2025, 6:48 PM