SQUATTER(8)
π SQUATTER(8) π
squatter β straight outta the Cyrus IMAP docs, section 8 (the admin commands, bestie π
)
β¨ NAME β¨
squatter β Cyrus IMAP documentation
Create SQUAT and Xapian indexes for mailboxes π¦
π¦ SYNOPSIS π¦
general:
squatter [ -C config-file ] [mode] [options] [source]
i.e.:
squatter [ -C config-file ] [ -v ] [ -a ] [ -S seconds ] [ -Z ]
squatter [ -C config-file ] [ -v ] [ -a ] [ -i ] [ -N name ] [ -S seconds ] [ -r ] [ -Z ] mailbox...
squatter [ -C config-file ] [ -v ] [ -a ] [ -i ] [ -N name ] [ -S seconds ] [ -r ] [ -Z ] -u user...
squatter [ -C config-file ] [ -v ] [ -a ] -R [ -n channel ] [ -d ] [ -S seconds ] [ -Z ]
squatter [ -C config-file ] [ -v ] [ -a ] -f synclogfile [ -S seconds ] [ -Z ]
squatter [ -C config-file ] [ -v ] -t srctier(s)... -z desttier [ -B ] [ -F ] [ -U ] [ -T reindextiers ] [ -X ] [ -o ] [ -S seconds ] [ -u user... ]
πΈ DESCRIPTION πΈ
NOTE: the name "squatter" once referred both to the SQUAT indexing engine and to the command used to create indexes. Now that Cyrus supports more than one index type β SQUAT and Xapian, as of this writing β the name "squatter" refers to the command used to control index creation. The terms "SQUAT" or "SQUAT index(es)" refers to the indexes used by the older SQUAT indexing engine. Post v3 thesearch_enginesetting inimapd.confdetermines which search engine is used. π
Okay so real talk, squatter builds a brand-new text index for one or more IMAP mailboxes. The index is literally a unified index of all of the header and body text of each message in a given mailbox. And the whole point? This index is used to significantly reduce IMAP SEARCH times on a mailbox. Slay. π₯
mode is one of indexer, search, rolling, synclog, compact or audit. Pick your fighter. β¨
By default, squatter creates an index of ALL messages in the mailbox β not just those since the last time that it was run. The -i option is used to select incremental updates instead. And heads up bestie: any messages appended to the mailbox after squatter is run will NOT be included in the index. To include new messages in the index, squatter must be run again, or on a regular basis via crontab, an entry in the EVENTS section of cyrus.conf(5), or you can just use rolling mode (-R). π
Here's the synopsis breakdown, one at a time, fr fr:
- In the first synopsis,
squatterindexes all mailboxes. Every single one. Iconic. - In the second synopsis,
squatterindexes the specified mailbox(es). The mailboxes are space-separated. π - In the third synopsis,
squatterindexes the specified user(s) mailbox(es). π«Ά
For the latter two index modes (mailbox, user) one may optionally specify -r to recurse from the specified start, or -a to limit action only to mailboxes which have the shared /vendor/cmu/cyrus-imapd/squat annotation set to "true". No cap. β
In the fourth synopsis, squatter runs in rolling mode. In this mode squatter backgrounds itself and runs as a daemon (unless -d is set), listening to a sync log channel chosen using the -n option, and set up using the sync_log_channels setting in imapd.conf(5). Very soon after messages are delivered or uploaded to mailboxes, squatter will incrementally index the affected mailbox (see notes, below). It's giving always-on main character energy. π
In the fifth synopsis, squatter reads a single sync log file and performs incremental indexing on the mailbox(es) listed therein. This is sometimes useful for cleaning up after problems with rolling mode. We don't talk about what happened. π
In the sixth synopsis, squatter will compact indices from srctier(s) to desttier, optionally reindexing (-X) or filtering expunged records (-F) in the process. The optional -T flag may be used to specify members of srctiers which must be reindexed. These files are eventually copied with rsync -a and then removed by rm. ποΈ
Watch out:rsynccan increase the load average of the system, especially when the temporary directory is ontmpfs. To throttlersyncit is possible to modify the call inimap/search_xapian.cand pass--bwlimit=<number>as further parameter. π
The -o flag may be used to direct that a single index be copied, rather than compacted, from srctier to desttier. The -u flag may be used to restrict operation to the specified user(s). π
For all modes, the -S option may be specified, causing squatter to pause seconds seconds after each mailbox, to smooth loads. Self-care for your server, honestly. πΈ
When using the Xapian engine the -Z option may be specified, for the indexing modes. This tells squatter to consult the Xapian internally indexed GUIDs, rather than relying on what's stored in cyrus.indexed.db, allowing for recovery from broken cyrus.indexed.db at the sacrifice of efficiency. (Trading efficiency for survival? That's the vibe check.) β
NOTE: Incremental updates are very inefficient with the SQUAT search engine. If using SQUAT for large and active mailboxes, you should runsquatterperiodically as an EVENT incyrus.conf(5). Do not skip this, bestie, I'm begging. π
NOTE: Messages and mailboxes that have not been indexed CAN still be SEARCHed, just not as quickly as those with an index. So it's not the end of the world, it's just... not as cute. π’
Finally, squatter reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. π¦
β¨ OPTIONS β¨
okay bestie, this is the part where we go flag by flag, no skipping, no skimming, we read ALL of them π
-C config-fileβ use config-file instead of the defaultimapd.conf(5). yes queen, custom config file, live your truth π-a,--squat-annotβ only build indexes for mailboxes that have the shared/vendor/cmu/cyrus-imapd/squatannotation set to"true".
heads up: the value of the /vendor/cmu/cyrus-imapd/squat annotation gets inherited by every child of that mailbox. so you can index (or not index) a whole mailbox tree by setting one single annotation on the root of that tree to "true" (or "false"). literally one annotation, whole tree handled, iconic π
and if a mailbox does not have a /vendor/cmu/cyrus-imapd/squat annotation on it (or doesn't inherit one), then it is not indexed. so basically the implicit value of /vendor/cmu/cyrus-imapd/squat is "false". no annotation, no index, that's the vibe π
-A,--auditβ audits the mailboxes you specified (or all of them) and reports any unindexed messages. π this feature is only available on the master branch.-d,--nodaemonβ in rolling mode, don't background, and do emit log messages on standard error. chef's kiss for debugging π this feature was introduced in version 3.0.-B,--skip-lockedβ in compact mode, use a non-blocking lock to start, and skip any users who have theirxapianactivefile locked at that moment (i.e. another reindex task is on it). no waiting around, we move πβοΈ this feature is only available on the master branch.-F,--filterβ in compact mode, filter the resulting database so it only includes messages that are not expunged in mailboxes with an existing name/uidvalidity. this feature was introduced in version 3.0.-f synclogfile,--synclog=synclogfileβ read synclogfile, incrementally index all the mailboxes listed in it, then exit. read, index, bye π this feature was introduced in version 3.0.-h,--helpβ display this usage information. classic, we love a help flag π«Ά-i,--incrementalβ incremental updates, but only where indexes already exist. no starting from scratch here, we're just topping up β¨-N name,--name=nameβ only index mailboxes beginning with name while iterating through the mailbox list derived from your other options. filters within the list, not instead of it π-n channel,--channel=channelβ in rolling mode, specify the name of the sync log channel thatsquatterwill listen to. the default is"squatter". this channel must be defined inimapd.conf(5)before you use it, no cap. this feature was introduced in version 3.0.-o,--copydbβ in compact mode, if only one source database is selected, just copy it to the destination instead of compacting. work smarter bestie π this feature was introduced in version 3.0.-p,--allow-partialsβ when indexing, allow messages to be partially indexed. this can happen if attachment indexing is enabled but indexing failed for one or more attachment body parts. if this flag is set, the message is partially indexed andsquattercontinues. otherwisesquatteraborts with an error π also see-P. Xapian only. this feature is only available on the master branch.-P,--reindex-partialsβ when reindexing, attempt to reindex any partially indexed messages (see-p). setting this flag implies-Z. Xapian only. this feature is only available on the master branch.-L,--reindex-minlevel=levelβ when reindexing, index all messages that have an index level less than level. rn Cyrus only supports two index levels: a message for which attachment indexing was never attempted has index level1. a message that has indexed attachments, or does not contain attachments, has index level3. so runningsquatterwithminlevelset to3will make it try to reindex all messages for which attachment indexing never was attempted. future Cyrus versions may introduce additional levels. setting this flag implies-Z. Xapian only. this feature is only available on the master branch.-R,--rollingβ run in rolling mode:squatterruns as a daemon listening to a sync log channel, continuously incrementally indexing mailboxes. see also-dand-n. main character daemon energy π this feature was introduced in version 3.0.-r,--recursiveβ recursively create indexes for all sub-mailboxes of the user, mailboxes or mailbox prefixes you gave as arguments. all the way down, we go deep π-s delta,--squat-skip=deltaβ skip mailboxes that haven't been modified since the last index. how? by comparing the last modification time of a mailbox to the last time the squat index of that mailbox got updated. if the mailbox modification time plus delta is less than the squat index modification time, the mailbox gets skipped. delta is defined in seconds and must be greater than or equal to zero. the historical default delta was60, and honestly that's still a great general choice, but for technical reasons it now must be specified explicitly. Squat only.-S seconds,--sleep=secondsβ after processing each mailbox, sleep for seconds before continuing. great for some load balancing πΈ accepts fractional amounts. this feature was introduced in version 3.0.-T reindextiers,--reindex-tier=reindextiersβ in compact mode, a comma-separated subset of the source tiers (see-t) to be reindexed. similar to-Xbut lets you limit which tiers get reindexed. this feature was introduced in version 3.0.-t srctiers,--srctier=srctiersβ in compact mode, the comma-separated source tier(s) for the compacted indices. at least one source tier must be specified in compact mode. Xapian only. this feature was introduced in version 3.0.-u name,--user=nameβ extra options refer to usernames (e.g.foo@bar.com) rather than mailbox names. usernames are space-separated. this feature was introduced in version 3.0.-U,--only-upgradeβ in compact mode, only compact if re-indexing. Xapian only. this feature is only available on the master branch.-v,--verboseβ increase the verbosity of progress/status messages. sometimes extra messages get emitted on the terminal with this option, and the messages are unconditionally sent to syslog. sometimes messages are sent to syslog only if-vis provided. in rolling and synclog modes,-vvsends even more messages to syslog. more words, more insight, feed me information π₯-X,--reindexβ reindex all the messages before compacting. this mode reads all the lists of messages indexed by the listed tiers, and re-indexes them into a temporary database before compacting that into place. Xapian only. this feature was introduced in version 3.0.-z desttier,--compact=desttierβ in compact mode, the destination tier for the compacted indices. this must be specified in compact mode. Xapian only. this feature was introduced in version 3.0.-Z,--internalindexβ when indexing messages, use the Xapian internalcyrusidrather than referencing the ranges of already indexed messages to figure out if a particular message is indexed. super useful if the ranges get out of sync with the actual messages (e.g. if files on a tier are lost) π Xapian only. this feature is only available on the master branch.
π EXAMPLES π
squatter is typically deployed via entries in cyrus.conf(5), in either the DAEMON or EVENTS sections.
for the older SQUAT search engine β which offers poor performance in rolling mode (-R), ngl β we recommend triggering periodic runs via entries in the EVENTS section, like this:
sample entries from the EVENTS section of cyrus.conf(5) for periodic squatter runs:
EVENTS {
# reindex changed mailboxes (fulltext) approximately every three hours
squatter1 cmd="/usr/bin/ionice -c idle /usr/lib/cyrus/bin/squatter -i" period=180
# reindex all mailboxes (fulltext) daily
squattera cmd="/usr/lib/cyrus/bin/squatter" at=0117
}
for the newer Xapian search engine, and with sufficiently fast storage, rolling mode (-R) offers advantages. using rolling mode requires that squatter be invoked in the DAEMON section.
sample entries for the DAEMON section of cyrus.conf(5) for rolling squatter operation:
DAEMON {
# run a rolling squatter using the default sync_log channel "squatter"
squatter cmd="squatter -R"
# run a rolling squatter using a specific sync_log channel
squatter cmd="squatter -R -n indexer"
}
NOTE: when you're using-Rrolling mode, you MUST enablesync_logoperation inimapd.conf(5)via thesync_log: onsetting, and you MUST define async_logchannel via thesync_log_channels:setting. if you're also using replication, you must either explicitly specify your replicationsync_logchannel via thesync_log_channelsdirective with a name, or specify the default empty name with""(the two-character string U+22 U+22). [please seeimapd.conf(5)for details]. fr fr, don't skip this one π«
NOTE: when configuring rolling search indexing on a replica, you gotta think about whethersync_logswill be written at all. in that case, please consider the settingsync_log_unsuppressable_channelsto make sure that thesync_logchannel yoursquatterinstance depends on keeps getting written. seeimapd.conf(5)for details. π
NOTE: when using the Xapian search engine, you must define various settings in imapd.conf(5). please read all relevant Xapian documentation in this release before using Xapian. read first, then index bestie π
[NB: More examples needed] π yeah, they said it, not me.
π HISTORY π
support for additional search engines was added in version 3.0.
the following command-line switches were added in version 3.0:
-F -R -X -d -f -o -u
the following command-line settings were added in version 3.0:
-S <seconds>, -T <directory>, -f <synclogfile>, -n <channel>, -t srctier..., -z desttier
π FILES π
/etc/imapd.conf,/etc/cyrus.conf
π SEE ALSO π
π AUTHOR π
the Cyrus Team, Nic Bernstein (Onlight)
Β©οΈ COPYRIGHT Β©οΈ
1993β2026, The Cyrus Team
and that's the whole page bestie, we made it π this was version 3.12.3, dated Jul 15, 2026, from the manual section SQUATTER(8). go index something and slay β¨π
π¦ where this page comes from
- ubuntu stonking: cyrus-imapd 3.12.3-3build1 Β· CMU
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms