[Dovecot] How to make dovecot-lda/deliver mark a message as seen
Hello everybody,
I am using dovecot 2.0.13 and have a special case here in which I want a mail that is delivered locally with dovecot-lda to be marked as "seen".
In dovecot 1.1.7 I succeeded to achive this, by modifing deliver.c so that upon adding a -S switch to the command arguments, the flag MAIL_SEEN was added to the call of mailbox_copy(). This seemed to work pretty good.
With the new version, i tried to do something similar by selectively adding mail_update_flags(ctx.src_mail, MODIFY_ADD, MAIL_SEEN); just before the call of mail_deliver(), whenever the -S argument is given.
But this does not work. What is wrong?
Is there a better way to set MAIL_SEEN for a locally delivered mail? I would prefer a method that does not require to mess around in the dovecot sources. :-)
Thanks in advance & Best Regards, Stefan
"Stefan Piegsa" s@s7p.de wrote:
Hello everybody,
I am using dovecot 2.0.13 and have a special case here in which I want a mail that is delivered locally with dovecot-lda to be marked as "seen".
In dovecot 1.1.7 I succeeded to achive this, by modifing deliver.c so that upon adding a -S switch to the command arguments, the flag MAIL_SEEN was added to the call of mailbox_copy(). This seemed to work pretty good.
With the new version, i tried to do something similar by selectively adding mail_update_flags(ctx.src_mail, MODIFY_ADD, MAIL_SEEN); just before the call of mail_deliver(), whenever the -S argument is given.
But this does not work. What is wrong?
Is there a better way to set MAIL_SEEN for a locally delivered mail? I would prefer a method that does not require to mess around in the dovecot sources. :-)
Thanks in advance & Best Regards, Stefan
Have you considered using sieve for the task? [Using imap4flags extension]
http://wiki.dovecot.org/LDA/Sieve #v+ if address ["Return-Path"] ["my_address@my_domain.com"] { setflag "\\seen"; } #v-
-- [pl>en: Andrew] Andrzej Adam Filip : anfi@onet.eu What if nothing exists and we're all in somebody's dream? Or what's worse, what if only that fat guy in the third row exists? -- Woody Allen, "Without Feathers"
Andrzej Adam Filip AnFi@onet.eu wrote:
"Stefan Piegsa" s@s7p.de wrote:
Hello everybody,
I am using dovecot 2.0.13 and have a special case here in which I want a mail that is delivered locally with dovecot-lda to be marked as "seen".
In dovecot 1.1.7 I succeeded to achive this, by modifing deliver.c so that upon adding a -S switch to the command arguments, the flag MAIL_SEEN was added to the call of mailbox_copy(). This seemed to work pretty good.
With the new version, i tried to do something similar by selectively adding mail_update_flags(ctx.src_mail, MODIFY_ADD, MAIL_SEEN); just before the call of mail_deliver(), whenever the -S argument is given.
But this does not work. What is wrong?
Is there a better way to set MAIL_SEEN for a locally delivered mail? I would prefer a method that does not require to mess around in the dovecot sources. :-)
Thanks in advance & Best Regards, Stefan
Have you considered using sieve for the task? [Using imap4flags extension]
http://wiki.dovecot.org/LDA/Sieve #v+ if address ["Return-Path"] ["my_address@my_domain.com"] { setflag "\\seen"; } #v-
I think such behavior may be handled by script(s) specified via sieve_before or sieve_after. I would recommend using sieve_after to allow users' to override default handling.
http://wiki.dovecot.org/LDA/Sieve/Dovecot
--
[pl>en: Andrew] Andrzej Adam Filip : anfi@onet.eu
All God's children are not beautiful.
Most of God's children are, in fact, barely presentable.
-- Fran Lebowitz, "Metropolitan Life"
participants (2)
-
Andrzej Adam Filip
-
Stefan Piegsa