-----Original Message----- From: Peter via dovecot dovecot@dovecot.org Sent: Tuesday, April 9, 2024 5:18 AM To: dovecot@dovecot.org Subject: Strange problem with sieve
Hello,
I use Dovecot 2.3.20 on FreeBSD 13.2 (in jail) as a part of iRedMail installation.
Some mailboxes are configured for automatic mails processing using sieve (execute :pipe) and a custom binary (started by script). The system was configured and was working correctly during several weeks.
Since ~10 days the system starts to work strangely. _*/Some/*_ mails cannot be decoded anymore. No changes at our side, no updates etc.
I dumped the content received by my binary, and it looks really strange:
pOUc9Z33O0GbfzbW5Mrmi 3L4tTlvKfsD8wP+hc6vN1v1bv+Vx827kW+YX5n/Zxtl240erH4t+nNyeuL1zh92 O0p24nYKd vbtcd1UVyBdkFwztDtrdsIexJ2/Pu71L914vnFdYto+0T7JvoCiwqGm/7v6d+78U Jxf3lHiU 1B9QO7D1wIeD3IO3S91K68rUy/LLPv/E/6m/3Le8oUK/ovAQ7lDWoaeHow6 3/8z8ubpStTK/
This is a start of one mail. No headers, no readable data.
I removed "discard;" from sieve script to put such mails in the mailbox, and the mails look normally:
Mime-Version:1.0 Content-Type:multipart/mixed; boundary="=-/3n/zeVGlN5thgeL28RKiw=="
--=-/3n/zeVGlN5thgeL28RKiw== Content-Type: multipart/alternative; boundary="=- sE/MdvfJZlakBmrKkcdzCg=="
--=-sE/MdvfJZlakBmrKkcdzCg== Content-Type: multipart/related; boundary="=-cgJVnLNlzX5YuD6yaI5USQ=="
--=-cgJVnLNlzX5YuD6yaI5USQ== Content-Transfer-Encoding: base64 Content-Type: text/html; charset=utf-8
etc.
Really, I have no idea about any direction to explore. The server is totally under my control, I can do anything, but I have no idea how to debug this situation.
I tried to redirect such mails to another mailbox and process them there, but I get the same strange data. If I connect Thunderbird to the mailbox - I can read the mails correctly. So, the problem arrives at the moment when the sieve system is invoked - the mail data is corrupted somehow.
Any advise will be really appreciated.
Peter
RE: --=-cgJVnLNlzX5YuD6yaI5USQ== Content-Transfer-Encoding: base64
What has changed is the body content of incoming emails is now base64 encoded. Because you are trying to process these messages with a script, I'm going to guess that the emails in question are automatically generated somewhere. Go back to the process that is creating these emails and disable base64 encoding. Or, add a base64 decode step to the sieve execute script.
Doug