Sv: Avoid duplicate emails in the sent folder

Sebastian sebastian at
Sun Apr 4 14:04:26 EEST 2021

I have a sieve filter called "sent.sieve"

Where I just do this:

Then in sieve settings:

plugin {
  sieve_plugins = sieve_imapsieve sieve_extprograms
  sieve_global_extensions = +vnd.dovecot.execute
  sieve_execute_bin_dir = /usr/bin/
  imapsieve_mailbox2_name = Sent
  imapsieve_mailbox2_causes = APPEND
  imapsieve_mailbox2_before = file:/etc/dovecot/sieve/sent.sieve

And then in Exim4 SMTP server:

if $sender_address_domain is then
unseen save /var/mail/asterisk2/Sent

in exim4 config:
system_filter = /etc/exim4/sentfolder.filter
system_filter_file_transport = sentfolder

in transports of exim4.conf:

  debug_print = "T: Sentfolder for $local_part@$domain"
  headers_add = Status: RO
  headers_remove = x-dkim-signature
  headers_remove = x-spf-signature
  headers_remove = x-trusted-domain
  headers_remove = keywords
  headers_remove = x-priority
  headers_remove = x-status
  driver = appendfile
  use_flock_lock = yes
  use_fcntl_lock = no
  use_lockfile = no
  group = mail
  mode = 0777
  mode_fail_narrower = false
  current_directory = /

that should solve it.

-----Ursprungligt meddelande-----
Från: dovecot-bounces at <dovecot-bounces at> För André Rodier
Skickat: den 4 april 2021 12:48
Till: dovecot at
Kopia: users at
Ämne: Avoid duplicate emails in the sent folder


I have a webmail program, that I cannot configure to not save sent emails in the Sent folder. My emails to the SOGo team don't seem to reach the mailing list anymore.

So, I have no other choice to think the problem differently, and _maybe_ use Dovecot to fix this issue. Moreover, I think this could be useful for other email clients.

First, I have tried to use Sieve, but no success so far:

imapsieve_mailbox4_name = *
  imapsieve_mailbox4_from = Sent
  imapsieve_mailbox4_causes = APPEND, COPY
  imapsieve_mailbox4_after = file:/var/lib/dovecot/sieve/sent- checks.sieve

And this sieve script:

Message-ID header.
require [


if duplicate :seconds 10 {

Otherwise, can I configure dovecot in a certain way, for instance create a virtual Sent folder. This would not save the email when appended, but still returns the list of sent emails ?

But this is not working. Any idea?

Thanks for your help!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5715 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the dovecot mailing list