![](https://seccdn.libravatar.org/avatar/77cb4da5f72bc176182dcc33f03a18f3.jpg?s=120&d=mm&r=g)
On 27/01/2019 21.46, Andrei Borzenkov wrote:
27.01.2019 23:32, Carlos E. R. пишет:
Hi,
Suppose that I'm to sort an mbox folder into several others using procmail. I do that with this command:
formail -s procmail ./.procmail_rules < mbox_initial_folder
(pipes every single mail in "mbox_initial_folder" through procmail
Now, assume this rule in .procmail_rules:
:0 c: $backup
This rule works perfect. Every post from "mbox_initial_folder" goes in to "backup" folder, and keeps its attributes.
Now, assume this other rule:
:0 w: $HOME/Mail/.D-locks/output_folder.lock | /usr/lib/dovecot/dovecot-lda -m output_folder
Why the change to do the delivery using "dovecot-lda" instead of the native (to procmail) system? Because of this feature (man dovecot-lda):
Main features of the dovecot-lda are:
* Mailbox indexing during mail delivery, providing faster mailbox access later
The problem I have discovered now is that, if a mail was marked read (or any other mark) on "mbox_initial_folder", it is lost on "output_folder". dovecot-lda destroys, resets or whatever the marks on copy.
It does not "destroy" anything. "Read" flag is property of particular mailbox format, not part of message itself; you deliver new message; no wonder it is stored as new.
Not exactly. If "procmail" does the job itself, the attributes keep. If done with dovecot-lda, they don't. They are stored in the "X-Status" header (according to Eduardo Chappa, from Alpine).
This is nasty.
I have looked up the manual, but I don't see how to change that.
Except reverting to procmail internal delivery agent, and somehow trigger dovecot to reindex changed folders at the end (I don't know how).
doveadm index?
Thanks, I'll try. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)