Documentation? Even a hint?
I'd love to use this, rather than write my own front end to mlmjm.
I've googled my brains out, I can't find any hint of documentation.
By reading the source, I've figured out that I need three environment variables
MLMMJ_WEBVIEW_TEMPLATES=/var/www/mlmmj/docs/assets MLMMJ_WEBVIEW_ARCHIVED_MAILING_LISTS=/var/spool/mlmmj-archived/ MLMMJ_WEBVIEW_MAILING_LISTS=/var/spool/mlmmj/
which I can set in the VirtualHosts stanza for my website.
I don't have archived mailing lists, so I just pointed that to an empty directory for now.
I can load the index page, but no mailing lists show up. I've been
reading the source, but I can't figure out how list_lists() gets invoked.
I'm clearly missing something (or a lot of somethings).
Do you have any docs or even hints?
For what it's worth: FreeBSD 11p9, Apache 2.4.48
I did find this page that has a few "hints" at the bottom.
But that's insufficient, at least for me.
Nuggets gleaned from that page:
mkdir -p /var/spool/mlmmj-webview/subscribe /var/spool/mlmmj-webview/unsubscribe
Make them writable by your web process so that mlmmj-webview can write to those
Another hard fought discovery: if the "desc" file is missing from a list directory, then mlmmj-webview won't show the mailing list in the index list. I can submit a patch to "fix" this, or it can be added to the documentation.
Some more documentation. The following RewriteRules get the index page and the subscription page working. The archives page still eludes me.
RewriteEngine on RewriteRule "^/$" "/cgi-bin/mlmmj-webview/" [H=cgi-script] RewriteRule "^/subscription/(.*)$" "/cgi-bin/mlmmj-webview/subscription/$1" [H=cgi-script]
I figured out how to get the subscribe function to work. Use this RewriteRule:
RewriteRule "^/action$" "/cgi-bin/mlmmj-webview/action" [H=cgi-script]
When a subscribe happens, the following is written to /var/spool/mlmmj-webview/subscribe:
Ditto for "unsubscribe".
There is no code to handle the "archives" button(s). I did write a Perl CGI script to handle archives, but that's beyond the scope of this "issue".
Can you give me more specific about about archives. right now it is just a link to a static http server directory.
I don't know how much you know, so I'll start from the beginning. Archive files for list MMM are stored in /var/spool/mlmmj/MMM/archive, one message per file, using sequential integers starting with 1. The archived messages are stored just as they came out of the MTA, with all headers, attachments, etc. intact. I made the mlmmj directory tree owned by mailnull:www on my FreeBSD machine, mode 750. Web processes can read the archives.
mlmmj-webview generates a link of the form /archives/MMM, and I have a rewrite rule that runs my Perl CGI script:
RewriteRule "^/archives/(.*)$" "/cgi-bin/archives.cgi?list=$1" [H=cgi- script]
archives.cgi is primitive right now. It reads all the files in the archive directory, extracts From:, Date:, Subject: lines, and puts those in a link to this URL:
/show/MMM/NN, where NN is the number of the archived message.
This rewrite rule:
RewriteRule "^/show/([^/]*)/(.*)$" "/cgi-bin/archives.cgi?list=$1&file=$2" [H=cgi-script]
Turns that into another invocation of archives.cgi, which, if given both a list name and a message number, shows the message in the stupidest way possible: it removes all the headers but From:, Date:, and Subject: and then shows the body. This should be handled by some Perl library that displays emails, but I haven't gotten around to researching that.
I hope that answers your question.
I just looked at README.md, and that's a good start. Now I have mlsubscriptions.sh, which was missing heretofore. Also, the subscription template is much more involved than the one that is available as a FreeBSD pkg.
Here is most of the VirtualHosts stanza to get mlmmj-webview running under Apache 2.4 (FreeBSD). It assumes your web sites live under
/var/www. The "assets" directory is located in
/var/www/mlmmj/assets. The mlmmj-webview binary is located in the cgi-bin directory (obviously).
<VirtualHost *:80> ServerName mlmmj.your-domain.com ServerAdmin email@example.com DocumentRoot /var/www/mlmmj ScriptAlias /cgi-bin "/var/www/mlmmj/cgi-bin/" SetEnv MLMMJ_WEBVIEW_TEMPLATES /var/www/mlmmj/assets SetEnv MLMMJ_WEBVIEW_ARCHIVED_MAILING_LISTS /var/spool/mlmmj-archived/ SetEnv MLMMJ_WEBVIEW_MAILING_LISTS /var/spool/mlmmj/ ErrorLog /var/log/mlmmj-error_log CustomLog /var/log/mlmmj-access_log common RewriteEngine on RewriteRule "^/$" "/cgi-bin/mlmmj-webview/" [H=cgi-script] RewriteRule "^/subscription/(.*)$" "/cgi-bin/mlmmj-webview/subscription/$1" [H=cgi-script] RewriteRule "^/action$" "/cgi-bin/mlmmj-webview/action" [H=cgi-script] </VirtualHost>
Feel free to add that to your README.md
The problem I need to solve is to make a web interface so that the owner of ONE mailing list can add/subtract subscribers to his list only, and not other lists that may be hosted on the machine. I run about 25 lists, and 20 of them have owners who are not me. They each have their own mailman logins and can administer their own lists. I can, of course, administer any of them.
Thanks for your work on this.
Deleting a branch is permanent. It CANNOT be undone. Continue?