SecurityRange properties

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
nis
New user
New user
Posts: 18
Joined: 2010-05-19 10:00

SecurityRange properties

Post by nis » 2011-03-26 15:49

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

philg
Normal user
Normal user
Posts: 38
Joined: 2008-05-03 15:49

Re: SecurityRange properties

Post by philg » 2012-12-30 19:38

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

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

Re: SecurityRange properties

Post by mattg » 2012-12-31 02:30

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)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

philg
Normal user
Normal user
Posts: 38
Joined: 2008-05-03 15:49

Re: SecurityRange properties

Post by philg » 2012-12-31 02:32

Thanks Matt,

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

Phil

FixItDik
New user
New user
Posts: 2
Joined: 2019-11-05 17:18

Re: SecurityRange properties

Post by FixItDik » 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.

User avatar
SorenR
Senior user
Senior user
Posts: 3740
Joined: 2006-08-21 15:38
Location: Denmark

Re: SecurityRange properties

Post by SorenR » 2020-09-25 15:22

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?
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

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

Re: SecurityRange properties

Post by mattg » 2020-09-27 02:41

I just change 'branches' in the tree in the left pane, then change back
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply