recipient delimiter and sieve filters

Stephan Bosch stephan at rename-it.nl
Sat Mar 24 12:24:37 EET 2018


Op 3/24/2018 om 9:16 AM schreef André Rodier:
> Dear all,
>
> I have found a way to  automatically copy sent emails in the "Sent"
> folder, but I am not sure it is the simplest and more reliable way on
> the long term.
>
> I am open to suggestions if I miss a feature in Dovecot - or Postfix,
> that allows me to do this. I vaguely remember an SMTP extension that do
> that, but my memory could be wrong.

I think you mean:

https://tools.ietf.org/html/rfc4468

Which was recently added to Dovecot as a feature:

https://wiki.dovecot.org/Submission

However, clients will not support this at this time, so you will not be
helped there.

> First, I use "~" as a recipient delimiter. Then, I set up a postfix
> senders_bcc_map that add the ~Sent part:
>
> andre at homebox.space → bcc: andre~Sent at homebox.space
>
> It worked, except that the emails was marked as new.
>
> I tried first to add a global sieve filter like this:
> ----------------------------------------------------------------------
> # Sieve script executed before for user
> require ["fileinto","imap4flags"];
>
> # Move automatically copied emails to the sent folder
> # And mark them as read
> if header :contains "Delivered-To" "~Sent"
> {
>   setflag "\\Seen";
>   fileinto "Sent";
> }
> ----------------------------------------------------------------------
> But it did not work, so maybe there is a trick I am not aware of.

The Delivered-To header is currently only added when there is a single
recipient in the LMTP session. It would not surprise me when the ~Sent
Bcc is batched in the same transaction by Postfix, which means that this
header is never added.

You'd better use the envelope extension:

https://tools.ietf.org/html/rfc5228#section-5.4


Regards,

Stephan.



More information about the dovecot mailing list