A new implementation for "Forum" in which each forum post is an artifact.
This merge includes lots of enhancements to email notification, backoffice,
configuration, and other subsystems, all in support of the new forum artifacts.
The forum feature is not complete nor bug-free but at this point it seems
good enough to continue development on trunk.
(check-in: 99fcc43f user: drh tags: trunk)

For non-digest subscribers, alerts for new forum posts are now in separate
emails with each email having a subject which is the title of the forum thread,
and with appropriate Message-Id and In-Reply-To header fields so that email
clients can string together the email thread. Digest subscribes still get
just the synopsis.
(check-in: 4d659173 user: drh tags: forum-v2)

Fix the mkbuiltin.c code generator so that it tolerates Windows-style
backslash path separators on its arguments. This fixes the windows build
that was busted by check-in [774bdc83556442c5].
(check-in: 030bf200 user: drh tags: trunk)

Boo. All day I have been checking in changes to the failed-fix branch when
I should have been putting them on the forum-v2 branch. This is a cherry-pick
merge that moves all of the changes from today from failed-fix over to
forum-v2 in one go. The "email" command is renamed to "alert" and is revised
for a better interface. Events that are waiting on moderator approval are
not shown to non-moderator users.
(check-in: 3c532ec5 user: drh tags: forum-v2)

Rearrange some of the subcommands on "fossil alerts" for better UX. Fix
a problem in the /webmail display for messages with no subject. Improved
comments.
(check-in: 81c25431 user: drh tags: failed-fix)

Improvements to email notification. Rename the "email" command to "alerts".
Try to avoid sending alerts about unapproved events, except it is ok to send
such alerts to moderators. This is a work in progress.
(check-in: efbd6caa user: drh tags: failed-fix)

Change the backoffice-nodelay setting back to default off. Work around
a bug in althttpd by making sure CGI runs with no file descriptors open
other than 0, 1, and 2. (Edit:) These changes proved insufficient to clear
the problem.
(check-in: 1073593e user: drh tags: failed-fix)

Make the backoffice-nodelay a setting visible on the settings display,
and make it on by default. This is a temporary fix to avoid webserver
problems until such time as I can figure out what it is about backserver
sleeping that is causing the webserver to latch up.
(check-in: 2566a37e user: drh tags: forum-v2)

Invoke abort() after a call to fossil_panic(), not exit(1). This will leave
a core file if the system is correctly configured. Also show the panic on
debugging logs.
(check-in: 81632289 user: drh tags: forum-v2)

Backoffice processing improvements: Set a timer on the backoffice to prevent
it from running too long. Report errors on failed attempts to open
/dev/null. Use "NUL" instead of "/dev/null" on Windows.
(check-in: 07356e44 user: drh tags: trunk)

Further improvements to webpage_error() and webpage_assert(). Fix
forum processing so that moderator approval and disapproval work.
Add the "Delete" feature to forum that simply nulls out the page using
an edit.
(check-in: 32bbb9a9 user: drh tags: forum-v2)

If the user has the 'D' capability and the "showqp" query parameter
exists, then all query parameters are shown at the top of the webpage.
Also, fix some issues with forum.
(check-in: b48068de user: drh tags: forum-v2)

Add the 'D' Debug user capability. This is designed to show additional
information and controls on webpages for debugging purposes. Also take
steps to avoid trying to generate a webpage error message after the webpage
has already gone out.
(check-in: fd319832 user: drh tags: trunk)

Update the built-in SQLite to the latest trunk version that includes
enhancements that allow a CREATE INDEX statement to occur without
interrupting a running SELECT statement. This is important for correct
operation of "fossil rebuild" since the forumpost table is created
on demand in the middle of a query over the blob table.
(check-in: e2d87cdd user: drh tags: forum-v2)

