use IMAPSIEVE to update database with last_read date
Just noticed the Dovecot support IMAPSIEVE extension…
Could I use this extension to update an external database with the date that the user last read the message?
My app sends certain “notification” messages to the user’s dovecot mail address. The user reads the messages in their dovecot mailboxes only using IMAP. I want to update my app’s database to record this read time for all “notification” messages sent by the app.
Seems to me I could write a short sieve script to send a “notify” message to an app specific address that my app “watches” and updates the appropriate database record with the last_read time.
Is this workable for production deploy?
Or, is there a better way for a sender to be notified when the recipient actually reads the message? The sender will be my app and the recipient is a dovecot mailbox accessed by IMAP.
Kevin
Op 29-11-2016 om 19:29 schreef KT Walrus:
Just noticed the Dovecot support IMAPSIEVE extension…
Could I use this extension to update an external database with the date that the user last read the message?
No, IMAPSieve is only triggered by modifications: APPEND, COPY, MOVE and STORE.
My app sends certain “notification” messages to the user’s dovecot mail address. The user reads the messages in their dovecot mailboxes only using IMAP. I want to update my app’s database to record this read time for all “notification” messages sent by the app.
Seems to me I could write a short sieve script to send a “notify” message to an app specific address that my app “watches” and updates the appropriate database record with the last_read time.
Is this workable for production deploy?
Or, is there a better way for a sender to be notified when the recipient actually reads the message? The sender will be my app and the recipient is a dovecot mailbox accessed by IMAP.
I don't see a solution at this time. You'd need to use some derivative of the notify plugin to do something like this. But afaik it doesn't exist. The push-notification plugin comes close though.
Regards,
Stephan.
Op 30-11-2016 om 11:37 schreef Stephan Bosch:
Op 29-11-2016 om 19:29 schreef KT Walrus:
Just noticed the Dovecot support IMAPSIEVE extension…
Could I use this extension to update an external database with the date that the user last read the message?
No, IMAPSieve is only triggered by modifications: APPEND, COPY, MOVE and STORE.
BTW, if you're instead interested in the date that the user *first* read the message, you could capture the STORE \Seen event.
Regards,
Stephan.
if you're instead interested in the date that the user *first* read the message, you could capture the STORE \Seen event.
Yes. That is what I intend to do. That is, the sieve script will run on change of FLAGs. I really just want to verify that the user is reading certain emails that I send. I don’t need to track every time the user reads the message (which the mail server would never see anyway since the message is fetched on first read and then stored locally in the client).
I’m also planning on delivering most messages by IMAP to a “next day” mailstore and use doveadm sync (during the early morning) of the “next day” mailstore to the “current day” mailstore that the clients connect to. Some messages will be delivered directly to the “current day” mailstore via Postfix/LMTP which should be copied into the “next day” mailstore during the morning sync.
I’m hoping that doveadm sync is really bullet-proof and won’t add to my administration burden. Using IMAPSIEVE to track user’s modification of their mailboxes will really help keeping the website’s mysql database up to date with changes to Dovecot side of the website.
Kevin
On Nov 30, 2016, at 7:07 AM, Stephan Bosch stephan@rename-it.nl wrote:
Op 30-11-2016 om 11:37 schreef Stephan Bosch:
Op 29-11-2016 om 19:29 schreef KT Walrus:
Just noticed the Dovecot support IMAPSIEVE extension…
Could I use this extension to update an external database with the date that the user last read the message?
No, IMAPSieve is only triggered by modifications: APPEND, COPY, MOVE and STORE.
BTW, if you're instead interested in the date that the user *first* read the message, you could capture the STORE \Seen event.
Regards,
Stephan.
participants (2)
-
KT Walrus
-
Stephan Bosch