Resubmission after N days
Hi,
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
How can this be done with Dovecot/IMAP?
I have programming experience, but I am new to Dovecot/IMAP.
I would like solve this with Dovecot only (without a database or web server).
Does the IMAP protocol over methods which could help?
[1] 43Folder https://en.wikipedia.org/wiki/Tickler_file
Hi, Sounds to me like it can be implemented using sieve. Something like "if is in inbox & is read & is older than n days; then mark as unread". But this means you need to redeliever this mail somehow. Maybe like this: http://serverfault.com/questions/418681/run-sieve-on-maildir (http://serverfault.com/questions/418681/run-sieve-on-maildir) Regards
André Am Mi., Febr. 4, 2015 07:02 schrieb Thomas Güttler : Hi,
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
How can this be done with Dovecot/IMAP?
I have programming experience, but I am new to Dovecot/IMAP.
I would like solve this with Dovecot only (without a database or web server).
Does the IMAP protocol over methods which could help?
[1] 43Folder https://en.wikipedia.org/wiki/Tickler_file (https://en.wikipedia.org/wiki/Tickler_file)
-- http://www.thomas-guettler.de/ (http://www.thomas-guettler.de/)
Is there an extension to allow Sieve to reprocess messages? Normally, Sieve is executed as new messages arrive. Once the message is filed or rejected, Sieve is done and won't get called again on the same message. Now, you could have some other external script that checked periodically for the attributes. Or you could just have your client mark it unread.
Sent from my iPad
On Feb 3, 2015, at 10:26 PM, "André Peters" andre.peters@debinux.de wrote:
Hi, Sounds to me like it can be implemented using sieve. Something like "if is in inbox & is read & is older than n days; then mark as unread". But this means you need to redeliever this mail somehow. Maybe like this: http://serverfault.com/questions/418681/run-sieve-on-maildir (http://serverfault.com/questions/418681/run-sieve-on-maildir) Regards
André Am Mi., Febr. 4, 2015 07:02 schrieb Thomas Güttler : Hi,
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
How can this be done with Dovecot/IMAP?
I have programming experience, but I am new to Dovecot/IMAP.
I would like solve this with Dovecot only (without a database or web server).
Does the IMAP protocol over methods which could help?
[1] 43Folder https://en.wikipedia.org/wiki/Tickler_file (https://en.wikipedia.org/wiki/Tickler_file)
-- http://www.thomas-guettler.de/ (http://www.thomas-guettler.de/)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 4 Feb 2015, Thomas Güttler wrote:
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
What mail storage are you using? With Maildir all messages are plain files, you could move those messages into a specific folder and do:
find /path/to/folder -mtime +$days -print0 |
xargs -r0 mv -t /path/to/INBOX/new
In my experience you can keep all attributes, keywords etc.pp. on the filename. Depending on how you read your messages, your target directory could be "cur" instead of "new".
How can this be done with Dovecot/IMAP?
I have programming experience, but I am new to Dovecot/IMAP.
So, with Maildir and the normal Unix commands (or a script language), that should be easy.
I would like solve this with Dovecot only (without a database or web server).
If you use another storage or some other tagging scheme, see doveadm . With that command you can search for messages and move them, please search the list for examples.
Does the IMAP protocol over methods which could help?
Hm, you could use the meta data plugin or even keywords (aka labels), in order to store the "tags" per message, but I would use normal folders.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVNHBB3z1H7kL/d9rAQK86gf6AjQ5WRCXtjlAq4IQRU7EqE3eC8pS2wH2 aoryBcRvaClg3L4vt2RTMtgfglVGAJM9F8pK6+t8d9TyCZ0DbAEEE7kjf6tdD4G+ GTaXLmruZ1V7hyipipeAxUmiX6l2adfPUshJDrEE1xTd/XgtsCi2yXqge9ugxgIo qH5HuXjVIp5X1IIc33yQXTvqrnyspdD4LVBpSgwG5WRUFdhiROCGxjJ6iTyCLdts PB0XJaGHq5a8r1FfVTyd31zKQqebhTUCpn/gre3cABHvkBh7H3PQvXeI92QwLa4w r5jnCyq5MO/dfwHdUn2SPJlpYaLcHhL2oFw0csXzDe3ZeMFYECnl3A== =1JaM -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 4 Feb 2015, Steffen Kaiser wrote:
On Wed, 4 Feb 2015, Thomas Güttler wrote:
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
What mail storage are you using? With Maildir all messages are plain files, you could move those messages into a specific folder and do:
find /path/to/folder -mtime +$days -print0 |
xargs -r0 mv -t /path/to/INBOX/newIn my experience you can keep all attributes, keywords etc.pp. on the filename. Depending on how you read your messages, your target directory could be "cur" instead of "new".
How can this be done with Dovecot/IMAP?
I have programming experience, but I am new to Dovecot/IMAP.
So, with Maildir and the normal Unix commands (or a script language), that should be easy.
I would like solve this with Dovecot only (without a database or web server).
If you use another storage or some other tagging scheme, see doveadm . With that command you can search for messages and move them, please search the list for examples.
Does the IMAP protocol over methods which could help?
Hm, you could use the meta data plugin or even keywords (aka labels), in order to store the "tags" per message, but I would use normal folders.
I've read the wiki page more closely, if you really store the messages "to be filed according to the future date on which each document needs action", say "to-do.2015-02-28", you can use doveadm mailbox to get the mailbox names and doveadm move to move the messages to the INBOX, probably delete empty mailboxes. (Note: the German useage of "mailbox" is different than in English, it's a false friend.)
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVNHHZnz1H7kL/d9rAQI/OAf9EzXkj67AbCwHpHZ2RTxghikHa0YCNRAX eT5ew/R1cjhjCrt3YFJl4P05j9FBVbwkvodgVWPNl/pP2eDse54hIuT0K+mXsiE3 21h1nLQFANXM5QBAyHFbAlq8juZi1OAeZ/EOfqb5cpkVEziHAsz33ovW9V3KzyYA hYDIwfjLHZfWEwHTlg6in7YxxsAZsirs75kYGENzNWckR/rVd4AonOQS7/O4/zny Bvo//GNB+DrSqpEggzr2BJxKK/R1T91wBhKhOlU8KYvaNNwoA7X4O8YveBXR0qvP aDqeP87xCrBqKBgdbg+eLadCgfgA7qK9IeNCmAzH1JqcpGPhy2+BMg== =9HJX -----END PGP SIGNATURE-----
On 03 Feb 2015, at 23:49 , Steffen Kaiser skdovecot@smail.inf.fh-brs.de wrote:
What mail storage are you using? With Maildir all messages are plain files, you could move those messages into a specific folder and do:
find /path/to/folder -mtime +$days -print0 |
xargs -r0 mv -t /path/to/INBOX/new
That’s simple enough, and would work.
You could do something like what SaneBox does and create custom named folders like @nextWeek @tomorrow @nextMonth and so on. Honestly, it seems almost straight forward. There must be something I’m missing.
-- 'I knew the two of you would get along like a house on fire.' Screams, flames, people running for safety...
Am 04.02.2015 um 07:49 schrieb Steffen Kaiser:
On Wed, 4 Feb 2015, Thomas Güttler wrote:
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
What mail storage are you using? With Maildir all messages are plain files, you could move those messages into a specific folder and do:
Yes, I use Maildir
find /path/to/folder -mtime +$days -print0 |
xargs -r0 mv -t /path/to/INBOX/new
Yes, this should work. But a solution which uses IMAP would be preferred.
Thomas
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 4 Feb 2015, Thomas Güttler wrote:
Am 04.02.2015 um 07:49 schrieb Steffen Kaiser:
On Wed, 4 Feb 2015, Thomas Güttler wrote:
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
What mail storage are you using? With Maildir all messages are plain files, you could move those messages into a specific folder and do:
Yes, I use Maildir
find /path/to/folder -mtime +$days -print0 |
xargs -r0 mv -t /path/to/INBOX/newYes, this should work. But a solution which uses IMAP would be preferred.
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVNMi3Hz1H7kL/d9rAQJj5Af+PEi7dDRcn8aVIB4QRhOLsT0X6IQscMQq 6iftyMNTpjLCNrPg+ED291CtCJ27C/FG7lXsr1TgiCt2IXxkDewlaj9SEk8bX4Pe 6WE6I6ABmsolr/zh5YMfcuDWaojCOZ4o45xI2ljECGaKbqQAi0EPR8YaKhk7zNp/ rby8MM3zhKWq3FG716nm1rZF4ZdewlpAVL2V+SK+IvM1F/mz3LQknwdoxtMCpmHI lIGWqikDaGYcmkbqdtOiF7A7++OKkahX0OMLtl3NUqD010pHebNQXXfefAdpC3zl 7dTGhs/GLLGKt5hMsGeai/1HhQz/vGLD8cEVvBg0g4qJ4XVq0xyczw== =hQHz -----END PGP SIGNATURE-----
On 05. feb. 2015 08:59, Steffen Kaiser wrote:
On Wed, 4 Feb 2015, Thomas Güttler wrote:
Am 04.02.2015 um 07:49 schrieb Steffen Kaiser:
On Wed, 4 Feb 2015, Thomas Güttler wrote:
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
What mail storage are you using? With Maildir all messages are plain files, you could move those messages into a specific folder and do:
Yes, I use Maildir
find /path/to/folder -mtime +$days -print0 |
xargs -r0 mv -t /path/to/INBOX/newYes, this should work. But a solution which uses IMAP would be preferred.
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them.
No need to use the IMAP server directly.
Read the manual pages for doveadm(1) and the pages it refers to like doveadm-move(1) and doveadm-flags(1) , check out the \Seen flag. Then sit down with your favourite scripting language, and make some cron-jobs.
On principle you do NOT want to manipulate the the dates of the mails, but the user could sort by order received, to get the recently moved mails displayed at the top of the mailbox listing.
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them.
You are right moving the mail should be simple.
I ask myself it is possible to store the date of the resubmission in the mail itself.
Thomas
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 5 Feb 2015, Thomas Güttler wrote:
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them.
You are right moving the mail should be simple.
I ask myself it is possible to store the date of the resubmission in the mail itself.
How shall the date be visible to the user?
Remember that altering the message may invalidate DKIM and other security / verification stuff.
Instead of a simple "mv" you can prefix the message with "X-Date: " header, so you mark the message, but it is not visible to the user.
If your goal is to have the message "up" according the client side message sorting by date, you would need to alter the Date: header and possibly break message verification.
What's your goal in order to " store the date of the resubmission "?
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVNNRcnz1H7kL/d9rAQIYjAf/WXg66jD3c9Lh+gRA7wiLkTtUKwNRdECr wPAiUnKoNs2pQn3L0k2sSXyZ0xPWAf4kWB6SH5QiVdJ7auvsTrcz/tuXY0Ir+oOL R6RBymXOCObKhnNziVuJbNshSbslj8kNvd0UOOOH//4ID8tXx3i3CbtkpO5h4gtV lySwuVZesDpJOG/+UuyliR2qEtwSG/5L99wvijzVT+SubIyQMX6tesL5Us0A1fGE 9B8XcNyISEUVjLcBHF9C8SmBv8Ux8GOBO1TnrpUH6EzVdYCR6YNOkw9DBgKBEw5S VRqjfkePr4eZP1ZLJenW/DbqXLCOPFtasGBsfTqNrNLU9q0BTesmyA== =Edop -----END PGP SIGNATURE-----
Am 05.02.2015 um 12:18 schrieb Steffen Kaiser:
On Thu, 5 Feb 2015, Thomas Güttler wrote:
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them.
You are right moving the mail should be simple.
I ask myself it is possible to store the date of the resubmission in the mail itself.
How shall the date be visible to the user?
Remember that altering the message may invalidate DKIM and other security / verification stuff.
Instead of a simple "mv" you can prefix the message with "X-Date: " header, so you mark the message, but it is not visible to the user.
If your goal is to have the message "up" according the client side message sorting by date, you would need to alter the Date: header and possibly break message verification.
What's your goal in order to " store the date of the resubmission "?
My goal is to use IMAP only, not external database. But I guess this is not possible.
I could alter the subject of the mail. What kind of message verification could break?
Regards, Thomas Güttler
On 05. feb. 2015 22:29, Thomas Güttler wrote:
Am 05.02.2015 um 12:18 schrieb Steffen Kaiser:
On Thu, 5 Feb 2015, Thomas Güttler wrote:
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them. You are right moving the mail should be simple. I ask myself it is possible to store the date of the resubmission in the mail itself. How shall the date be visible to the user?
Remember that altering the message may invalidate DKIM and other security / verification stuff.
Instead of a simple "mv" you can prefix the message with "X-Date: " header, so you mark the message, but it is not visible to the user.
If your goal is to have the message "up" according the client side message sorting by date, you would need to alter the Date: header and possibly break message verification.
What's your goal in order to " store the date of the resubmission "?
My goal is to use IMAP only, not external database. But I guess this is not possible.
I could alter the subject of the mail. What kind of message verification could break?
Regards, Thomas Güttler
(code samples are for bash. untested.)
Putting data in the mail is hard without violating mail integrity.
If you really want this, an easy way would be to have doveadm create a <code> mailbox "resubmit"</code> folder, and subfolders under there with names like "date --iso" gives you, eg with <code> mailbox "resubmit."$(date -d "next week" +"%F")</code> . Note: "next week" , with the quotes, literally is a valid value for date -d .
Then have a cron job moving from <code>mailbox "resubmit."$(date --iso)</code> to inbox. Remember to remove the \Seen flag from the mail.
If you do not want to see the mails before next week, just do not subscribe to those folders (see -s flag to doveadm mailbox create )
Now, pick a scripting-language and start coding :-) .
-- Håkon Alstadheim / N-7510 Skatval / email: hakon@alstadheim.priv.no tlf: 74 82 60 27 mob: 47 35 39 38 http://alstadheim.priv.no/hakon/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 5 Feb 2015, Thomas Güttler wrote:
Am 05.02.2015 um 12:18 schrieb Steffen Kaiser:
On Thu, 5 Feb 2015, Thomas Güttler wrote:
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them.
You are right moving the mail should be simple.
I ask myself it is possible to store the date of the resubmission in the mail itself.
How shall the date be visible to the user?
Remember that altering the message may invalidate DKIM and other security / verification stuff.
Instead of a simple "mv" you can prefix the message with "X-Date: " header, so you mark the message, but it is not visible to the user.
If your goal is to have the message "up" according the client side message sorting by date, you would need to alter the Date: header and possibly break message verification.
What's your goal in order to " store the date of the resubmission "?
My goal is to use IMAP only, not external database. But I guess this is not possible.
Maybe I rephrase: How should the Resubmission interfaces to the users, how shall the users work with it? The first sentence of the quoted text contains an IMAP-only variant. However, pick up Håkon's advice and use STORE to remove the SEEN flag. So I wonder how the Resubmission shall work.
I could alter the subject of the mail. What kind of message verification could break?
For instance DKIM, it may (or may not) sign Date, Subject and other headers.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVNRyxXz1H7kL/d9rAQIiFgf/XUcOFxGgUcdCXGDHMTDsa4nFr+gqwMAl 8fzztuKeheqrsGpGKpYb9lwg5oq0N7Q+Otnj0TSgZ2+JkpOdCDFxVLHyYJoxM4/a mSSGm8XHekiI9IKxzSV8Ojplx26vev/4vxvHJgoGNukstHiFzI4tTE0OpiI2E3eg +HUltwwZey57JIS1hHIr33lvJsgLwsBjBkgiOU0+Lkurh7/8HLXP0Z/UKeuL9cib 6E7ZiiV0EhYjkP6urQFxWNfrt7OnhFtQlbI9Dwkirf630cn053/m9Em+vBu5DEcq CAJSTLAMf6z8EPWkUstlq3WMsGUxVYPXTEy5+Nv0Lb8RS9OJyWSSOw== =yk7F -----END PGP SIGNATURE-----
Am 06.02.2015 um 08:52 schrieb Steffen Kaiser:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 5 Feb 2015, Thomas Güttler wrote:
Am 05.02.2015 um 12:18 schrieb Steffen Kaiser:
On Thu, 5 Feb 2015, Thomas Güttler wrote:
What specific action shall be done via IMAP? The move? Then use any IMAP client library, use the LIST command to get the mailboxes, FETCH to get the messages and COPY/EXPUNGE to move them.
You are right moving the mail should be simple.
I ask myself it is possible to store the date of the resubmission in the mail itself.
How shall the date be visible to the user?
Remember that altering the message may invalidate DKIM and other security / verification stuff.
Instead of a simple "mv" you can prefix the message with "X-Date: " header, so you mark the message, but it is not visible to the user.
If your goal is to have the message "up" according the client side message sorting by date, you would need to alter the Date: header and possibly break message verification.
What's your goal in order to " store the date of the resubmission "?
My goal is to use IMAP only, not external database. But I guess this is not possible.
Maybe I rephrase: How should the Resubmission interfaces to the users, how shall the users work with it? The first sentence of the quoted text contains an IMAP-only variant. However, pick up Håkon's advice and use STORE to remove the SEEN flag. So I wonder how the Resubmission shall work.
me too. That's why I asked the question on this list. Sad but true, I guess there is no solution. Thank you very much for your feedback.
Regards, Thomas
On Wednesday 04 February 2015 07:01:14 Thomas Güttler wrote:
Hi,
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days. - Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days. - After 5 days the mail should be moved to my inbox again.
How can this be done with Dovecot/IMAP?
I have programming experience, but I am new to Dovecot/IMAP.
I would like solve this with Dovecot only (without a database or web server).
Does the IMAP protocol over methods which could help?
[1] 43Folder https://en.wikipedia.org/wiki/Tickler_file
Mihai Bădici http://mihai.badici.ro
Why don't you use a calendar application to put an event related to that mail? You can use the kolab approach ( IMAP only) for this.
On 04. feb. 2015 07:01, Thomas Güttler wrote:
Hi,
I would like to implement a 43Folder system[1] with dovecot and a mail user agent.
Use case:
- I have a new mail in my inbox. I read it and see that I can't handle it now. I want to handle this mail in 5 days.
- Now I want to have some sort of resubmission: the mail should be moved to a different location for these 5 days.
- After 5 days the mail should be moved to my inbox again.
How can this be done with Dovecot/IMAP?
I have programming experience, but I am new to Dovecot/IMAP.
I would like solve this with Dovecot only (without a database or web server).
Does the IMAP protocol over methods which could help?
[1] 43Folder https://en.wikipedia.org/wiki/Tickler_file
I would abandon this tack. Inspiration for a different angle: When I right-click a mail in the Icedove (Thunderbird) I am offered to convert the mail into an event or a task. A possible work flow would be to have a single "postponed" folder (also known as mailbox) , and move stuff into there while at the same time converting them to tasks/events.
This functionality has been fragile in the past, in that certain contents in the mail would render the event/task invalid. Combination of bugs in the conversion from regular email and the reading of calendar info in my case (davical networked calendar).
I think that any effort on your part would be better spent testing and polishing a solution involving some kind of calendar backend.
participants (7)
-
André Peters
-
Håkon Alstadheim
-
LuKreme
-
Mihai Badici
-
Randall Gellens
-
Steffen Kaiser
-
Thomas Güttler