New options to the "fossil http" command: --in FILE, --out FILE,
--ipaddr ADDRESS, and --nodelay. Use the --in, --out, and --inaddr options
for subprocesses that handle HTTP requests via file I/O. This replaced
the older and undocumented form of the "fossil http" command that accepted
extra arguments. Use the --nodelay option to prevent lengthy backoffice
processing. The use of --nodelay during "fossil ui" on Windows prevents
annoying pauses on that platform.
(check-in: 52943029 user: drh tags: trunk)

Enhance the manifest parser to support parsing of Forum posts artifacts.
At the same time, simplify the artifact syntax error detection logic
using tables rather than straight code.
(check-in: e893e9d0 user: drh tags: forum-v2)

Proposed new design for the forum. Individual posts are stored as ordinary
artifacts and thus participate in sync just like any other artifact. There
is a new artifact type used to describe forum posts. This check-in defines
the format of the new artifact type. Follow-up check-ins on this thread will
attempt to flesh-out the idea in code.
(check-in: 15fa6053 user: drh tags: forum-v2)

The emailblob table holds content a little while before deleting it.
Change the /test-emailblob page to /emailblob, though it is still only
accessible by the administrator.
(check-in: 15a53308 user: drh tags: trunk)

Set an timeout on the database connection to the web-cache. Use the
sqlite3_table_column_metadata() interface to check to see if the web-cache
database file needs to be initialized prior to actually initializing it.
(check-in: e6e806a9 user: drh tags: trunk)

Webmail changes compile on linux, mac, and windows now, so merge them to
trunk. They are not ready for use, but they should not interfere with
the stable parts of the code, and it is easier to test from trunk.
(check-in: 0f6a5ee1 user: drh tags: trunk)

Add a reference count field to the emailblob table and triggers to keep
the reference count current and to drop entries when the reference count
reaches zero.
(check-in: 94da0fb2 user: drh tags: webmail)

Clarify the difference between fossil_fatal() and fossil_panic(). The
fossil_panic() interface puts a message on the error log when generating
webpages. Otherwise the two routines are identical. Convert some
fossil_fatal() calls into fossil_panic() where appropriate. The goal here
is to limit messages on the error log to things that require attention from
the system administrator, or represent bugs.
(check-in: 3f5ab717 user: drh tags: trunk)

Update the built-in SQLite to the lastest 3.25.0 alpha version due to
improved error message processing in that version. 3.25.0 also includes
support for window functions, but we do not (yet) use that feature in Fossil.
(check-in: d66f3224 user: drh tags: trunk)

Add the --nocompress option to the "ui", "server", and "http" commands. This
option prevents HTTP reply compression, which is useful during debugging.
The option is on by default for "test-http". Also, make sure the mimetype
for error messages is set to text/html.
(check-in: cfc7aca2 user: drh tags: trunk)

Add "Download", "Test", and "Truncate" submenu buttons on the /errorlog
page. Show a confirmation page prior to truncating the error log.
Improvements to the /test-warning page, including a link back to /errorlog
through the submenu.
(check-in: c931dd7b user: drh tags: trunk)

The email-server enhancements are far from complete, but they at least
compile now on non-linux systems, so it seems safe to merge the existing
skeleton to trunk and continue development there where it can be more
easily tested on live systems.
(check-in: 0a201f71 user: drh tags: trunk)

Fix the socket_receive() function so that it compiles on systems that
lack the MSG_DONTWAIT macro (Windows). Such systems lose non-blocking
capabilities, but they work otherwise.
(Closed-Leaf
check-in: 31d274d0 user: drh tags: smtp)

Patched cgi_set_cookie() to be a no-op when not running in HTTP(s) mode (e.g. in JSON CLI mode), since g.zTop is not set in that case. Resolves a segfault reported on the ML.
(check-in: f488a5aa user: stephan tags: trunk)

Only add the default <body> element to the header if the configured
header lacks "<body". Formerly, it searched for "<body>" and that
search would fail if the body element contained attributes.
ToDo: This default
body-element mechanism needs to be better documented.
(check-in: 24ecb3bb user: drh tags: trunk)