Distribution list enhancement

This section contains scripts that hMailServer has contributed with. hMailServer 5 is needed to use these.
andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Distribution list enhancement

Post by andyp » 2009-06-06 10:17

hMailServer is one of the few mailservers for windows supporting distribution list. But compared to linux (majordomo or mailman) the features of the distribution list are very thin. As I have extensive use of the lists, I have written a script to extend the list features.
This script comes close to the feature request real list server.
The features are:
  • Define a password in the subject of the mail
  • Allow list members to post to the list
  • Allow general and list-specific addresses to post to the list
  • Define an action in case the sender is not allowed: delete or redirect to admin
  • Send a success/failure notification to the sender, whether the mail passes/doesn't pass
  • Modify headers (Sender, Reply-To, Return-Path) of the email
  • Change the MAIL FROM: in SMTP Session
  • Allow only certain extension for attachments
  • Restrict the size for all attachments and each attachment for itself
  • Define a prefix added to the subject
  • Add a header and footer to the mail (text and html)
  • Allow to (un)subscribe to the list via email (single address or list of addresses)
    Available command are help, list, (un)subscribe, (un)subscribeaddress, (un)subscribelist
  • Deny certain subscription commands
  • Apply standard setting to all list or accounts or only to certain/excluded addresses
  • Use other config files from one config file
  • Attach the list recipients at the footer
I had this script for a few months now in the developer section. So it should be ready for a version1.

Installation manual is in the zip.

Version2: Several added features like standard settings and references in the config files
Attachments
listserver_v5_version2.zip
(15.9 KiB) Downloaded 1642 times
listserver_v5_version1.zip
(13.64 KiB) Downloaded 915 times
Last edited by andyp on 2009-10-31 13:11, edited 3 times in total.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Distribution list enhancement

Post by martin » 2009-06-06 14:50

> But compared to linux (majordomo or mailman) the features of the distribution list are very thin.

hMailServer has distribution lists - not mailing lists. I don't see these as the same thing, as they have completely different purposes.

As I see it, this script isn't an "enhancement of distribution lists", it's an script implementation of mailing lists.

Nice work though. :)

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-06-06 19:37

hMailServer has distribution lists - not mailing lists.
Yes, I know. Two years ago, I had a hard time to find any free mailserver with some list feature. Hmailserver is one of or still the best mailserver, but I simply required that feature, so I wrote the script.

elkvis
New user
New user
Posts: 5
Joined: 2007-06-07 05:26

Re: Distribution list enhancement

Post by elkvis » 2009-08-18 14:41

This appears to have eveything i wanted to add to my distriubtion lists; and loads more. And apparently relatively easy to use.
Cheers.


Bleh, now I'm going to need a testing server.

ratta-tat
New user
New user
Posts: 13
Joined: 2008-02-07 14:19

Re: Distribution list enhancement

Post by ratta-tat » 2009-09-06 20:07

Hi,

forget that what i wrote. It was a mistake made by me. After reading the instructions again, I found out the problem. It is very important to write the emailadress of the "config file" a little bit strange ;) it has to be exactly like the example: email_at_domain_com <<-- when I write my config like that it works perfect.

Tank you for that great script, enhances my hMail to the fetures I missed since changing from Mercury to hMail.

Greetz
Björn
I tried to use the script, but it doesn't work. Tried it severall times with different settings. Every time it gives me the follwing entry in the log hmailserver_event_2009xxxx:

"9/6/2009 7:55:44 PM" "------------------------- OnDeliveryStart Event -----"
"9/6/2009 7:55:44 PM" "Mail FromAddress: user@mail.com"
"9/6/2009 7:55:44 PM" "Mail From: User <user@mail.com>"
"9/6/2009 7:55:44 PM" "Mail To: test@mydomain"
"9/6/2009 7:55:44 PM" " Starting mail configuration check"
"9/6/2009 7:55:44 PM" " Recipient: test@mydomain"
"9/6/2009 7:55:44 PM" " --> no config file found."
"9/6/2009 7:55:44 PM" " No recipient configured"
"9/6/2009 8:00:16 PM" "------------------------- OnAcceptMessage Event -----"

---> the emailadress and the domain was changed by me. just an info what's written in the file.

