This is not a simple script (it is almost 20K) and it gives basic (but secure) functionality. It is fairly bare in terms of functionality and appearance, but it does work.
There are a few things you need to configure in the script before you run it. Find these lines (near the top):
Code: Select all
ListDataDir = "C:\Program Files\hMailServer\Lists\" ' Including trailing backslash! AdminUser = "administrator" AdminPass = "yourpassword"
The second and third items are the standard hMailServer administrative username and password.
Paste the code into your EventHandlers.vbs file. Make sure that if you already have code in your OnDeliveryStart event, that you integrate this code and don't overwrite your existing code.
After you have loaded the script in, the next step is to create a normal user named "listserv" in any domains that have mailing lists that you want to automate. The password does not matter, as the mail user will not actually be utilized.
Now we will make the script create default configuration files. From an email client, send an email to the listserv account that you created. In the subject line, type "subscribe xxxxx" where xxxxx is the name of one of the mailing lists that exists on that domain.
For instance, if you have added email@example.com, and you have a mailing list with an address of "firstname.lastname@example.org", then create an email as such:
From: your name here <youremailaddress@here>
Subject: subscribe mail-list
Send this blank email. The server will respond with a validation email message. This is how users will normally be verified, to keep people from forging subscribe requests.
Next, check the ListDataDir that you specified above (it will have been created automatically). You will see two files in there - the one we are interested in is called ListServLists.txt. Open it with a text editor. You will see the following:
Code: Select all
# ListServLists.txt - for use with custom list server script # Lines prefaced with # are ignored # # Syntax of this file (one permission per line): # ListName@Domain Permission # # Valid Permissions: # SUBSCRIBE - Users can join lists via email # SUBSCRIBE_O - Users can subscribe other users to lists via email # UNSUBSCRIBE - Users can leave lists via email # LIST - Users can retrieve list of all other users on list # # Example: # # email@example.com SUBSCRIBE # firstname.lastname@example.org UNSUBSCRIBE email@example.com SUBSCRIBE firstname.lastname@example.org SUBSCRIBE_O email@example.com UNSUBSCRIBE
The list server is now active, with the permissions you specified in the ListServLists.txt file.
I have this operating on my server now, and it seems to be running well. I will likely expand it in future to allow custom response messages for individual lists and so on, but for the moment it does what I need it to. Any questions, please ask!