I need to figure out a way to keep a copy, or move a sent item when it is sent from a delegated user, to the from accounts sent folder. Reason being If I give multiple people delegated access to send emails on my behalf, I want to check to make sure an email was responded to without having to login to multiple peoples accounts and searching their sent items. I expect this sent email to be located in my sent items. Hope this makes sense. Can this be done? Currently the delegates would have access to my sent items though sharing, and with other mail clients (postbox) I can make a rule when email is sent. I dont see such a thing in sogo filters, only when email is received.
I came across this info, and wonder if this can be tweaked to do what i want.
progmaticltd/homebox
106/files
`
IMAP clients are using the APPEND verb to store sent emails in the Sent folder.
However, homebox already send a blind copy to the same user to be directly
stored in the sent folder, using recipient delimiter and +Sent.
Emails appended by IMAP clients to the sent folder should be discarded.
imapsieve_mailbox4_name = *
imapsieve_mailbox4_from = Sent
imapsieve_mailbox4_causes = APPEND
imapsieve_mailbox4_after = file:/var/lib/dovecot/sieve/sent-checks.sieve
`
/var/lib/dovecot/sieve/sent-checks.sieve
`
IMAP clients are using the APPEND verb to store sent emails in the Sent folder.
However, homebox already send a blind copy to the same user to be directly
stored in the sent folder, using recipient delimiter and +Sent.
In this case, this would create a “duplicate” email, with the same Message-ID header.
require [
“imapsieve”,
“include”
];
The pre-sent-checks sieve script is created during email importation.
During this phase only, emails can be appended to the sent folder.
Once the importation is finished, the script is removed and no emails
can be appended to the sent folder again.
FIXME: Does not work on Bullseye
include :personal :optional “pre-sent-checks”;
This script is only called when the mail client copies emails to the sent folder.
This should not be done as the emails are copied automatically using the BCC address.
discard;
`
seems if i can override the discard part to put the email in the sent items based on the from address. Not sure how to do that.
here is my thought process of what needs to happen, I just dont know if its possible.
When a sieve filter runs obtain the account it is running under. (This would be my account me@example.com)
Access the from header and compare to the account in step 1 (from header would be someoneelse@example.com)
If the two do not match then file into from account sent items (message would be filed into someoneelse.INBOX.Sent or someoneelse.Sent) not sure where sent is in relation to inbox.