First of all I got my installation of the hmailserver under c:\program files (x86) - windows server 2003 r2 x64.
I copied the whole script to the file EventHandlers.vbs, activated VB script under hmail checked it - done.
The configuration file is under the folder c:\program files (x86)\hmailserver\lists\test_mydomain - that is the part i inserted to my config. Under this folder there is my config file \test@mydomain.txt - tried it with and without .txt - won't work.

Okay anyway maybee the path in "c:\program files (x86)" is too long ore to 'strange' for vb. Tried it with the old 8.3 short art c:\progra~2\hamilserver\ etc... (yes i made it sure, that the path is available...) - won't work

Las thing I did was to junktion the whole hmail folder to c:\hmailserver and reconfigured the path entries in the eventhandler again. - won't work.

Is the script not working with the latest v5.2_356?
Is there any mistake which could be done by me?

Thanks for any idea and help...
Best Regards
Björn

ratta-tat
New user
New user
Posts: 13
Joined: 2008-02-07 14:19

Re: Distribution list enhancement

Post by ratta-tat » 2009-09-08 19:29

Hi again ;)

after getting that script to work there is question comming up: is there a way to prevent the sender on the list defined in hmailserver directly to get a copy of the mail which was send to the list? That's a bit anoying ;(

Regards
Björn

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-09-11 20:20

ratta-tat wrote:is there a way to prevent the sender on the list defined in hmailserver directly to get a copy of the mail which was send to the list?
No, this cannot be influenced by API.
ratta-tat wrote:to write the emailadress of the "config file" a little bit strange
You need to guarentee there is only one config file per list, it is as simple as that.

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-10-15 12:43

Currently, I am adding some features for myself. Is anyone missing something in this script? (Which can be realized easily?)

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-10-31 13:09

new provided version

CarlUman
New user
New user
Posts: 25
Joined: 2005-10-14 20:12

Re: Distribution list enhancement

Post by CarlUman » 2009-11-03 13:55

Just DLed this and plan to setup this week. I'll provide any feedback that I have. Thanks for your work!

CarlUman
New user
New user
Posts: 25
Joined: 2005-10-14 20:12

Re: Distribution list enhancement

Post by CarlUman » 2009-11-04 04:08

I'm getting this error in the log.
"11/3/2009 7:51:10 PM" " No oclient header in email. Internal Mail!"

I'm also getting this in the error log
"ERROR" 1436 "2009-11-03 18:29:58.523" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A000D - Description: Type mismatch: 'prepare_mailconfiguration' - Line: 47 Column: 1 - Code: (null)"

any ideas... Sorry, this is my first use of scripting in hmail.

I'm sure it it something simple.
Thanks

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-11-05 22:33

Are you sure it looks like :

Code: Select all

Sub OnAcceptMessage(oClient, oMessage)
	write_log ("-------------------------  OnAcceptMessage Event -----")
	Set obApp = CreateObject("hMailServer.Application")
	Call obApp.Authenticate(user, pw)
	prepare_mailconfiguration oClient, oMessage
End Sub

Sub OnDeliveryStart(oMessage)
	write_log ("-------------------------  OnDeliveryStart Event -----")
	Set obApp = CreateObject("hMailServer.Application")
	Call obApp.Authenticate(user, pw)
	write_log ("Mail FromAddress: " & oMessage.FromAddress)
	write_log ("Mail From: " & oMessage.From)
	write_log ("Mail To: " & oMessage.To)
	If mail_configuration_active then
		write_log ("  Starting mail configuration check")
		Result.Value = process_mailconfiguration (oMessage)
	End If
End Sub

CarlUman
New user
New user
Posts: 25
Joined: 2005-10-14 20:12

Re: Distribution list enhancement

Post by CarlUman » 2009-11-06 04:04

Yep. The line 47 is the last line of the OnAcceptMessage method. Based on the msg I would expect that for some reason the value of oMessage.HeaderValue("oclient") to be = "". I placed... write_log ("oClient " & oMessage.HeaderValue("oclient")) ...in the second to last line of the OnAcceptMessage the the value is empty. When I showed just the value of oClient it showed the email address of the sender.

Thanks for looking into this for me. I'm excited to get this to work.

EDIT:
I did do a compare of the code you pasted and the same section of the code I had in notepad++ and they are a match.

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-11-06 19:30

I think it should be an ups from my side, replace

Code: Select all

prepare_mailconfiguration oClient, oMessage
by

Code: Select all

