[opensuse] About mail filtering with procmail.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. 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). Something I'd hate to do, after having edited my procmail filters to use dovecot-lda few years ago. - -- Cheers Carlos E. R. (from 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXE4VbBwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVE7YAoJJ1WnSqXSComlEj8pcp G4rGiv7xAKCXDcNtbGRpCwk6Z8GGRHD7KIYGNA== =wjcy -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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.
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?
Something I'd hate to do, after having edited my procmail filters to use dovecot-lda few years ago.
-- Cheers
Carlos E. R. (from 15.0 x86_64 at Telcontar)
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)
Carlos E. R. wrote:
On 27/01/2019 21.46, Andrei Borzenkov wrote:
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.
Correct - when they are delivered with lda, that means "stored as new". -- Per Jessen, Zürich (2.2°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 28/01/2019 09.07, Per Jessen wrote:
Carlos E. R. wrote:
On 27/01/2019 21.46, Andrei Borzenkov wrote:
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.
Correct - when they are delivered with lda, that means "stored as new".
Then I'm going to revert to procmail native method :-( At least for some cases. A lot of manual editing. You see, as I read a lot of email directly on the ISP IMAP server, they are marked "read", but as I save it to permanent storage, say, using Thunderbird or Alpine move mail to another folder on disk, and then with procmail for sorting to the final folder, the read status is lost, because the actual move is done with dovecot-lda. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)
Carlos E. R. wrote:
On 28/01/2019 09.07, Per Jessen wrote:
Carlos E. R. wrote:
On 27/01/2019 21.46, Andrei Borzenkov wrote:
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.
Correct - when they are delivered with lda, that means "stored as new".
Then I'm going to revert to procmail native method :-(
At least for some cases.
A lot of manual editing.
You see, as I read a lot of email directly on the ISP IMAP server, they are marked "read", but as I save it to permanent storage, say, using Thunderbird or Alpine move mail to another folder on disk, and then with procmail for sorting to the final folder, the read status is lost, because the actual move is done with dovecot-lda.
Yep, I get it. dovecot-lda is a delivery mechanism, it doesn't work with filenames so cannot propagate any status. -- Per Jessen, Zürich (2.4°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 28/01/2019 10.40, Per Jessen wrote:
Carlos E. R. wrote:
On 28/01/2019 09.07, Per Jessen wrote:
Carlos E. R. wrote:
On 27/01/2019 21.46, Andrei Borzenkov wrote:
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.
Correct - when they are delivered with lda, that means "stored as new".
Then I'm going to revert to procmail native method :-(
At least for some cases.
A lot of manual editing.
You see, as I read a lot of email directly on the ISP IMAP server, they are marked "read", but as I save it to permanent storage, say, using Thunderbird or Alpine move mail to another folder on disk, and then with procmail for sorting to the final folder, the read status is lost, because the actual move is done with dovecot-lda.
Yep, I get it. dovecot-lda is a delivery mechanism, it doesn't work with filenames so cannot propagate any status.
No filenames needed, it is just keeping the X-Status header. Hum, actually "Status:" Status: RO Status: O <=== (apparently, unread) Apparently, dovecot itself uses that header when the format is mbox. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)
participants (3)
-
Andrei Borzenkov
-
Carlos E. R.
-
Per Jessen