[Dovecot] Is it possible to regenerate the index files?
Is it possible to regenerate the index files, on other conditions than the mbox file being read?
For instance, it would be nice if I could regenerate the index for a specific mbox whenever procmail delivers mail to it.
If theres no existing solution, would it be possible to make a small script with something like "nc" that could send an imap command to dovecot, so that dovecot would rebuild its index for that mbox? If so, which imap command triggers an index rebuild?
-- Joakim Verona www.verona.se
On Fri, 2005-03-11 at 12:25 +0100, Joakim Verona wrote:
Is it possible to regenerate the index files, on other conditions than the mbox file being read?
For instance, it would be nice if I could regenerate the index for a specific mbox whenever procmail delivers mail to it.
If theres no existing solution, would it be possible to make a small script with something like "nc" that could send an imap command to dovecot, so that dovecot would rebuild its index for that mbox? If so, which imap command triggers an index rebuild?
export MAIL=mbox:/home/user/mail # ie. the default_mail_env expanded echo "1 status inbox (messages)" | /usr/local/libexec/dovecot/imap
For 1.0-test releases there should pretty soon come Dovecot LDA which saves the mail and updates the indexes immediately. I have a working test version of it already..
Timo Sirainen tss@iki.fi writes:
On Fri, 2005-03-11 at 12:25 +0100, Joakim Verona wrote:
Is it possible to regenerate the index files, on other conditions than the mbox file being read?
For instance, it would be nice if I could regenerate the index for a specific mbox whenever procmail delivers mail to it.
If theres no existing solution, would it be possible to make a small script with something like "nc" that could send an imap command to dovecot, so that dovecot would rebuild its index for that mbox? If so, which imap command triggers an index rebuild?
export MAIL=mbox:/home/user/mail # ie. the default_mail_env expanded echo "1 status inbox (messages)" | /usr/local/libexec/dovecot/imap
Ok, that seems fairly easy... One tiny question though: what does the "1" mean? I tried to parse the RFC but couldnt figure it out. I guess its just some sequence id.
For 1.0-test releases there should pretty soon come Dovecot LDA which saves the mail and updates the indexes immediately. I have a working test version of it already..
Nice! But will it work together with procmail?
-- Joakim Verona www.verona.se
On Mon, 2005-03-14 at 10:18 +0100, Joakim Verona wrote:
export MAIL=mbox:/home/user/mail # ie. the default_mail_env expanded echo "1 status inbox (messages)" | /usr/local/libexec/dovecot/imap
Ok, that seems fairly easy... One tiny question though: what does the "1" mean? I tried to parse the RFC but couldnt figure it out. I guess its just some sequence id.
It's a "tag". Something like sequence id, but it doesn't have to be numeric. Server just replies to that command with the same tag.
For 1.0-test releases there should pretty soon come Dovecot LDA which saves the mail and updates the indexes immediately. I have a working test version of it already..
Nice! But will it work together with procmail?
I'm pretty sure it does, although I'm not very good with procmail (and I don't want to be). After the Dovecot LDA gets Sieve support, there's not that much reason to use procmail.
Timo Sirainen tss@iki.fi writes:
On Mon, 2005-03-14 at 10:18 +0100, Joakim Verona wrote:
export MAIL=mbox:/home/user/mail # ie. the default_mail_env expanded echo "1 status inbox (messages)" | /usr/local/libexec/dovecot/imap
I had a small problem with this:
[joakim@naru BUILD]$ export MAIL=mbox:~/:INBOX=/var/spool/mail/joakim ; echo "1 status inbox (messages)" | /usr/libexec/dovecot/imap
returns:
- PREAUTH [CAPABILITY IMAP4rev1 SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS] Logged in as joakim imap(joakim): Error: open(/var/spool/mail/.temp.naru.home.32308.e74f92ade9b3bf72) failed: Permission denied imap(joakim): Error: file_lock_dotlock() failed with mbox file /var/spool/mail/joakim: Permission denied 1 NO Internal error occured. Refer to server log for more information. [2005-03-14 13:04:58]
I have this in my dovecot.conf:
mbox_write_locks = fcntl
so how can I get imap to read the configuration in this use case?
It's a "tag". Something like sequence id, but it doesn't have to be numeric. Server just replies to that command with the same tag.
ok, thanks for the explanation.
Nice! But will it work together with procmail?
I'm pretty sure it does, although I'm not very good with procmail (and I don't want to be). After the Dovecot LDA gets Sieve support, there's not that much reason to use procmail.
Thats sounds very nice. I dont have any experince with Sieve, but after what I googled after this mail exchange, it seems nicer than procmail.
So maybe I can convert my procmail stuff to Sieve in anticipation of dovecot LDA getting Sieve support then.
-- Joakim Verona www.verona.se
On Mon, 2005-03-14 at 13:06 +0100, Joakim Verona wrote:
export MAIL=mbox:/home/user/mail # ie. the default_mail_env expanded echo "1 status inbox (messages)" | /usr/local/libexec/dovecot/imap I have this in my dovecot.conf:
mbox_write_locks = fcntl
so how can I get imap to read the configuration in this use case?
export MBOX_WRITE_LOCKS=fcntl
Usually they're the same names as in dovecot.conf but in uppercase.
participants (2)
-
Joakim Verona
-
Timo Sirainen