add_client_info oClient, oMessage

CarlUman
New user
New user
Posts: 25
Joined: 2005-10-14 20:12

Re: Distribution list enhancement

Post by CarlUman » 2009-11-08 17:13

That is better.

I have a question about the use as it isn't working the way I expected yet.
when I send a mail to list@example.com (not my real domain of course) with subject of help I should get back an email explaining how to use the list right?

if I send an email to the same address with subject of subscribe it should add me to the list?

when I send an email the same address with any subject that isn't in the list of commands it should send an email the the list of subscibers right?

I would like to put my log here but there is lots of info in it I would rather not make public.
Thanks for your help

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-11-10 20:41

That is right and what is the questions? You need to active the email subscription of course.

CarlUman
New user
New user
Posts: 25
Joined: 2005-10-14 20:12

Re: Distribution list enhancement

Post by CarlUman » 2009-11-11 02:06

never mind. I didn't understand that I still had to create a distribution list.

Thanks for your help... now on to the next problem :)

CarlUman
New user
New user
Posts: 25
Joined: 2005-10-14 20:12

Re: Distribution list enhancement

Post by CarlUman » 2009-11-14 23:22

Is there a way to have the subscribe/unsubscribe emails be sent to anyone that subscribes rather than just those that come from the domains being hosted by the local hmail server?

Thanks

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2009-11-15 17:57

In version2 you can send all command mails to the admin, I am currently on version3 and will provide a setting to do this. This should be very simple.

UksusoFF
New user
New user
Posts: 1
Joined: 2010-01-13 12:36

Re: Distribution list enhancement

Post by UksusoFF » 2010-01-13 12:50

hello! can you help me config script?

Code: Select all

"13.01.2010 14:31:19"	"-------------------------  OnDeliveryStart Event -----"
"13.01.2010 14:31:19"	"Mail FromAddress: uksusoff@yandex.ru"
"13.01.2010 14:31:19"	"Mail From: хЛУХУПЧ лЙТЙММ <uksusoff@yandex.ru>"
"13.01.2010 14:31:19"	"Mail To: admin@samlit.net"
"13.01.2010 14:31:19"	"  Starting mail configuration check"
"13.01.2010 14:31:19"	"    Recipient: admin@s****.net"
"13.01.2010 14:31:19"	"       --> no config file found."
"13.01.2010 14:31:19"	"    No recipient configured"
where i must write path to example_config? where i must recipient configure?

