[Dovecot] Speed up large maildirs

John Tobin John.Tobin at cs.tcd.ie
Tue Feb 15 21:36:42 EET 2005


On Tue, Feb 15, 2005 at 07:53:38PM +0100, Leen Besselink wrote:
> Where a small patch to procmail which uses standard out for telling the LDA or wrapper what
> files it delivered to, would be pretty easy.

You can already do that with procmail: $LASTFOLDER contains the name of
the file procmail delivered to (sometime it's relative to $MAILDIR,
sometimes it's absolute - it seems to depend on where it's used), so you
could use those two to tell the LDA which file to check.  You might be
able to use the TRAP variable to achieve this; however all output from
the TRAP command is logged to $LOGFILE, I don't know if it goes to
STDOUT as well.  If you wanted to use a daemon you could adapt the
Python code shown previously to read from a named pipe, and pop this
near the start of your .procmailrc:
	TRAP='echo "$LASTFOLDER" > /path/to/pipe'
or invoking it directly:
	TRAP='/path/to/reindex/program "$LASTFOLDER"'

If you only want this for one mailbox you could add the 'c' flag to the
recipe and duplicate the recipe directly afterwards, making the action
	| echo "$MAILDIR/$LASTFOLDER" > /path/to/pipe
or:
	| /path/to/reindex/program "$MAILDIR/$LASTFOLDER"'

You seem to need "$MAILDIR/$LASTFOLDER" here instead of just
"$LASTFOLDER", though it may differ for you.

Hopefully this will be useful to you,

-- 
John Tobin
"A method of styling hair to cover partial baldness using only the hair
on a person's head. The hair styling requires dividing a person's hair
into three sections and carefully folding one section over another."
						 -- US Patent #4,022,227



More information about the dovecot mailing list