MSEARCHD(8) System Manager's Manual MSEARCHD(8)

msearchdFastCGI mail archive query server

msearchd [-dv] [-j n] [-p path] [-s socket] [-t tmpldir] [-u user] [db]

msearchd is a server which implements the FastCGI Protocol to provide search facilities for the mail archive.

It opens a socket at /var/www/run/msearchd.sock, owned by www:www with permissions 0660. It will then chroot(8) to /var/www and drop privileges to user “www”. Three child processes are ran to handle the incoming traffic on the FastCGI socket. Upon SIGHUP the database is closed and re-opened. The default database used is at /msearchd/mails.sqlite3 inside the chroot.

The options are as follows:

Do not daemonize. If this option is specified, msearchd will run in the foreground and log to standard error.
Run n child processes.
chroot(2) to path. A path of / effectively disables the chroot.
Create an bind to the local socket at socket.
Path to a directory containing the template files. /etc/smarc by default.
Drop privileges to user instead of default user www and chroot(8) to their home directory.
Enable more verbose (debug) logging. Multiple -v options increase the verbosity.

Template with the trailing part of the page.
Template with the first part of the page. TITLE is replaced with “Search”.
Template for the start of the search page.
Template for the search form. QUERY is replaced with the search query.
Default database.
UNIX-domain socket.

Example configuration for httpd.conf(5):

server "localhost" {
	listen on * port 80
	root "/smarc"

	location "/search" {
		fastcgi socket "/run/msearchd.sock"


Omar Polo <>

April 4, 2023 OpenBSD 7.3