sieve_extprograms: how to filter original message twice?
Stephan Bosch
stephan at rename-it.nl
Mon Jun 13 17:09:03 UTC 2016
Op 10-6-2016 om 0:57 schreef N0T3P4D:
> Hi,
>
> I use dovecot and sieve_extprograms to encrypt all incoming messages with the help of a Python script.
> Now, I want to process the _original_ message a second time. However, as expected, the second filter is applied to the already filtered message.
>
> For reference, here's a copy of the sieve script in question:
>
> if address :matches "To" "X at Y.Z" {
> fileinto "INBOX";
> filter "gpgit.py" ["X at Y.Z", "--encrypt"];
> fileinto "encrypted";
> filter "gpgit.py" ["X at Y.Z", "--wrap"]; # Should be applied to the original message but uses the result of the first filter command
> fileinto "wrapped";
> stop;
> }
>
> Does anyone have an idea how to modify the script to get the intended result?
>
> Please cc me, as I'm not subscribed.
The Sieve language currently has no means to manage several modified
versions of a message in parallel; there is no means to revert back to
an older version of a modified message. So, unfortunately, I see no way
to implement a Sieve script like this at this time :/.
The only (ugly) solution I see is to use a pipe program rather than a
filter program. The pipe program will then fork and filter the e-mail
twice and store it into the required folders using doveadm.
Regards,
Stephan.
More information about the dovecot
mailing list