Is it possible to filter messages received via a sync job?
Currently, I’m relying on a third-party account to forward messages to a mailcow account and using sieve in SOGo to move it to a specific folder, this works well but not all messages are being forwarded from the third-party.
I’m looking into pulling mail from mailcow via Sync Jobs but sieve filters don’t seem to be applied to mail received this way, I’ve tried pre-filter which stops a sync job from pulling mail and a post filter which fetches mail but doesn’t seem to do any filtering.
My attempt at a filter is as follows:
require ["fileinto", "editheader", "variables"];
if address "To" "pneu*****@*****media.com" {
if header :matches "Subject" "*" {
set "subject" "$(1)";
}
deleteheader "Subject:";
addheader :last "Subject" "[VM] $(subject)";
fileinto "INBOX/Pneu*****";
}
The idea is to change the subject so third-party messages can be identified and move it to a different folder.
Any help would be appreciated.