sorry for my bad english =(

bbotzong
New user
New user
Posts: 10
Joined: 2010-01-10 18:53

Re: Distribution list enhancement

Post by bbotzong » 2010-03-13 22:21

andyp wrote:In version2 you can send all command mails to the admin, I am currently on version3 and will provide a setting to do this. This should be very simple.
Any idea when you'll post version 3?

bescher
Normal user
Normal user
Posts: 123
Joined: 2008-05-26 01:56
Location: Milwaukee Wi
Contact:

Re: Distribution list enhancement

Post by bescher » 2010-03-21 15:32

I must be going senile. But can someone post a snippet of the list_server script Txt showing exactly where
I must add the different domains and the names of the mailing lists?
I have tried and tried to understand it but lost it somewhere. I know that I need to modify the my_list_at_domain to signify the actual name of a particular mailing list and I need to point the files to where they will actually reside.

Thanks

Bob E

WebFXMaster
New user
New user
Posts: 4
Joined: 2010-10-17 01:34
Location: Amarillo, Texas
Contact:

Re: Distribution list enhancement

Post by WebFXMaster » 2010-10-17 01:44

Hey Andyp,

Are you still doing any support on your script? I just installed it today, but don't seem to be able to overcome an error in line 46 that says: ""ERROR" 3384 "2010-10-16 18:21:38.268" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A000D - Description: Type mismatch: 'prepare_mailconfiguration' - Line: 46 Column: 1 - Code: (null)"

Any help you can offer would be very much appreciated.

Thanks,
WebFXMaster

-------------------------
andyp wrote:hMailServer is one of the few mailservers for windows supporting distribution list. But compared to linux (majordomo or mailman) the features of the distribution list are very thin. As I have extensive use of the lists, I have written a script to extend the list features.
This script comes close to the feature request real list server.
The features are:
  • Define a password in the subject of the mail
  • Allow list members to post to the list
  • Allow general and list-specific addresses to post to the list
  • Define an action in case the sender is not allowed: delete or redirect to admin
  • Send a success/failure notification to the sender, whether the mail passes/doesn't pass
  • Modify headers (Sender, Reply-To, Return-Path) of the email
  • Change the MAIL FROM: in SMTP Session
  • Allow only certain extension for attachments
  • Restrict the size for all attachments and each attachment for itself
  • Define a prefix added to the subject
  • Add a header and footer to the mail (text and html)
  • Allow to (un)subscribe to the list via email (single address or list of addresses)
    Available command are help, list, (un)subscribe, (un)subscribeaddress, (un)subscribelist
  • Deny certain subscription commands
  • Apply standard setting to all list or accounts or only to certain/excluded addresses
  • Use other config files from one config file
  • Attach the list recipients at the footer
I had this script for a few months now in the developer section. So it should be ready for a version1.

Installation manual is in the zip.

Version2: Several added features like standard settings and references in the config files

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Distribution list enhancement

Post by Bill48105 » 2010-10-17 22:14

Hey WebFXMaster,
Scroll back, Andy explained it..
Bill

http://www.hmailserver.com/forum/viewto ... 952#p97952
andyp wrote:I think it should be an ups from my side, replace

Code: Select all

prepare_mailconfiguration oClient, oMessage
by

Code: Select all

add_client_info oClient, oMessage
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

WebFXMaster
New user
New user
Posts: 4
Joined: 2010-10-17 01:34
Location: Amarillo, Texas
Contact:

Re: Distribution list enhancement

Post by WebFXMaster » 2010-10-21 01:34

Bill48105 wrote:Hey WebFXMaster,
Scroll back, Andy explained it..
Bill

http://www.hmailserver.com/forum/viewto ... 952#p97952
andyp wrote:I think it should be an ups from my side, replace

Code: Select all

prepare_mailconfiguration oClient, oMessage
by

Code: Select all

add_client_info oClient, oMessage

Hi Bill,
Man, do I feel like a dummy now... Actually, I had logged back on today (with a little more time to read) to see if anyone else had mentioned this problem and, sure enough, there it was... Then, I got your message too. I tell my users & clients all the time that most of their questions could be easily answered if they'd just read a little... guess it's time for me to take a little of my own advice.

Thanks,
Dennis

Dank0ne
New user
New user
Posts: 1
Joined: 2010-11-10 17:49

Re: Distribution list enhancement

Post by Dank0ne » 2010-11-16 12:25

Hello. I got a problem with this script.

If I send an email from one address that is NOT allowed to send to my list, I don't get a reply "You aren't allowed to send".

I'm looking at the code, but I think the sub "write_notification" is never called :cry: :cry:

davidoster
New user
New user
Posts: 22
Joined: 2010-08-31 18:12

Re: Distribution list enhancement

Post by davidoster » 2010-11-25 11:12

Is this script working on latest ver. 5.3.3?

WebFXMaster
New user
New user
Posts: 4
Joined: 2010-10-17 01:34
Location: Amarillo, Texas
Contact:

Re: Distribution list enhancement

Post by WebFXMaster » 2010-11-25 18:04

davidoster wrote:Is this script working on latest ver. 5.3.3?
I am running version 5.3.3-B1879, and it works just fine on my installation... It IS a little tricky to set up because the documentation is not very clear, but it DOES work. I would be glad to help you get it set-up if you have specific questions or problems that you need to address.

WebFXMaster

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Distribution list enhancement

Post by Bill48105 » 2010-11-26 09:13

Yes it works but as noted it can be a bit of a pain to get installed & setup. I did some tweaking of the script & will likely post up my changes if andyp doesn't show up with update soon. One big one is a fix for the lock file issue for logging. I found out the hard way that at some point the lock file gets created & never removed so incoming email is hindered or stopped completely. I believe it happens if you restart or stop hmail at the wrong moment but not certain. It is a very very ugly thing to happen & caused me some major headaches. I am surprised no one else has run into it yet or I am just that unlucky. lol
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

WebFXMaster
New user
New user
Posts: 4
Joined: 2010-10-17 01:34
Location: Amarillo, Texas
Contact:

Re: Distribution list enhancement

Post by WebFXMaster » 2010-11-27 18:49

Bill48105 wrote:Yes it works but as noted it can be a bit of a pain to get installed & setup. I did some tweaking of the script & will likely post up my changes if andyp doesn't show up with update soon. One big one is a fix for the lock file issue for logging. I found out the hard way that at some point the lock file gets created & never removed so incoming email is hindered or stopped completely. I believe it happens if you restart or stop hmail at the wrong moment but not certain. It is a very very ugly thing to happen & caused me some major headaches. I am surprised no one else has run into it yet or I am just that unlucky. lol
Bill
I'd be interested in seeing that update, Bill. Although, to the best of my knowledge, I've not run into the 'lock file' problem (I keep my log files open, set in hmail), I'd not like to have to deal with it either. I am not much of a VB scripter, but I can follow the logic from my programming classes in college, I'd also not have to search it out if you've already fixed it.

WebFXMaster

Nemertes
New user
New user
Posts: 2
Joined: 2011-01-10 13:43

Re: Distribution list enhancement

Post by Nemertes » 2011-01-11 14:45

Hello (-:

If I turn the script on, my SMTP Connection's count grow (it seems that it don't close the connections), and all my emails get stuck in the delivery queue.

Anyone knows this problem?

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2011-09-03 17:44

No, could you post the log?

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2011-09-03 17:46

I will do a better documentation and provide a new version of the script in the next days. Sorry for not supporting some issues of the script, but I was a little busy in the last 2 years.

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: Distribution list enhancement

Post by arkypita » 2011-09-05 12:58

andyp wrote:I will do a better documentation and provide a new version of the script in the next days. Sorry for not supporting some issues of the script, but I was a little busy in the last 2 years.
Dear andyp
I am trying to do this with your script:

Use a standard configuration file with all the configuration flag set with great default.
Then use a specific list config file, like my_list_at_mydomain_com.txt with only the "overrides" of different configuration.

something like this:

Code: Select all

------------ my_list_at_mydomain_com.txt ----------------
# Use command tells the script to use another config file, so fullname or name (with same path) of the file can be entered here
use=D:\hMailData\mldefault\DEFAULT_PUBLIC.txt

# Subject prefix
# There are no " " placed between prefix and original subject
subjectprefix=[TestML] 
But i look at the script and i see that when a "use" macro is called, all the setting comes from this file. I have try to make some change to the script by myself, but without success (i go in a read configuration loop).

Do you think it is possible to do that? Any suggestion?

andyp
Normal user
Normal user
Posts: 191
Joined: 2008-01-18 21:00

Re: Distribution list enhancement

Post by andyp » 2011-09-05 17:30

Possible is everything, but are you sure you what to do it? You might get mixed up, where the configuration is coming from.

DaveKimble
New user
New user
Posts: 16
Joined: 2011-03-13 04:25

Re: Distribution list enhancement

Post by DaveKimble » 2012-02-06 04:50

I just want to do the "add prefix to subject line" for my one list.
I definitely don't want to allow the subscription etc commands.
I looked at the script to see about cutting it down, but it is way beyond my capabilities.
Could some kind genius extract just the bits I need ?

Is there a list item sequence number already handily lying around so that the prefix could be : "[mylist-nnn]" uniquely identifying the post ? Doesn't matter if it isn't.

v5.3.3-B1879 with no scripts at the moment

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-03-29 23:09

Salvete! I just installed hmailServer and this mailing list script. When I send an email with the subject line "help", I don't get any return message. Nor do I receive a confirmation that the mailing was successful. However, I do receive a copy of my message because I am on the distribution list. In short, it doesn't seem like the script is doing anything. But I can see the script *is* logging, however.

"3/29/2012 4:04:28 PM" "------------------------- OnAcceptMessage Event -----"
"3/29/2012 4:04:28 PM" "------------------------- OnDeliveryStart Event -----"
"3/29/2012 4:04:28 PM" "Mail FromAddress: brgabriel@test.local"
"3/29/2012 4:04:28 PM" "Mail From: Brother Gabriel-Marie <brgabriel@test.local>"
"3/29/2012 4:04:28 PM" "Mail To: list@test.local"
"3/29/2012 4:04:28 PM" " Starting mail configuration check"
"3/29/2012 4:04:28 PM" " Recipient: list@test.local"

So I have my list@test.local.txt file inside of c:\hmailserver\config, and have made the setting in the EventHandlers.vbs script like the directions say. In the config folder, I put the header.txt, footer.txt and the other txt files too.

What am I missing?

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-03-30 00:03

I am getting this error:

"ERROR" 3388 "2012-03-29 16:58:24.183" "Script Error: Source: hMailServer COM library - Error: 800403E9 - Description: You do not have access to this property / method. Ensure that hMailServer.Application.Authenticate() is called with proper login credentials. - Line: 1633 Column: 1 - Code: (null)"

I am trying to send mail to the list from a user who is a subscriber, but is not in the allowaddresses list. I have allowmembers set to false. Now I know from the log file that my config is being loaded.

Also, here is the hmailserver_event log entry for the sent message:

"3/29/2012 4:50:02 PM" "------------------------- OnAcceptMessage Event -----"
"3/29/2012 4:50:02 PM" "------------------------- OnDeliveryStart Event -----"
"3/29/2012 4:50:02 PM" "Mail FromAddress: someone@test.local"
"3/29/2012 4:50:02 PM" "Mail From: someone<someone@test.local>"
"3/29/2012 4:50:02 PM" "Mail To: list@test.local"
"3/29/2012 4:50:02 PM" " Starting mail configuration check"
"3/29/2012 4:50:02 PM" " Recipient: list@test.local"
"3/29/2012 4:50:02 PM" " Reading config file: C:\hmailserver\config\test.local\list_at_test_local.txt"
"3/29/2012 4:50:02 PM" " admin=brgabriel@test.local"
"3/29/2012 4:50:02 PM" " operator=or"
"3/29/2012 4:50:02 PM" " todo=delete"
"3/29/2012 4:50:02 PM" " pw_enclosure=#"
"3/29/2012 4:50:02 PM" " allowmembers=false"
"3/29/2012 4:50:02 PM" " allowaddresses=bob@test.local#brgabriel@test.local"
"3/29/2012 4:50:02 PM" " addsenderheader=list"
"3/29/2012 4:50:02 PM" " addreturnpathheader=list"
"3/29/2012 4:50:02 PM" " smtpmailfrom=list"
"3/29/2012 4:50:02 PM" " allowed_attachments=zip#txt#bmp"
"3/29/2012 4:50:02 PM" " subjectprefix=%address%: "
"3/29/2012 4:50:02 PM" " failure_notification=true"
"3/29/2012 4:50:02 PM" " failure_notification_subject=Delivery Failure, Bozo"
"3/29/2012 4:50:02 PM" " failure_notification_file=failure_notification.txt"
"3/29/2012 4:50:02 PM" " success_notification=false"
"3/29/2012 4:50:02 PM" " success_notification_subject=Successful delivery"
"3/29/2012 4:50:02 PM" " success_notification_file=success_notification.txt"
"3/29/2012 4:50:02 PM" " header_file=header.txt"
"3/29/2012 4:50:02 PM" " footer_file=footer.txt"
"3/29/2012 4:50:02 PM" " header_file_html=header_html.txt"
"3/29/2012 4:50:02 PM" " footer_file_html=footer_html.txt"
"3/29/2012 4:50:02 PM" " attach_recipients_to_footer=true"
"3/29/2012 4:50:02 PM" " attach_recipients_delimiter=; "
"3/29/2012 4:50:02 PM" " attach_recipients_html=<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>%recipients%</span></font></p>"
"3/29/2012 4:50:02 PM" " email_subscription=true"
"3/29/2012 4:50:02 PM" " email_subscription_admin_notification=true"
"3/29/2012 4:50:02 PM" " email_subscription_allowed_cmds=help#list#subscribe#subscribeaddress#subscribelist#unsubscribe#unsubscribeaddress#unsubscribelist"
"3/29/2012 4:50:02 PM" " email_subscription_success_notification=true"
"3/29/2012 4:50:02 PM" " email_subscription_failure_notification=true"
"3/29/2012 4:50:02 PM" " Subscription via email activated."

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Distribution list enhancement

Post by ^DooM^ » 2012-03-30 00:05

Did you edit the script to add your admin password?
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-03-30 00:17

Yes.

The mail goes through anyway with the user who shouldn't be able to post.

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-03-30 00:32

Hey! Okay, I noticed that the username I put in the script did not have the domain on it. I updated that, and now the help command works! Also, the last message I sent from the not-allowed user account, sent (like it ought to) but was not delivered to the mailing list.

Now it works! I think I had to "reload scripts" in hm, too.

This is great!

When I send a list command to the list, the command is run, the client receives the message (help or list, or whatever), but the message they send to the list is posted. Is there a way to disable that? That is, if they send a list command, I think it ought only run the command and not post the message too.

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-06-29 23:58

Salvete! Where can I find the file that stores the addresses in the lists created by the listserver script? I want to programmatically update the list.

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-06-30 04:23

Has anybody written anything to add this listserver functionality into PHPWebAdmin? I would absolutely love being able to allow certain other folks to administer mailing lists (listserver style) through the web interface!

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-06-30 17:58

Dank0ne wrote:Hello. I got a problem with this script.

If I send an email from one address that is NOT allowed to send to my list, I don't get a reply "You aren't allowed to send".

I'm looking at the code, but I think the sub "write_notification" is never called :cry: :cry:

I find that this is also the case! I have the most recent version I could find, v5.2 of the listserver script, with hMailServer-5.4-B1942

Has anyone solved this problem in their script?

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-07-01 03:19

Well, I think nobody is listening (or replying to *me* at least)! Anyway, I think I figured out what it takes to get the notification emails to work. If I update these scripts, does anybody think AndyP will mind? Is that allowed, anyway?

User avatar
mattg
Moderator
Moderator
Posts: 20468
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Distribution list enhancement

Post by mattg » 2012-07-01 14:49

AndyP sometimes checks this thread

Please post your updated scripts at the end of this thread, or better still start a new thread and link back to this one. (and Visa versa so that AndyP may get a notification of it)
In my mind, Scripts that are listed here are for sharing / improving
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-07-01 18:39

Thank you, Moderator, for replying - I was beginning to think I was all alone. I did PM AndyP and am waiting for him to answer.

I think I got all the calls to write_notification into the right places, and fixed a script-typo that would have caused it not to work anyway.

Am I correct to think, that if I want to prevent the sender who is a member (and allowed to post) from recieving a copy of the mail, that there is no RemoveRecipient() function (even though there is an AddRecipient() function) - and the only way to do that is to remove all the addresses and then add them back one by one whilst filtering out the one you don't want?

I read through the forum threads concerning this script, and someone else wanted to do the same thing but was told it was not possible.

User avatar
mattg
Moderator
Moderator
Posts: 20468
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Distribution list enhancement

Post by mattg » 2012-07-02 04:28

brother.gabriel wrote:Am I correct to think, that if I want to prevent the sender who is a member (and allowed to post) from recieving a copy of the mail, that there is no RemoveRecipient() function (even though there is an AddRecipient() function) - and the only way to do that is to remove all the addresses and then add them back one by one whilst filtering out the one you don't want?
That's the way that I approach the same situation
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-07-02 22:00

Thank you, Moderator. Would you by chance have a script routine I can look at? It would save me hours of work!

User avatar
mattg
Moderator
Moderator
Posts: 20468
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Distribution list enhancement

Post by mattg » 2012-07-03 01:36

Check this thread - there are some changes through it - so read it all, but I do remove certain recipients with that script

Matt
(ps please call me Matt or even mattg)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-07-03 02:10

Matt - thanks a bushel! And even more for being personable. All too often I find folks in the forums to be cold - they forget that we are all real people here, with real problems, and making real efforts.

Anyway, I think you forgot the hyperlink if you intended to add one...

User avatar
mattg
Moderator
Moderator
Posts: 20468
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Distribution list enhancement

Post by mattg » 2012-07-03 07:21

Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-07-04 00:31

Thank you!

PeterWeb
Normal user
Normal user
Posts: 31
Joined: 2006-11-29 02:04

Re: Distribution list enhancement

Post by PeterWeb » 2012-08-24 04:08

I have done some work on AndyP's v2 script as follows. It is attached below, in case it helps anyone get a faster start than I managed:

1. Applied the necessary patch mentioned in one of the early posts above.

2. Amended the script logic so that it will support incoming emails from an external POP fetch, because for some reason hMailserver doesn't seem to be firing OnAcceptMessage in such cases.

3. Defined msg_from and msg_fromname globals which otherwise are left blank, which was odd. They could perhaps be programmatically set to the actual list address; I may do that later.

4. added option explicit at the top so that typos lead to syntax errors rather than empty variables. As a result, I added a lot of Dim statement so that every variable was explicitly declared. However, you may want to remove the option explicit as I have not yet tested that every single function has the Dims it needs - just most of them.

5. Changed at least one line that was leading to an array boundary error

6. Amended the subscribeaddress and unsibscribeaddresslogic to allow for some mail senders which put an extra blank line at the top of the mail, meaning the parameter was being missed.

7. Improved the help text (as I see it) and some other minor text

The important lines I changed are flagged in the source with ' PeterWeb comments.

Known issues (probably all original, as I haven't made deep changes):

A. I found that it does not handle empty header.txt/header.html etc. files well. If they are present, those files need at least a newline in them.

B. I assume this issue is original, but like #2 above, it may only related to my specific (external-POP-fetching) configuration: when I send a command like Subscribe or whatever, as well as the successful result email, I get back a "Delivery failed: message generated by hMailServer (not the script), saying that it failed to deliver to <name of external pop account>. I don't know why that's happening yet, but will try and resolve it later.

C. I've done nothing about the write_notification issue mentioned by others in their posts - if someone wants to describe the issue and/or a general (or specific) fix, I can tackle it when I am next on deck in just over a week.

I am not yet using this script live - I found too many issues in getting it this far. But I plan to continue testing and posting new versions if I can fairly quickly get it robustly handling the kinds of uses I have for it. We'll see...

Fwiw, my environment is 5.4-B1942 on Win2008 Web R2.

NB: My download is "latest script only" - get Andy's for documentation and sample configs etc.
Attachments
listserver_v2_PeterWeb.zip
AndyP's v2 with mods from PeterWeb.
(11.77 KiB) Downloaded 417 times

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

ListServer Script Version 2.2

Post by brother.gabriel » 2012-09-12 06:38

Salvete!
I, too, have been working on this script. I took Peter's updated version and added a few things.

Amoung those things is a better documentation page (which also comes in the script package):
http://www.sspxusa.org/goodies/hmailser ... manual.htm

Here is the download link for the listserver package:
http://www.sspxusa.org/goodies/hMailSer ... server.zip

I will keep working on this (as I have a vested interest), and if anyone has anything to add or change, I would be happy to marshall the project.
Last edited by ^DooM^ on 2012-09-12 17:17, edited 1 time in total.
Reason: Updated Links

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-09-12 18:59

Updated the documentation again.

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2012-09-15 08:22

Upadated the script again to version 2.3. Fixed a few little bugs.
See the documentation file at http://www.sspxusa.org/goodies/hmailser ... manual.htm for details.
Also added a udl file for viewing ListServer config files in Notepad++

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2013-03-04 03:30

Updated the ListServer Script to version 2.4.
Tested with hMailServer 5.4-B1942.

Made extensive improvements to the documentation.
This is probably the best improvement. There are even configuration examples.

You can see the changes to the script in the history.

This is the last version of the script that will attempt to make any backward compatibility with hMailServer version 4. In fact, although I left the backward compatibility in the script, I don't have a way to test it. It might still work, but I don't think I did anything to break that.

I am running this on my own server. If anyone has issues, please let me know.

-BGM

User avatar
Caspar
Senior user
Senior user
Posts: 377
Joined: 2008-09-08 11:47
Contact:

Re: Distribution list enhancement

Post by Caspar » 2013-03-04 10:25

Since I can edit the hmailserver documentation, could you send me the changes you have done so I can merge them with the current documentation? This is no promise that it will be added, but ill look into the changes that have been done.
If you have strange problems or errors use the log analyzer! http://log.damnation.org.uk
Join us on IRC! http://hmailserver.com/irc_fullscreen.php

User avatar
brother.gabriel
Normal user
Normal user
Posts: 139
Joined: 2012-03-29 17:25
Location: Kansas City
Contact:

Re: Distribution list enhancement

Post by brother.gabriel » 2013-03-04 15:44

Caspar, in the beginning I annotated everywhere in the script where I made a change, but in the last round, I made so many that I gave up on that. If you want a line-by-line, you'll have to use a file-comparitor such as WinMerge.

If your intention is to check with the backward compatibility of the script with hMailServer 4, I think I did, indeed break it.

Also, I'm not sure what you mean by referencing "hMailServer documentation" - I've made no changes to hMailServer at all - just to the ListServer script. My documentation is all there. I'd be interested to know what you think. The links are in my previous post.

Post Reply