Page 1 of 1

SecurityRange properties

Posted: 2011-03-26 15:49
by nis
Hello,
I dont see expiration and expiration date within properties list in the documentation

also, when I created a new range via vbscript, when I use the hmailserver interface, I cannot "edit" it when I clic on it. but I can delete it

here is a part of the code

dim SecurityRges
dim SecurityRge
dim obApp
Set obApp = CreateObject("hMailServer.Application")
Call obApp.Authenticate("Administrator", "password")

set SecurityRges = obApp.settings.SecurityRanges
set SecurityRge = SecurityRges.add
SecurityRge.AllowIMAPConnections = false
SecurityRge.AllowPOP3Connections = false
SecurityRge.AllowSMTPConnections = false

SecurityRge.AllowDeliveryFromLocalToLocal = false
SecurityRge.AllowDeliveryFromLocalToRemote = false
SecurityRge.AllowDeliveryFromRemoteToLocal = false
SecurityRge.AllowDeliveryFromRemoteToRemote = false
SecurityRge.EnableSpamProtection = false

SecurityRge.LowerIP = SendfromIP
SecurityRge.UpperIP = SendfromIP
SecurityRge.name = "blacklist IP :" & SendfromIP
SecurityRge.priority = 10
SecurityRge.save

many thanks

Re: SecurityRange properties

Posted: 2012-12-30 19:38
by philg
Did you ever figure out if you can set the expiry through the COM API/Scripting?
I'm looking at adding something similar to one of my scripts.

Thanks,
Phil

Re: SecurityRange properties

Posted: 2012-12-31 02:30
by mattg
I think...

SecurityRange.Expires (Boolean) where True = expiry enabled
SecurityRange.ExpiresTime (date & Time) = Daye and time of expiry.

( I got this from the PHPWebAdmin.php)

Re: SecurityRange properties

Posted: 2012-12-31 02:32
by philg
Thanks Matt,

Yes, you are right.... I figured it out looking at the COM interface with OLEView.
I got it working nicely :)

Phil

Re: SecurityRange properties

Posted: 2020-09-25 12:06
by FixItDik
I know this was a long time ago but I found it useful but also had the secondary issue that the original post mentioned: rules I create in my script could not be edited when clicked on in the admin interface.

The solution was very simple: close the admin tool down and open it again (you probably leave it open all the time like I do).

Basically it is a minor bug (or two) in the admin tool code that any rule created by scripts whilst it is running will appear in the list box (but not in the "tree" list in the navigation on the left) and can be clicked on but can only be deleted, not even viewed let alone edited.

It's not a bigee but thought someone might hit the same problem if they are looking at this post.

Re: SecurityRange properties

Posted: 2020-09-25 15:22
by SorenR
FixItDik wrote:
2020-09-25 12:06
I know this was a long time ago but I found it useful but also had the secondary issue that the original post mentioned: rules I create in my script could not be edited when clicked on in the admin interface.

The solution was very simple: close the admin tool down and open it again (you probably leave it open all the time like I do).

Basically it is a minor bug (or two) in the admin tool code that any rule created by scripts whilst it is running will appear in the list box (but not in the "tree" list in the navigation on the left) and can be clicked on but can only be deleted, not even viewed let alone edited.

It's not a bigee but thought someone might hit the same problem if they are looking at this post.
Did you try hitting F5 on your keyboard?

Re: SecurityRange properties

Posted: 2020-09-27 02:41
by mattg
I just change 'branches' in the tree in the left pane, then change back