Web lists-archives.com

Proof of concept: Mailing list "software" without MTA

Sometimes things just stick in my head until I do something to get them out -- sorry. ;-)

I am 100% sure I can create mailing list software that does not need an MTA.  If this post gets to the list, that is proof -- read on if you wish.  (Of course, someone might argue that I've created an MTA, and, maybe, in some sense, I have, but I have avoided the need to set up a "real" MTA which has always proved a very frustrating task for me.)

Also, as this is a proof of concept rather than a polished finished thing, I've done a lot of steps by hand and have not included all the safety checks (e.g., avoiding mail loops, which I'd have to learn how to do) that I would expect in a polished product.

Basically, instead of setting up an MTA, I've used my "windows style" email client (kamil -- an MUA, aiui) to do what is, to me, the heavy lifting.

A "real" mail list program (or "suite" of programs) using this approach would work something like this:

   * a filter in kmail would watch for emails / posts directed to the mailing list, and would put those in a special folder (probably named with the name of the mailing list and maybe some prefix or postfix (not the program ;-)
   * a program (possibly a bash script) would watch that folder (check it periodically), and when a file is found:
      * move it to a work location (removing it from the original folder)
      * process it in various ways using tools like awk, sed, or similar to do things like:
         * optionally check the list of subscribers to make sure it came from a subscriber (unless I want to treat it as an open mail list) -- if from a non-subscriber (or a banned user / spammer), optionally send a rejection message (I found in my "administration" of some yahoo groups, that it often worked better not to send a rejection message to a known spammer -- if you send a message, they often try to subscribe (or resubscribe) and then resend the spam -- if you don't send a message, they often seem to assume that there is no problem, never realizing that their messages weren't getting to the list)
         * optionally call it to the attention of the owner of the list (or of the computer it is running on) if the list (or this user) is to be moderated
         * change some of the message headers as appropriate (including generating a new unique messageID (maybe using `date +%s.%N' and some text string reflecting the name of the mailing list
         * perhaps add things like a new header and footer to the text of the message (like the name of the maillist or group, a MOTD, how to unsubscribe, ...)
         * eventually do whatever is necessary to prevent email loops or similar 
         * other similar things
   * when all such processing is complete, move it to the the "outbox" folder within the local folders of kmail
   * at that point, I might do something to "kick the queue" (issue a dbus message to kmail to initiate the kmail menu command: "File --> Send Queued Messages".  Alternatively, because kmail checks for mail every 10 minutes (configurable), and kicks the queue after retrieving messages, it can just wait until the next message retrieval.
For this proof of concept, I wrote the above, put it in a file, added various headers from a test message that I captured from the outbox folder.  I may have to experiment with the name of the file -- I'll start with something simple, and, if that doesn't work, try to make it look more like the file name of the file I captured from the outbox folder (/rhk/Mail/outbox/cur/1540479607.19725.cJtrX\:2\,S).

I did create a new message ID using date +%s.%N.  I did adjust the date, but only when first creating the file, not after each experiment with a file name.