MLMMJ-ARCHIVE-MID(1)

NAME
mlmmj-archive-mid - resolve Message-ID to mlmmj archive URL

SYNOPSIS
mlmmj-archive-mid -d archivedir -m msgid [-r]

DESCRIPTION
The mlmmj-archive-mid utility resolves an email Message-ID to its corresponding URL in an mlmmj mailing list archive. It searches SQLite databases located in subdirectories of archivedir, each expected to contain a .db file with a “mails” table.

When invoked without arguments, mlmmj-archive-mid operates as a CGI program. It parses the HTTP request using kcgi(3), looks up the Message-ID from the request path, and responds with an HTTP 303 redirect to the archive page.

The CGI exposes two endpoints:

/mid/<Message-ID>
    Redirects to the HTML archive page.

/midraw/<Message-ID>
    Redirects to the raw text version.

When invoked with arguments, it prints the resolved URL to standard output.

The options are as follows:

-d archivedir
    Path to the directory containing mailing list archive subdirectories.

-m msgid
    The Message-ID to look up.

-r  Return the raw text URL instead of the HTML URL.

ENVIRONMENT

MLMMJ_ARCHIVES_DIRECTORY
    Path to the archive directory. Required in CGI mode.

MLMMJ_ARCHIVES_PREFIX
    URL prefix prepended to generated archive paths. Defaults to an empty string.

EXIT STATUS

In CLI mode, mlmmj-archive-mid exits 0 if the Message-ID was found and the URL was printed, or >0 if the Message-ID was not found or an error occurred.

EXAMPLES
Look up a Message-ID from the command line:

    mlmmj-archive-mid -d /var/mlmmj/archives -m "<20230101@example.org>"

Look up the raw text version:

    mlmmj-archive-mid -d /var/mlmmj/archives -m "<20230101@example.org>" -r

SEE ALSO
kcgi(3), sqlite3(3)