Distribution list enhancement
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
P.S., y'all, if anyone has downloaded my package before March 4, I had left a call to a "CopyMessageToSharepointDropFolder(oMessage)" function in the OnDeliverMessage sub. But I remembered this just this morning and removed it, as it doesn't belong to the ListServer script.
I've updated the package to reflect this, but didn't change the version number.
I've updated the package to reflect this, but didn't change the version number.
Re: Distribution list enhancement
I meant for the documentation here:brother.gabriel wrote: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.
http://www.hmailserver.com/documentatio ... e=overview
if you have some specific changes you can remember, I could have some use of it to make updating the documentation there more easy.
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
Join us on IRC! http://hmailserver.com/irc_fullscreen.php
-
- New user
- Posts: 12
- Joined: 2013-02-06 13:09
Re: Distribution list enhancement
I cannot download the latest script package - getting 404 error.
Can someone post a valid link to it?
Can someone post a valid link to it?
Re: Distribution list enhancement
You mean the attachments on 1st post?simonjshaw wrote:I cannot download the latest script package - getting 404 error.
Can someone post a valid link to it?
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. ***
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
-
- New user
- Posts: 12
- Joined: 2013-02-06 13:09
Re: Distribution list enhancement
Okay I'm being stupid I expect. Something to do with age - please be patient.
I see attachments on the first post and can download them.
But I saw that first Peter and then Br Gabriel updated the script, and was trying to download the latter from his site.
that was what I wanted - latest script.
Anyway I used Peter's.
I cannot find much documentation which tells me step by step how to set up this list server, so I'm making lots of assumptions, maybe false ones:
I created a user listserv@mydomain
I created a distribution list mylist@mydomain
I got the paths sorted out and created config file called listserv_at_mydomain.txt
It won't process a subscription from me send to listserv@mydomain
I get (I've replaced real values with listname and mydomain below):
"12/04/2013 15:00:53" "Subject: subscribe listname"
"12/04/2013 15:00:53" " Starting mail configuration check"
"12/04/2013 15:00:53" " Recipient: listserv@mydomain"
"12/04/2013 15:00:53" " Reading config file: c:\ListServData\listname_at_mydomain.txt"
"12/04/2013 15:00:53" " admin=simon@mydomain"
"12/04/2013 15:00:53" " operator=or"
"12/04/2013 15:00:53" " todo=delete"
"12/04/2013 15:00:53" " pw_enclosure=#"
"12/04/2013 15:00:53" " allowmembers=true"
"12/04/2013 15:00:53" " addsenderheader=list"
"12/04/2013 15:00:53" " addreplytoheader=list"
"12/04/2013 15:00:53" " smtpmailfrom=list"
"12/04/2013 15:00:53" " subjectprefix=%address%: "
"12/04/2013 15:00:53" " failure_notification=true"
"12/04/2013 15:00:53" " failure_notification_subject=Delivery Failure"
"12/04/2013 15:00:53" " failure_notification_file=failure_notification.txt"
"12/04/2013 15:00:53" " success_notification=false"
"12/04/2013 15:00:53" " success_notification_subject=Successful delivery"
"12/04/2013 15:00:53" " success_notification_file=success_notification.txt"
"12/04/2013 15:00:53" " header_file=header.txt"
"12/04/2013 15:00:53" " footer_file=footer.txt"
"12/04/2013 15:00:53" " header_file_html=header_html.txt"
"12/04/2013 15:00:53" " footer_file_html=footer_html.txt"
"12/04/2013 15:00:53" " attach_recipients_to_footer=true"
"12/04/2013 15:00:53" " attach_recipients_delimiter=; "
"12/04/2013 15:00:53" " attach_recipients_html=<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>%recipients%</span></font></p>"
"12/04/2013 15:00:53" " email_subscription=true"
"12/04/2013 15:00:53" " email_subscription_admin_notification=true"
"12/04/2013 15:00:53" " email_subscription_allowed_cmds=help#list#subscribe#subscribeaddress#subscribelist#unsubscribe#unsubscribeaddress#unsubscribelist"
"12/04/2013 15:00:53" " email_subscription_success_notification=true"
"12/04/2013 15:00:53" " email_subscription_failure_notification=true"
"12/04/2013 15:00:53" " Subscription via email activated."
"12/04/2013 15:00:53" " This is not a distribution list!"
"12/04/2013 15:00:53" " Checking recipient: listserv@mydomain"
"12/04/2013 15:00:53" " Member of the distribution list"
"12/04/2013 15:00:53" " Checking conditions: No PW defined"
"12/04/2013 15:00:53" " -> result = false : recipient will be deleted"
"12/04/2013 15:00:53" " --> Recipient will be deleted."
"12/04/2013 15:00:53" " Changing recipients"
"12/04/2013 15:00:53" " Recipient listserv@mydomain has been deleted"
Any help appreciated.
I see attachments on the first post and can download them.
But I saw that first Peter and then Br Gabriel updated the script, and was trying to download the latter from his site.
that was what I wanted - latest script.
Anyway I used Peter's.
I cannot find much documentation which tells me step by step how to set up this list server, so I'm making lots of assumptions, maybe false ones:
I created a user listserv@mydomain
I created a distribution list mylist@mydomain
I got the paths sorted out and created config file called listserv_at_mydomain.txt
It won't process a subscription from me send to listserv@mydomain
I get (I've replaced real values with listname and mydomain below):
"12/04/2013 15:00:53" "Subject: subscribe listname"
"12/04/2013 15:00:53" " Starting mail configuration check"
"12/04/2013 15:00:53" " Recipient: listserv@mydomain"
"12/04/2013 15:00:53" " Reading config file: c:\ListServData\listname_at_mydomain.txt"
"12/04/2013 15:00:53" " admin=simon@mydomain"
"12/04/2013 15:00:53" " operator=or"
"12/04/2013 15:00:53" " todo=delete"
"12/04/2013 15:00:53" " pw_enclosure=#"
"12/04/2013 15:00:53" " allowmembers=true"
"12/04/2013 15:00:53" " addsenderheader=list"
"12/04/2013 15:00:53" " addreplytoheader=list"
"12/04/2013 15:00:53" " smtpmailfrom=list"
"12/04/2013 15:00:53" " subjectprefix=%address%: "
"12/04/2013 15:00:53" " failure_notification=true"
"12/04/2013 15:00:53" " failure_notification_subject=Delivery Failure"
"12/04/2013 15:00:53" " failure_notification_file=failure_notification.txt"
"12/04/2013 15:00:53" " success_notification=false"
"12/04/2013 15:00:53" " success_notification_subject=Successful delivery"
"12/04/2013 15:00:53" " success_notification_file=success_notification.txt"
"12/04/2013 15:00:53" " header_file=header.txt"
"12/04/2013 15:00:53" " footer_file=footer.txt"
"12/04/2013 15:00:53" " header_file_html=header_html.txt"
"12/04/2013 15:00:53" " footer_file_html=footer_html.txt"
"12/04/2013 15:00:53" " attach_recipients_to_footer=true"
"12/04/2013 15:00:53" " attach_recipients_delimiter=; "
"12/04/2013 15:00:53" " attach_recipients_html=<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>%recipients%</span></font></p>"
"12/04/2013 15:00:53" " email_subscription=true"
"12/04/2013 15:00:53" " email_subscription_admin_notification=true"
"12/04/2013 15:00:53" " email_subscription_allowed_cmds=help#list#subscribe#subscribeaddress#subscribelist#unsubscribe#unsubscribeaddress#unsubscribelist"
"12/04/2013 15:00:53" " email_subscription_success_notification=true"
"12/04/2013 15:00:53" " email_subscription_failure_notification=true"
"12/04/2013 15:00:53" " Subscription via email activated."
"12/04/2013 15:00:53" " This is not a distribution list!"
"12/04/2013 15:00:53" " Checking recipient: listserv@mydomain"
"12/04/2013 15:00:53" " Member of the distribution list"
"12/04/2013 15:00:53" " Checking conditions: No PW defined"
"12/04/2013 15:00:53" " -> result = false : recipient will be deleted"
"12/04/2013 15:00:53" " --> Recipient will be deleted."
"12/04/2013 15:00:53" " Changing recipients"
"12/04/2013 15:00:53" " Recipient listserv@mydomain has been deleted"
Any help appreciated.
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Hello.
I made some documentation here:
http://www.sspxusa.org/goodies/hMailSer ... manual.htm
But here is the download link:
http://www.sspxusa.org/goodies/hMailSer ... Server.zip
I don't make any guarantees, but I am using this in production.
I made some documentation here:
http://www.sspxusa.org/goodies/hMailSer ... manual.htm
But here is the download link:
http://www.sspxusa.org/goodies/hMailSer ... Server.zip
I don't make any guarantees, but I am using this in production.
-
- New user
- Posts: 12
- Joined: 2013-02-06 13:09
Re: Distribution list enhancement
Hi Br Gabriel
I'm afraid that link gives me a server-specific 404 not found error
I'm afraid that link gives me a server-specific 404 not found error
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
I'm sorry; I had misnamed the file; try it again.
I assume the documentation link works, however.
I assume the documentation link works, however.
-
- New user
- Posts: 12
- Joined: 2013-02-06 13:09
Re: Distribution list enhancement
Got it downloaded, thank you. I assume no-one else has used the published link, so I might be on my own with this version.
Still not very sure how to use it - I'm afraid I don't find the documentation very clear on setting up fist list.
Since it doesn't mention it, am I to understand I don't need to have a listserv@domain user? Do I send subscribe commands to the list itself?
And I'm getting some VBS errors. Variables not defined:
"ERROR" 1316 "2013-04-12 17:04:06.562" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01F4 - Description: Variable is undefined: 'configfileextension' - Line: 751 Column: 2 - Code: (null)"
I put a public constant in for that, value ".hms", then I got...
"ERROR" 1316 "2013-04-12 17:08:50.827" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01F4 - Description: Variable is undefined: 'serveradmin' - Line: 911 Column: 18 - Code: (null)"
So I'm thinking perhaps I'll just give up on this.
Still not very sure how to use it - I'm afraid I don't find the documentation very clear on setting up fist list.
Since it doesn't mention it, am I to understand I don't need to have a listserv@domain user? Do I send subscribe commands to the list itself?
And I'm getting some VBS errors. Variables not defined:
"ERROR" 1316 "2013-04-12 17:04:06.562" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01F4 - Description: Variable is undefined: 'configfileextension' - Line: 751 Column: 2 - Code: (null)"
I put a public constant in for that, value ".hms", then I got...
"ERROR" 1316 "2013-04-12 17:08:50.827" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A01F4 - Description: Variable is undefined: 'serveradmin' - Line: 911 Column: 18 - Code: (null)"
So I'm thinking perhaps I'll just give up on this.
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Did you read through this page:
http://www.sspxusa.org/goodies/hMailSer ... ist_9.html
Point Number 5 says,
5.Set the name of your list-level settings file. Remember the name of the distribution list you created? Go into the config\bobsdomain.com directory, find the file called mylist_at_mydomain_com.hms and rename it. Now, you have to get this right, or it won't work. (There are some directions for this.) So now you should have renamed the sample file to bobslist_at_bobsdomain_com.hms.
In this version, I changed all the extensions from .txt to .hms in order to facilitate automatic syntax colouration in notepad++. But if your global settings are set to .txt, then you won't have to change the file extension.
If you want to get this working for you, you will have to either read all of the documentation and understand what is happening, or you can download the original script and try to figure it out the way I did.
What you can't do: plop the script into hMailServer and expect it to "just work".
Sorry, it's too complicated for that.
You have to do a certain amount of configuration. That's why I made the documentation.
If you are already willing to give up, I say that is probably a good idea.
http://www.sspxusa.org/goodies/hMailSer ... ist_9.html
Point Number 5 says,
5.Set the name of your list-level settings file. Remember the name of the distribution list you created? Go into the config\bobsdomain.com directory, find the file called mylist_at_mydomain_com.hms and rename it. Now, you have to get this right, or it won't work. (There are some directions for this.) So now you should have renamed the sample file to bobslist_at_bobsdomain_com.hms.
In this version, I changed all the extensions from .txt to .hms in order to facilitate automatic syntax colouration in notepad++. But if your global settings are set to .txt, then you won't have to change the file extension.
If you want to get this working for you, you will have to either read all of the documentation and understand what is happening, or you can download the original script and try to figure it out the way I did.
What you can't do: plop the script into hMailServer and expect it to "just work".
Sorry, it's too complicated for that.
You have to do a certain amount of configuration. That's why I made the documentation.
If you are already willing to give up, I say that is probably a good idea.
Re: Distribution list enhancement
+1brother.gabriel wrote:If you are already willing to give up, I say that is probably a good idea.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
-
- New user
- Posts: 12
- Joined: 2013-02-06 13:09
Re: Distribution list enhancement
Okay, I probably shouldn't give up yet, I'd just had a long and frustrating Friday, but I think it's slightly unfair to say "read the manual", when in fact I have done that, I have implemented what I've read, but am still experiencing an error due to an undeclared/unassigned variable - not because my settings haven't been configured.
I'd like to get it working, and would appreciate some specific help, if you have the time.
Specifically, where should the variable "serveradmin" be declared, and where should it's value be set?
I cannot see a declaration. "Option explicit" is set, which will then cause the error.
Would you mind having a look at this point for me and tell me where I'm going wrong?
I could just declare and assign it at the top of the script like I did for the config file suffix issue.
By the way, I only have a list-level settings file. It is correctly named and is being picked up.
I have an empty (apart from a "this is a sample" comment) global config.hms as per the downloded package.
If you haven't time to help then I do understand.
I'd like to get it working, and would appreciate some specific help, if you have the time.
Specifically, where should the variable "serveradmin" be declared, and where should it's value be set?
I cannot see a declaration. "Option explicit" is set, which will then cause the error.
Would you mind having a look at this point for me and tell me where I'm going wrong?
I could just declare and assign it at the top of the script like I did for the config file suffix issue.
By the way, I only have a list-level settings file. It is correctly named and is being picked up.
I have an empty (apart from a "this is a sample" comment) global config.hms as per the downloded package.
If you haven't time to help then I do understand.
-
- New user
- Posts: 12
- Joined: 2013-02-06 13:09
Re: Distribution list enhancement
I got it working! I added these two lines to the script:
Public Const configfileextension = ".hms"
Public Const serveradmin = "me@mydomain"
If this addition is needed in the standard script I hope this has helped.
If not, then I would appreciate knowing how I should have solved this issue?
Thanks to all those who worked on this.
Public Const configfileextension = ".hms"
Public Const serveradmin = "me@mydomain"
If this addition is needed in the standard script I hope this has helped.
If not, then I would appreciate knowing how I should have solved this issue?
Thanks to all those who worked on this.
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Simon, if you were missing those two variables, it was my fault.
I'm glad you didn't give up - you got me on that one. I was using my production server as a dev server and copying out the settings for the distribution, and I guess I missed copying over those two constants.
I took a look through the script and didn't find anything else missing.
So I've updated the script.
Noone else has ever said anything, so I suppose you are the only person to download the new script.
Thanks for finding it! Sorry for the trouble.
Now, I do have another unpublished update. But I have a "changes" section in the documentation that will say what was done and what needs to be done to a currently running setup in order to use the newer version. I'll post back here once I get it together.
I'm glad you didn't give up - you got me on that one. I was using my production server as a dev server and copying out the settings for the distribution, and I guess I missed copying over those two constants.
I took a look through the script and didn't find anything else missing.
So I've updated the script.
Noone else has ever said anything, so I suppose you are the only person to download the new script.
Thanks for finding it! Sorry for the trouble.
Now, I do have another unpublished update. But I have a "changes" section in the documentation that will say what was done and what needs to be done to a currently running setup in order to use the newer version. I'll post back here once I get it together.
Re: Distribution list enhancement
Hi Gabriel,
thank you for your work on the listserver, I think you have done a great on it.
I installed it yesterday and its running.
But I noticed one issue whith html messages.
The html footer is not appended at the end of the message, but is inserted in message near by the beginning.
There are not a lot messages since I installed it yesterday, but this can be seen on all html messages there are so far, which were all sent by the same user.
Here is an example message received from the listserver:
Here is the config file for the list:
thank you for your work on the listserver, I think you have done a great on it.
I installed it yesterday and its running.
But I noticed one issue whith html messages.
The html footer is not appended at the end of the message, but is inserted in message near by the beginning.
There are not a lot messages since I installed it yesterday, but this can be seen on all html messages there are so far, which were all sent by the same user.
Here is an example message received from the listserver:
Code: Select all
Return-Path: Admin@mydomain.com
Delivered-To: list@mydomain.com
Received: from mail-vb0-f43.google.com ([209.85.212.43]) by mail.mydomain.com ; Sun,
5 May 2013 11:58:12 +0200
Received: by mail-vb0-f43.google.com with SMTP id p14so2355681vbm.30 for
<list@mydomain.com>; Sun, 05 May 2013 02:58:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113;
h=mime-version:x-received:date:message-id:subject:from:to :content-type;
bh=yhxVNVA1XpUYJHu1WFhDhYB5qhcRv0EGBvjp94nXFP8=;
b=VTOowb//pbpEJ9HqZnfZeJDIZ6ESaGSTtPswjf3sFdZlf29IYCKScPmTYyoIl3T27w
4lgpfqj9P27lU9ZnL/ovd5O26wDlK7AVa2TQfUV5Ml1Ao/SadbzBnxmqoL4XSjnFMk1i
C58029duOQQnvDLvc/9D25zVHyyIZVTmZvIiX4V582tYeO4w7hAFCHZ+kBckis/AUbWV
xHxaOKM5zeoQlGvxpxM7Ggzgq6j1pRXVzYqGEckQO6JVxIBTBo2ADxXIzvjIA2IgJ5VX
pEOkJ+xgZyf80V5dwD+huIMJphVAJadLBXG85eT1U/BtWrkAsIogdOidEMEJjAnMgTT/
1ZVQ==
MIME-Version: 1.0
X-Received: by 10.52.232.165 with SMTP id tp5mr3964611vdc.120.1367747890119; Sun, 05 May
2013 02:58:10 -0700 (PDT)
Received: by 10.58.178.175 with HTTP; Sun, 5 May 2013 02:58:10 -0700 (PDT)
Date: Sun, 5 May 2013 11:58:10 +0200
Message-ID: <CAFcYn_F+qfVEeCFNg-RDYLFiFue7urY12RYodkU5Uk0zoiOM5g@mail.gmail.com>
Subject: Blah Blah
From: User <user@googlemail.com>
To: list@mydomain.com
Content-Type: multipart/alternative; boundary=089e0122f4802209dc04dbf59f17
oclient:
Sender: list@mydomain.com
Reply-To: list@mydomain.com
Return-Path: Admin@mydomain.com
--089e0122f4802209dc04dbf59f17
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Blah Blah Blah
Blah Blah Blah
--=20
Mail was sent via list@mydomain.com.
--089e0122f4802209dc04dbf59f17
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div><div>Blah Blah Blah<br><br><p>Mail was sent via list@mydomain.com.</p>
</div>Blah Blah Blah<br>
</div>Blah Blah Blah<br><br>Blah Blah Blah<br><br></div>Blah Blah Blah</div>
--089e0122f4802209dc04dbf59f17--
Code: Select all
admin=Admin@mydomain.com
operator=or
todo=redirect
pw_enclosure=#
pw=
allowmembers=true
allowaddresses=
addsenderheader=list
addreplytoheader=list
addreturnpathheader=%admin%
smtpmailfrom=%serveradmin%
allowed_attachments=
disallowed_attachments=
allowed_attachment_size=
allowed_attachments_total_size=
subjectprefix=
failure_notification=true
failure_notification_subject=Delivery failed
failure_notification_file=failure_notification.txt
success_notification=false
success_notification_subject=Successful delivery
success_notification_file=success_notification.txt
header_file=
footer_file=footer.txt
header_file_html=
footer_file_html=footer.html
attach_recipients_to_footer=false
attach_recipients_delimiter=;
attach_recipients_html=<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>%recipients%</span></font></p>
email_subscription=true
email_subscription_admin_notification=true
email_subscription_allowed_cmds=
help
subscribe
unsubscribe
list
#subscribeaddress
#unsubscribeaddress
#subscribelist
#unsubscribelist
email_subscription_success_notification=true
email_subscription_failure_notification=true
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Hi, Mr. Toast,
Hmmm...
Now that I look at it, I think my messages have the same problem.
I'll have to look at that.
If anyone has a clue, I'm all ears.
Hmmm...
Now that I look at it, I think my messages have the same problem.
I'll have to look at that.
If anyone has a clue, I'm all ears.
Re: Distribution list enhancement
I also have another problem, which is much more annoying:
The lock file often is not deleted and then messages in the queue are not processed.
My error log is full of these:
"ERROR" 5424 "2013-05-05 20:10:32.093" "Script Error: Source: runtime error in Microsoft VBScript - Error: 800A0005 - Description: Invalid procedure call or argument - Line: 1698 Column: 3 - Code: (null)"
"ERROR" 4984 "2013-05-05 17:42:15.406" "Severity: 3 (Medium), Code: HM4226, Source: SMTPDeliverer::_DeliverToExternalAccounts, Description: Could not deliver message; Recipient address missing."
I don't know if these are related to each other.
For the first one, I marked line 1698:
The lock file often is not deleted and then messages in the queue are not processed.
My error log is full of these:
"ERROR" 5424 "2013-05-05 20:10:32.093" "Script Error: Source: runtime error in Microsoft VBScript - Error: 800A0005 - Description: Invalid procedure call or argument - Line: 1698 Column: 3 - Code: (null)"
"ERROR" 4984 "2013-05-05 17:42:15.406" "Severity: 3 (Medium), Code: HM4226, Source: SMTPDeliverer::_DeliverToExternalAccounts, Description: Could not deliver message; Recipient address missing."
I don't know if these are related to each other.
For the first one, I marked line 1698:
Code: Select all
Sub write_log(txt)
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fs
Dim f
Dim fn
Dim fnl
Dim tmp
If write_log_active then
Set fs = CreateObject("scripting.filesystemobject")
fn = logspath & "hmailserver_event_" & get_date & ".log"
fnl = logspath & "hmailserver_event_" & get_date & ".lock"
If fs.FileExists(fnl) then
Dim i
For i = 0 To 25
log_delay
If Not fs.FileExists(fnl) Then
i = 10000
End If
next
End If
If Not fs.FileExists(fnl) then
Set f = fs.opentextfile(fnl, ForWriting, true)
f.Write("")
f.Close
Set f = fs.opentextfile(fn, ForAppending, true)
'It would be cleaner without the quotes, but they seem to be used as discovery tokens in SMTP_log_position
tmp = """" & FormatDateTime(Date + time,0) & """" & Chr(9) & """" & txt & """" & nl
'tmp = FormatDateTime(Date + time,0) & " " & txt & nl
LINE 1698 f.Write(tmp)
f.Close
fs.DeleteFile(fnl)
End If
End if
End Sub
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
The log problem - I think I know the answer to that one.
I hMailServer Administrator, under Settings, go to "Logging" and make sure that "Keep Files Open" is unchecked. If it is checked, it locks the log file.
I hMailServer Administrator, under Settings, go to "Logging" and make sure that "Keep Files Open" is unchecked. If it is checked, it locks the log file.
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Also, are you using hMailServer version 4? My fixes messed up the backward compability. I am using version 5 with this script and never get any of the errors you are reporting (that doesn't mean much, however
).

Re: Distribution list enhancement
Hi Gabriel,
thank you, but there must be something else causing it.
The keep files open switch was already deactivated.
I am using hMailserver 5.5.3-B1879 with MSSQL CE.
Since my last post there was not much traffic on the list and no errors occured.
But I don't think the problems disappeared themselves, so I'll have to observe it ...
thank you, but there must be something else causing it.
The keep files open switch was already deactivated.
I am using hMailserver 5.5.3-B1879 with MSSQL CE.
Since my last post there was not much traffic on the list and no errors occured.
But I don't think the problems disappeared themselves, so I'll have to observe it ...
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Mr. Toast,
Okay. If you find anything out, let me know and I'll be happy to update the script and/or documentation.
Okay. If you find anything out, let me know and I'll be happy to update the script and/or documentation.
Re: Distribution list enhancement
Sorry if this is a noob question but will this script do the following -
1: Allow me to change the " reply to", to the list address, rather than the senders address, so when someone on the list presses reply it will automatically reply to the list address rather than the senders address?
2: Add the list name to the Subject so the subject would be changed to something like this - "
1: Allow me to change the " reply to", to the list address, rather than the senders address, so when someone on the list presses reply it will automatically reply to the list address rather than the senders address?
2: Add the list name to the Subject so the subject would be changed to something like this - "
- original subject"
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
You can do just about anything. Have you taken a look at the documentation for it? Take a look at the "Features" section.
Re: Distribution list enhancement
Yes I looked at the features section & i'm pretty sure you can change the reply to header but wasn't sure about the subject.brother.gabriel wrote:You can do just about anything. Have you taken a look at the documentation for it? Take a look at the "Features" section.
I just wanted to be sure before I jumped in and started experimenting, as it could be steep leaning curve for me, not know anything about scripting.
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Well, it's just a vbs script, so you can always change it to suit your fancy. You can make it do anything you want.
If you find any significant improvements or fix any bugs, post back here so we can update the script (I've sort of put myself in charge of it since I wrote the documentation pages).
If you find any significant improvements or fix any bugs, post back here so we can update the script (I've sort of put myself in charge of it since I wrote the documentation pages).
Re: Distribution list enhancement
Thanks for your reply.brother.gabriel wrote:Well, it's just a vbs script, so you can always change it to suit your fancy. You can make it do anything you want.
If you find any significant improvements or fix any bugs, post back here so we can update the script (I've sort of put myself in charge of it since I wrote the documentation pages).
Unfortunately I don't really know anything about scripting or VBS. I was hoping it was as simple as downloading the script and seting the "list name" for the Subject field & seting the "reply to" field to the list address.
It looks like its not that simple & I may be getting in way over my head.
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Weeeelll, no, it's not really thaaaat simple... Read the section in the docs for "installation" before you begin. But before you can install the script, you have to install hMailServer and get it running, too.
Chances are, however, that if you get hMailServer working, you might have what it takes to get the script running for you.
The script works. It does what it's supposed to, but it ain't plug-n-play.
If you don't really want a list server, but just to change the reply address, this might be overkill.
Chances are, however, that if you get hMailServer working, you might have what it takes to get the script running for you.
The script works. It does what it's supposed to, but it ain't plug-n-play.
If you don't really want a list server, but just to change the reply address, this might be overkill.
Re: Distribution list enhancement
I have been running mail servers and domain & web hosting for years and switched over to hMailServer about 6 months ago with 8 domains & about 50 email addresses. I'm very happy with hMailServer, it does everything I need except the 2 additions to the distribution list i'd like.
I have installed the script but not quite sure where to start. Any pointers on where in the script I would make these 2 changes would be greatly appreciated. Once I know where to start, I can experiment until I get it working.
I have installed the script but not quite sure where to start. Any pointers on where in the script I would make these 2 changes would be greatly appreciated. Once I know where to start, I can experiment until I get it working.
- brother.gabriel
- Normal user
- Posts: 139
- Joined: 2012-03-29 17:25
- Location: Kansas City
- Contact:
Re: Distribution list enhancement
Well, I'd suggest looking over the docs at "installation and setup" and "how to set up your first list". Really, everything should be there. After you've read that and tried it, I'll be happy to help.
But you've got to read it. I wrote it so you can read it. It's a lot, but there are a lot of pictures. The help file comes as a chm file when you download the package, so you don't have to use the online version (they are the same anyway).
But you've got to read it. I wrote it so you can read it. It's a lot, but there are a lot of pictures. The help file comes as a chm file when you download the package, so you don't have to use the online version (they are the same anyway).
Re: Distribution list enhancement
Oh I am so sorry. I have been looking at the script & help files in the first post only. I did not see the manual you posted later.brother.gabriel wrote:Well, I'd suggest looking over the docs at "installation and setup" and "how to set up your first list". Really, everything should be there. After you've read that and tried it, I'll be happy to help.
But you've got to read it. I wrote it so you can read it. It's a lot, but there are a lot of pictures. The help file comes as a chm file when you download the package, so you don't have to use the online version (they are the same anyway).
This is very well written and I think there is more that enough info there for me to get started. Thanks for your help & efforts in producing the manual.
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Hello
This script is exactly what I was looking for. Thanks for this!
A small idea: A password for some lists commands (especially: list, subscribelist, unsubscribelist, subscribeaddress, unsubscribeaddress). Then only admins can use list commands in public lists.
Greetings from switzerland
Peter
This script is exactly what I was looking for. Thanks for this!

A small idea: A password for some lists commands (especially: list, subscribelist, unsubscribelist, subscribeaddress, unsubscribeaddress). Then only admins can use list commands in public lists.
Greetings from switzerland
Peter
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
non member mail delivered
Houston, we have a problem!
I installed the script (thanks for the documentation) an set up a test list with 4 members for a closed mailing group, with a password for external users and all list commands on (for testing only).
- List commands works
- Mails from Members works
- Mails from non-members with password works
BUT: Mails from non-members WITHOUT password are delivered to! No failure message!
In the Log i see this:
here the complete log from my last test (with some xxxx to replace private information):
In the Error log is a new entry:
I'am sure its my fault
, but where is the problem? 
Thanks for help.
I installed the script (thanks for the documentation) an set up a test list with 4 members for a closed mailing group, with a password for external users and all list commands on (for testing only).
- List commands works
- Mails from Members works
- Mails from non-members with password works
BUT: Mails from non-members WITHOUT password are delivered to! No failure message!
In the Log i see this:
Code: Select all
"10/30/2013 1:31:11 PM" " -->Ooooo! Looky! : PW wrong"
"10/30/2013 1:31:11 PM" " This is a distribution list"
"10/30/2013 1:31:11 PM" " Not a member of the distribution list"
"10/30/2013 1:31:11 PM" " Checking conditions: Operator or"
"10/30/2013 1:31:11 PM" " -->result = false : recipient will be deleted"
"10/30/2013 1:31:13 PM" "------------------------- OnDeliverMessage Event -------------------------"
"10/30/2013 1:31:13 PM" " Message Delivered"
here the complete log from my last test (with some xxxx to replace private information):
Code: Select all
"10/30/2013 1:31:11 PM" "------------------------- OnAcceptMessage Event -------------------------"
"10/30/2013 1:31:11 PM" " Adding oclient header: XXX.XXX.131.239##25"
"10/30/2013 1:31:11 PM" "------------------------- OnDeliveryStart Event -------------------------"
"10/30/2013 1:31:11 PM" "~Mail FromAddress: Peter.XXXX@XXXX.ch"
"10/30/2013 1:31:11 PM" "~Mail From: Zumstein Peter <Peter.XXXX@XXXX.ch>"
"10/30/2013 1:31:11 PM" "~Mail To: "'test@XXXX.ch'" <test@XXXX.ch>"
"10/30/2013 1:31:11 PM" "~Subject: Ok, lets try"
"10/30/2013 1:31:11 PM" "~-->Starting mail configuration check"
"10/30/2013 1:31:11 PM" " Recipient: test@XXXX.ch"
"10/30/2013 1:31:11 PM" "~-->Reading config file: C:\Program Files (x86)\hMailServer\config\XXXX.ch\test_at_XXXX_ch.hms"
"10/30/2013 1:31:11 PM" " admin=peter@XXXX.org"
"10/30/2013 1:31:11 PM" " operator=or"
"10/30/2013 1:31:11 PM" " todo=delete"
"10/30/2013 1:31:11 PM" " pw_enclosure=#"
"10/30/2013 1:31:11 PM" " pw=XXXX"
"10/30/2013 1:31:11 PM" " allowmembers=true"
"10/30/2013 1:31:11 PM" " addsenderheader=list"
"10/30/2013 1:31:11 PM" " addreplytoheader=%mailfrom%"
"10/30/2013 1:31:11 PM" " addreturnpathheader=%admin%"
"10/30/2013 1:31:11 PM" " smtpmailfrom=%serveradmin%"
"10/30/2013 1:31:11 PM" " disallowed_attachments=#exe#bat#com#msi#scr"
"10/30/2013 1:31:11 PM" " subjectprefix=%address%: "
"10/30/2013 1:31:11 PM" " failure_notification=true"
"10/30/2013 1:31:11 PM" " failure_notification_subject=Delivery Failure"
"10/30/2013 1:31:11 PM" " failure_notification_file=failure_notification.txt"
"10/30/2013 1:31:11 PM" " success_notification=true"
"10/30/2013 1:31:11 PM" " success_notification_subject=Successful delivery"
"10/30/2013 1:31:11 PM" " success_notification_file=success_notification.txt"
"10/30/2013 1:31:11 PM" " header_file=header.txt"
"10/30/2013 1:31:11 PM" " footer_file=footer.txt"
"10/30/2013 1:31:11 PM" " header_file_html=header.html"
"10/30/2013 1:31:11 PM" " footer_file_html=footer.html"
"10/30/2013 1:31:11 PM" " attach_recipients_to_footer=true"
"10/30/2013 1:31:11 PM" " attach_recipients_delimiter=; "
"10/30/2013 1:31:11 PM" " attach_recipients_html=<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>%recipients%</span></font></p>"
"10/30/2013 1:31:11 PM" " email_subscription=true"
"10/30/2013 1:31:11 PM" " email_subscription_admin_notification=true"
"10/30/2013 1:31:11 PM" " email_subscription_allowed_cmds=help#subscribe#unsubscribe#list#subscribeaddress#unsubscribeaddress#subscribelist#unsubscribelist"
"10/30/2013 1:31:11 PM" " email_subscription_success_notification=true"
"10/30/2013 1:31:11 PM" " email_subscription_failure_notification=true"
"10/30/2013 1:31:11 PM" " Subscription via email activated."
"10/30/2013 1:31:11 PM" " CONSIDERING SUBSCRIPTIONS COMMANDS"
"10/30/2013 1:31:11 PM" " Email subject does not contain a valid command."
"10/30/2013 1:31:11 PM" " Checking recipient: test@XXXX.ch"
"10/30/2013 1:31:11 PM" " -->Ooooo! Looky! : PW wrong"
"10/30/2013 1:31:11 PM" " This is a distribution list"
"10/30/2013 1:31:11 PM" " Not a member of the distribution list"
"10/30/2013 1:31:11 PM" " Checking conditions: Operator or"
"10/30/2013 1:31:11 PM" " -->result = false : recipient will be deleted"
"10/30/2013 1:31:13 PM" "------------------------- OnDeliverMessage Event -------------------------"
"10/30/2013 1:31:13 PM" " Message Delivered"
In the Error log is a new entry:
Code: Select all
"ERROR" 2668 "2013-10-30 13:31:11.909" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A003E - Description: Input past end of file - Line: 2096 Column: 2 - Code: (null)"


Thanks for help.
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Ok, found the problem: My domainposter.txt was empty. Adding a single adress solves the problem. Now non member mails and notifications works as expected.
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Ok, new problem
I set the parameter "todo" to "redirect and test it with a non member email. Here is the log:
The "admin" parameter contains my email address and the log says "redirected". But I get no mail. There are no errors in the error log.
hMailServer log of this action:
Any ideas?
I set the parameter "todo" to "redirect and test it with a non member email. Here is the log:
Code: Select all
"10/30/2013 3:49:54 PM" "------------------------- OnAcceptMessage Event -------------------------"
"10/30/2013 3:49:54 PM" " Adding oclient header: XXX.209.131.XXX##25"
"10/30/2013 3:49:54 PM" "------------------------- OnDeliveryStart Event -------------------------"
"10/30/2013 3:49:54 PM" "~Mail FromAddress: Peter.XXXX@XXXX.ch"
"10/30/2013 3:49:54 PM" "~Mail From: Zumstein Peter <Peter.XXXX@XXXX.ch>"
"10/30/2013 3:49:54 PM" "~Mail To: "test@XXXX.ch" <test@XXXX.ch>"
"10/30/2013 3:49:54 PM" "~Subject: Test Redirect"
"10/30/2013 3:49:54 PM" "~-->Starting mail configuration check"
"10/30/2013 3:49:54 PM" " Recipient: test@XXXX.ch"
"10/30/2013 3:49:54 PM" "~-->Reading config file: C:\Program Files (x86)\hMailServer\config\sjmk.ch\test_at_XXXX_ch.hms"
"10/30/2013 3:49:54 PM" " admin=peter@XXXX.org"
"10/30/2013 3:49:54 PM" " operator=or"
"10/30/2013 3:49:54 PM" " todo=redirect"
"10/30/2013 3:49:54 PM" " pw_enclosure=#"
"10/30/2013 3:49:54 PM" " pw=XXXX"
"10/30/2013 3:49:54 PM" " allowmembers=true"
"10/30/2013 3:49:54 PM" " addsenderheader=list"
"10/30/2013 3:49:54 PM" " addreplytoheader=%mailfrom%"
"10/30/2013 3:49:54 PM" " addreturnpathheader=%admin%"
"10/30/2013 3:49:54 PM" " smtpmailfrom=%serveradmin%"
"10/30/2013 3:49:54 PM" " disallowed_attachments=#exe#bat#com#msi#scr"
"10/30/2013 3:49:54 PM" " subjectprefix=%address%: "
"10/30/2013 3:49:54 PM" " failure_notification=true"
"10/30/2013 3:49:54 PM" " failure_notification_subject=Delivery Failure"
"10/30/2013 3:49:54 PM" " failure_notification_file=failure_notification.txt"
"10/30/2013 3:49:54 PM" " success_notification=true"
"10/30/2013 3:49:54 PM" " success_notification_subject=Successful delivery"
"10/30/2013 3:49:54 PM" " success_notification_file=success_notification.txt"
"10/30/2013 3:49:54 PM" " header_file=header.txt"
"10/30/2013 3:49:54 PM" " footer_file=footer.txt"
"10/30/2013 3:49:54 PM" " header_file_html=header.html"
"10/30/2013 3:49:54 PM" " footer_file_html=footer.html"
"10/30/2013 3:49:54 PM" " attach_recipients_to_footer=true"
"10/30/2013 3:49:54 PM" " attach_recipients_delimiter=; "
"10/30/2013 3:49:54 PM" " attach_recipients_html=<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>%recipients%</span></font></p>"
"10/30/2013 3:49:54 PM" " email_subscription=true"
"10/30/2013 3:49:54 PM" " email_subscription_admin_notification=true"
"10/30/2013 3:49:54 PM" " email_subscription_allowed_cmds=help#subscribe#unsubscribe#list#subscribeaddress#unsubscribeaddress#subscribelist#unsubscribelist"
"10/30/2013 3:49:54 PM" " email_subscription_success_notification=true"
"10/30/2013 3:49:54 PM" " email_subscription_failure_notification=true"
"10/30/2013 3:49:54 PM" " Subscription via email activated."
"10/30/2013 3:49:54 PM" " CONSIDERING SUBSCRIPTIONS COMMANDS"
"10/30/2013 3:49:54 PM" " Email subject does not contain a valid command."
"10/30/2013 3:49:54 PM" " Checking recipient: test@XXXX.ch"
"10/30/2013 3:49:54 PM" " -->Ooooo! Looky! : PW wrong"
"10/30/2013 3:49:54 PM" " This is a distribution list"
"10/30/2013 3:49:54 PM" " Not a member of the distribution list"
"10/30/2013 3:49:54 PM" " Checking conditions: Operator or"
"10/30/2013 3:49:54 PM" " -->result = false : recipient will be deleted"
"10/30/2013 3:49:54 PM" " Global + Domain Posters are:info@xxxx.ch#info@xxxx.ch"
"10/30/2013 3:49:54 PM" " -->Recipient will be deleted."
"10/30/2013 3:49:54 PM" " Changing recipients"
"10/30/2013 3:49:54 PM" " Recipient test@XXXX.ch has been redirected to admin"
"10/30/2013 3:49:54 PM" " Adding admin email address."
hMailServer log of this action:
Code: Select all
"TCPIP" 3440 "2013-10-30 15:49:53.156" "TCP - xxx.209.131.xxxconnected to xxx.228.112.xxx:25."
"DEBUG" 3440 "2013-10-30 15:49:53.159" "Creating session 87"
"SMTPD" 3440 87 "2013-10-30 15:49:53.159" "xxx.209.131.xxx" "SENT: 220 mail.zumsteinweb.ch ESMTP"
"SMTPD" 3440 87 "2013-10-30 15:49:53.164" "xxx.209.131.xxx" "RECEIVED: EHLO esa1.xxxx.ch"
"SMTPD" 3440 87 "2013-10-30 15:49:53.165" "xxx.209.131.xxx" "SENT: 250-mail.xxxxx.ch[nl]250-SIZE 20480000[nl]250 AUTH LOGIN"
"SMTPD" 3416 87 "2013-10-30 15:49:53.172" "xxx.209.131.xxx" "RECEIVED: MAIL FROM:<Peter.xxxx@xxxx.ch> SIZE=7849"
"DEBUG" 3416 "2013-10-30 15:49:53.177" "Spam test: SpamTestHeloHost, Score: 0"
"DEBUG" 3416 "2013-10-30 15:49:53.177" "Spam test: SpamTestMXRecords, Score: 0"
"DEBUG" 3416 "2013-10-30 15:49:53.180" "Spam test: SpamTestSPF, Score: 0"
"DEBUG" 3416 "2013-10-30 15:49:53.181" "Total spam score: 0"
"SMTPD" 3416 87 "2013-10-30 15:49:53.184" "xxx.209.131.xxx" "SENT: 250 OK"
"SMTPD" 3408 87 "2013-10-30 15:49:53.196" "xxx.209.131.xxx" "RECEIVED: RCPT TO:<test@xxxx.ch>"
"DEBUG" 3408 "2013-10-30 15:49:53.203" "DistributionList::LMPublic"
"SMTPD" 3408 0 "2013-10-30 15:49:53.232" "TCP" "DNS - MX Lookup: xxxx.ch"
"SMTPD" 3408 0 "2013-10-30 15:49:53.235" "TCP" "DNS - MX Result: 3 IP addresses were found."
"DEBUG" 3408 "2013-10-30 15:49:53.235" "Mail coming from A or MX record. Skipping grey listing."
"SMTPD" 3408 87 "2013-10-30 15:49:53.243" "xxx.209.131.xxx" "SENT: 250 OK"
"SMTPD" 3408 87 "2013-10-30 15:49:53.248" "xxx.209.131.xxx" "RECEIVED: DATA"
"SMTPD" 3408 87 "2013-10-30 15:49:53.249" "xxx.209.131.xxx" "SENT: 354 OK, send."
"DEBUG" 3228 "2013-10-30 15:49:54.255" "Spam test: SpamTestSpamAssassin, Score: 0"
"DEBUG" 3228 "2013-10-30 15:49:54.256" "Total spam score: 0"
"DEBUG" 3228 "2013-10-30 15:49:54.256" "ScriptServer:FireEvent"
"DEBUG" 3228 "2013-10-30 15:49:54.268" "ScriptServer:~FireEvent"
"DEBUG" 3228 "2013-10-30 15:49:54.268" "Saving message: {105F8C82-B9B1-4487-AFCB-D8E26DE7295F}.eml"
"DEBUG" 3228 "2013-10-30 15:49:54.284" "Requesting SMTPDeliveryManager to start message delivery"
"SMTPD" 3228 87 "2013-10-30 15:49:54.285" "xxx.209.131.xxx" "SENT: 250 Queued (1.016 seconds)"
"DEBUG" 3336 "2013-10-30 15:49:54.290" "Delivering message..."
"DEBUG" 3336 "2013-10-30 15:49:54.290" "ScriptServer:FireEvent"
"DEBUG" 3336 "2013-10-30 15:49:54.613" "ScriptServer:~FireEvent"
"DEBUG" 3336 "2013-10-30 15:49:54.614" "Deleting message"
"DEBUG" 3336 "2013-10-30 15:49:54.622" "Deleting message file."
"SMTPD" 3432 87 "2013-10-30 15:49:59.304" "xxx.209.131.xxx" "RECEIVED: QUIT"
"SMTPD" 3432 87 "2013-10-30 15:49:59.304" "xxx.209.131.xxx" "SENT: 221 goodbye"
"DEBUG" 3432 "2013-10-30 15:49:59.305" "Closing TCP/IP socket"
"DEBUG" 3432 "2013-10-30 15:49:59.305" "Ending session 87"
Any ideas?
Re: Distribution list enhancement
Which is your admin address?Colossus999 wrote:The "admin" parameter contains my email address and the log says "redirected". But I get no mail. There are no errors in the error log.
hMailServer log of this action:
is it a locally hosted account, or is it hosted elsewhere?
Look for SMTPC line following this. SMTPD is receiving, SMTPC is sending
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
My normal address is hosted locally (but not the same domain as the list). Tested a external account too. Same result.mattg wrote:Which is your admin address?
is it a locally hosted account, or is it hosted elsewhere?
Look for SMTPC line following this. SMTPD is receiving, SMTPC is sending
I can't find any SMTPC log entry that fits the to the redirect.
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Ok, problem identified!
File: "EventHandlers.vbs"
In line 326 ReplaceTokens returns an empty string. Variable "temp" has no value and the value in "thisadmin" is cleared. So the message receives no new email address for the redirect.
Replace "temp" with "thisadmin". It works!
File: "EventHandlers.vbs"
Code: Select all
324. dim thisadmin 'fetch the admin setting from the config file
325. thisadmin = get_config_string(mailto, "admin")
326. thisadmin = ReplaceTokens(temp, mailto, mailfrom)

Code: Select all
326. thisadmin = ReplaceTokens(thisadmin, mailto, mailfrom)
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Hello again
Have new problem: Digital signed Mails!
If the script is turned on, the signature is corrupted in digitally signed e-mails. Error message after sending and receiving of email: "Invalid signature. The message may have been altered". After the script is turned off, signatures are sent valid again.
The mail account used is not a list. There is also no hms config file for this account. The email should therefore not be touched or changed. Is there a config option which ensures that the messages are left unchanged in such a non-configured account?
Thanks for helping.
Have new problem: Digital signed Mails!
If the script is turned on, the signature is corrupted in digitally signed e-mails. Error message after sending and receiving of email: "Invalid signature. The message may have been altered". After the script is turned off, signatures are sent valid again.
The mail account used is not a list. There is also no hms config file for this account. The email should therefore not be touched or changed. Is there a config option which ensures that the messages are left unchanged in such a non-configured account?
Thanks for helping.
Re: Distribution list enhancement
Doesn't this script add header(s), and change the from?
That is changing the message as far as digital signatures is concerned.
I doubt that you could change a message, and maintain a digital signature. (I mean, that's the point of digital signatures, right?)
That is changing the message as far as digital signatures is concerned.
I doubt that you could change a message, and maintain a digital signature. (I mean, that's the point of digital signatures, right?)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Yes, that is the meaning of the script. But ONLY for accounts that are configured as a list. All other messages must not be changed!mattg wrote:Doesn't this script add header(s), and change the from?
That is changing the message as far as digital signatures is concerned.
I doubt that you could change a message, and maintain a digital signature. (I mean, that's the point of digital signatures, right?)
Re: Distribution list enhancement
This script only adds the oclient header vcalue if the destination is a list:Colossus999 wrote:Yes, that is the meaning of the script. But ONLY for accounts that are configured as a list. All other messages must not be changed!mattg wrote:Doesn't this script add header(s), and change the from?
That is changing the message as far as digital signatures is concerned.
I doubt that you could change a message, and maintain a digital signature. (I mean, that's the point of digital signatures, right?)
Code: Select all
If is_local_list(oMessage.Recipients(i).OriginalAddress) then 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. ***
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Sorry, but there must be other changes on my emails.
If I send a signed email from my account (not a list) with script activated, directly (not via a list) to an external (not on my hMailServer) or internal (on my hMailServer, but not a list) destination address, then the signature is corrupted. The same email with scripts disabled and the signature remains intact.
This means that the script changed outgoing mails, right?
If I send a signed email from my account (not a list) with script activated, directly (not via a list) to an external (not on my hMailServer) or internal (on my hMailServer, but not a list) destination address, then the signature is corrupted. The same email with scripts disabled and the signature remains intact.
This means that the script changed outgoing mails, right?
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
Ahhhhhh..... My faultBill48105 wrote:This script only adds the oclient header vcalue if the destination is a list:If the email is to multiple recipients they all share the same email "oMessage". If you need something else modify the script to make COPIES of the message & only add headers to the list copy.Code: Select all
If is_local_list(oMessage.Recipients(i).OriginalAddress) then add_client_info oClient, oMessage


Thanks for your help. Greetings from switzerland.
Re: Distribution list enhancement
Right no worries. Not debating if the script is changing or if it has an issue (even if specific to you) but yeah check out where the header is added to see if that gets you anywhere. For all I know I changed my version here it's been so long but I don't see the list headers in my normal emails.Colossus999 wrote:Ahhhhhh..... My faultBill48105 wrote:This script only adds the oclient header vcalue if the destination is a list:If the email is to multiple recipients they all share the same email "oMessage". If you need something else modify the script to make COPIES of the message & only add headers to the list copy.Code: Select all
If is_local_list(oMessage.Recipients(i).OriginalAddress) then add_client_info oClient, oMessage
. Now i understand
. Will test this.
Thanks for your help. Greetings from switzerland.
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. ***
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
- Colossus999
- New user
- Posts: 11
- Joined: 2013-10-30 10:21
Re: Distribution list enhancement
This can't work. "i" isn't defined at this point and "oMessage.Recipients(i).OriginalAddress" requires For...Next if more than 1 recipient exists.Bill48105 wrote:Code: Select all
If is_local_list(oMessage.Recipients(i).OriginalAddress) then add_client_info oClient, oMessage
My solution change a mail only if at least one of the recipients is a list. In this way, signed mails with a valid signature can be sent as long as none of the recipients is a list.
Code: Select all
Sub OnAcceptMessage(oClient, oMessage)
write_log(d1 & " OnAcceptMessage Event " & d1)
Set obApp = CreateObject("hMailServer.Application")
Call obApp.Authenticate(user, pw)
Dim ListFlag
Dim ListCheck
Dim ListCount
ListFlag = false
For ListCount = 0 To (oMessage.Recipients.count - 1)
ListCheck = is_local_list(oMessage.Recipients(ListCount).OriginalAddress)
If ListCheck Then ListFlag = true
write_log ("Target : " & oMessage.Recipients(ListCount).OriginalAddress)
write_log ("Is list? : " & ListCheck )
write_log ("----------------------------------------")
Next
If ListFlag Then
write_log ("Recipents containing list(s).")
write_log ("Edit message before sending.")
add_client_info oClient, oMessage 'prepare_mailconfiguration oClient, oMessage
Else
write_log ("Recipents containing no list(s).")
write_log ("Keep message untouched.")
End If
End Sub
Re: Distribution list enhancement
Got me I hadn't reviewed the code I just pointed out the fact the code claims to only add the header if it's a list.Colossus999 wrote:This can't work. "i" isn't defined at this point and "oMessage.Recipients(i).OriginalAddress" requires For...Next if more than 1 recipient exists.Bill48105 wrote:Code: Select all
If is_local_list(oMessage.Recipients(i).OriginalAddress) then add_client_info oClient, oMessage
My solution change a mail only if at least one of the recipients is a list. In this way, signed mails with a valid signature can be sent as long as none of the recipients is a list.
Code: Select all
Sub OnAcceptMessage(oClient, oMessage) write_log(d1 & " OnAcceptMessage Event " & d1) Set obApp = CreateObject("hMailServer.Application") Call obApp.Authenticate(user, pw) Dim ListFlag Dim ListCheck Dim ListCount ListFlag = false For ListCount = 0 To (oMessage.Recipients.count - 1) ListCheck = is_local_list(oMessage.Recipients(ListCount).OriginalAddress) If ListCheck Then ListFlag = true write_log ("Target : " & oMessage.Recipients(ListCount).OriginalAddress) write_log ("Is list? : " & ListCheck ) write_log ("----------------------------------------") Next If ListFlag Then write_log ("Recipents containing list(s).") write_log ("Edit message before sending.") add_client_info oClient, oMessage 'prepare_mailconfiguration oClient, oMessage Else write_log ("Recipents containing no list(s).") write_log ("Keep message untouched.") End If End Sub

Thx for sharing your changes though sure someone else will find it useful.
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. ***
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
Re: Distribution list enhancement
The position for choosing where to insert the HTML footer is wrong - it finds the first end DIV tag - it should find the last so just change InStr to InStrRev.brother.gabriel wrote:Hi, Mr. Toast,
Hmmm...
Now that I look at it, I think my messages have the same problem.
I'll have to look at that.
If anyone has a clue, I'm all ears.
Code: Select all
If footerhtml <> "" Then
write_log (s2 & "Adding html footer")
pos = InStrRev(oMessage.HTMLBody, "</div")
If pos < 1 then
pos = InStr(1, oMessage.HTMLBody, "</body")
End If
Re: Distribution list enhancement
In my installation I've applied this patch and I've also added the following:MattK wrote:The position for choosing where to insert the HTML footer is wrong - it finds the first end DIV tag - it should find the last so just change InStr to InStrRev.
To prevent out of office replies and other stuff being sent back to the list or the sender...
Roughly line 295 in EventHandlers.vbs:
Code: Select all
tmpMessage.HeaderValue("Precedence") = "bulk"
tmpMessage.HeaderValue("X-Auto-Response-Suppress") = "All"
[BobsList] [BobsList] [BobsList] [BobsList] [BobsList] [BobsList] RE: Meeting tomorrow
Solved by putting an if around the line
Code: Select all
oMessage.Subject = temp & oMessage.Subject
Code: Select all
if InStr(1, oMessage.Subject, temp) = 0 Then
oMessage.Subject = temp & oMessage.Subject
End If
Re: Distribution list enhancement
Can you post back with an updated complete script, and I can then start a new thread (with acknowledgement links to this one) and help keep it maintained for future variations
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: Distribution list enhancement
Good morning. I installed this very useful script and got it working but I have an issue. In the list config, there is a setting:
If set to false, list commands don't work. If set to true, list commands work but there is no password protection. I want to be able to distribute the password among friends, but not allow any old spammer to subscribe. Is there a way to password protect self-subscription?
Code: Select all
# Allow List Commands
# Setting this to false will disable list commands. The message will then be processed as a normal email.
# If this is set to true, ANYBODY can send list commands to the list. It doesn't matter whether they are posters or have a password.
# Send help to the list to receive further information
email_subscription=false
Re: Distribution list enhancement
There is a mailing list access controls bypass bug in the original script!
If someone can trigger the log writing to fail it allows unauthenticated, non-list members or whitelisted senders to send to all the list!
You can trigger the failure by sending an emoji or UTF-8 subject line - I expect other content in the sender or to address would also trigger it.
E.g.
The symptoms are - spam gets through to your list and the subject line, headers and footers are not appended to the message.
You see an error like this in the logs:
"ERROR" 1220 "2018-03-07 12:55:43.827" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A0005 - Description: Invalid procedure call or argument - Line: 1702 Column: 3 - Code: (null)"
(The line number might be different as I've got a heavily updated and edited version of the script).
The mailing list script will then go wrong and stop processing any more messages. There will be a ".lock" file in your "C:\Program Files (x86)\hMailServer\Logs" folder that you have to delete to resume mailing list functionality.
hMailServer may even entirely stop processing messages until this lock file is deleted.
I'm too busy at the moment to identify how to gracefully fix this problem.
A workaround is to modify the vbs file like so:
Find the line (the only line) containing:
f.Write(tmp)
Put
on error resume next
before it
and
on error goto 0
after it.
The entire section should read
As a reminder.. I'm using brother.gabriel's base version (viewtopic.php?p=141473#p141473) and then added modifications and bugfixes here:
viewtopic.php?p=198678#p198678
Then the bug fix in this post.
At some point I hope to tidy up my code (as it has my admin details and mailing list passwords in it) and post it as a complete package here.
If someone can trigger the log writing to fail it allows unauthenticated, non-list members or whitelisted senders to send to all the list!
You can trigger the failure by sending an emoji or UTF-8 subject line - I expect other content in the sender or to address would also trigger it.
E.g.
Code: Select all
Subject: =?UTF-8?Q?=F0=9F=92=B8=20BitCoin=20Transfe?==?UTF-8?Q?r=20-=20Yo?= =?UTF-8?Q?u=20received=200.622653=20B?==?UTF-8?Q?TC!?=
You see an error like this in the logs:
"ERROR" 1220 "2018-03-07 12:55:43.827" "Script Error: Source: Microsoft VBScript runtime error - Error: 800A0005 - Description: Invalid procedure call or argument - Line: 1702 Column: 3 - Code: (null)"
(The line number might be different as I've got a heavily updated and edited version of the script).
The mailing list script will then go wrong and stop processing any more messages. There will be a ".lock" file in your "C:\Program Files (x86)\hMailServer\Logs" folder that you have to delete to resume mailing list functionality.
hMailServer may even entirely stop processing messages until this lock file is deleted.
I'm too busy at the moment to identify how to gracefully fix this problem.
A workaround is to modify the vbs file like so:
Find the line (the only line) containing:
f.Write(tmp)
Put
on error resume next
before it
and
on error goto 0
after it.
The entire section should read
Code: Select all
on error resume next
f.Write(tmp)
on error goto 0
viewtopic.php?p=198678#p198678
Then the bug fix in this post.
At some point I hope to tidy up my code (as it has my admin details and mailing list passwords in it) and post it as a complete package here.
Re: Distribution list enhancement
This script still works! 11 years later and it works with 5.7. And its a pretty cool feature to add to hmailserver.
Re: Distribution list enhancement
The script and documentation download disappeared between now and my last post, so I uploaded it to GitHub for future generations. If it was still good after 11 years, chances are it will be good for the next 11.
https://github.com/palinkas-jo-reggelt/ ... ListServer

https://github.com/palinkas-jo-reggelt/ ... ListServer
Re: Distribution list enhancement
Just be aware that the original scripts without my modifications have a mailing list authentication / whitelisted sender bypass problem!palinka wrote: ↑2020-03-10 01:27I uploaded it to GitHub for future generations.
https://github.com/palinkas-jo-reggelt/ ... ListServer
See
viewtopic.php?p=202880#p202880
Re: Distribution list enhancement
Hey, thanks for looking in. I did incorporate your "fix". Did you ever get around to a real fix?drsox wrote: ↑2020-03-10 20:40Just be aware that the original scripts without my modifications have a mailing list authentication / whitelisted sender bypass problem!palinka wrote: ↑2020-03-10 01:27I uploaded it to GitHub for future generations.
https://github.com/palinkas-jo-reggelt/ ... ListServer
See
viewtopic.php?p=202880#p202880
Re: Distribution list enhancement
No - nothing better than my on error resume next fix.., it's worked pretty well for me since and I don't have anywhere near enough spare time to make a more elegant fix.
Re: Distribution list enhancement
Forked !

SørenR.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.
Re: Distribution list enhancement
Re: Distribution list enhancement
Well... I just got plenty time on my hands

https://www.bloomberg.com/news/articles ... ical-staff
SørenR.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.