Documentation? Even a hint? #1

Open
opened 3 months ago by wfdudley2 · 7 comments

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
set:

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

Thanks,
Bill Dudley

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 set: ``` 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 Thanks, Bill Dudley
Poster

I did find this page that has a few "hints" at the bottom.

https://wiki.freebsd.org/Teams/clusteradm/MailingLists

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
directories.

Thanks.

I did find this page that has a few "hints" at the bottom. ``` https://wiki.freebsd.org/Teams/clusteradm/MailingLists ``` 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 directories. Thanks.
Poster

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.

Bill Dudley

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. Bill Dudley
Poster

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]

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] ```
Poster

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:

listname
email@somedomain.com

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".

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: ``` listname email@somedomain.com ``` 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".
bapt referenced this issue from a commit 3 months ago
bapt closed this issue 3 months ago
bapt reopened this issue 3 months ago
Owner

Can you give me more specific about about archives. right now it is just a link to a static http server directory.

Can you give me more specific about about archives. right now it is just a link to a static http server directory.
Poster

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 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.
Poster

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 webmaster@your-domain.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.

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 webmaster@your-domain.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.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.