Best ways to amend .tab files

MartynK
Posts: 1314
Joined: Sat Dec 28, 2002 1:12 am
Location: Hong Kong

Best ways to amend .tab files

Postby MartynK » Thu Sep 28, 2017 6:43 am

I want to modify the contents on the SMTP-DENY.TAB are there any API or .NET routines for this ?

MartynK
Posts: 1314
Joined: Sat Dec 28, 2002 1:12 am
Location: Hong Kong

Re: Best ways to amend .tab files

Postby MartynK » Tue Oct 03, 2017 1:21 am

Anyone from Mailenable want to comment ?

Brett Rowbotham
Posts: 491
Joined: Mon Nov 03, 2003 7:48 am
Location: Cape Town

Re: Best ways to amend .tab files

Postby Brett Rowbotham » Tue Oct 03, 2017 5:05 am

Here is some code from a vb script that dealt with the SMTP-DENY tab which might help you:

FUNCTION OpenMailEnableAccess

Response "Opening Mail Enable SMTP-DENY configuration..."

dim obj
set obj = WScript.CreateObject("MEAOSM.Access")

Response "Done.<br>"

set OpenMailEnableAccess = obj

set obj = nothing

END FUNCTION

SUB SetNewSMTPDENYAddresses

Response "I will now reset Mail Enable's SMTP-DENY list.<br>Removing old list...<br>==================================================<br>"

dim int
dim objAccess
set objAccess = OpenMailEnableAccess
'set filter defaults.
objAccess.AddressMask = ""
objAccess.Host = ""
objAccess.Mode = 1
objAccess.Account = ""
objAccess.Right = ""
objAccess.Status = -1

int = objAccess.FindFirstAccess

IF int=0 THEN
Response "No addresses found in Mail Enable SMTP-DENY configuration.<br>Will move on...<br>"
ELSE

DO WHILE int > 0

Response "Removing IP: "& objAccess.AddressMask

int = objAccess.RemoveAccess

objAccess.AddressMask = ""
objAccess.Host = ""
objAccess.Mode = 1
objAccess.Account = ""
objAccess.Right = ""
objAccess.Status = -1

IF int = 1 THEN
Response "<br>"
int = objAccess.FindFirstAccess
ELSE
Response ". Cannot Remove this Record. Try again later.<br>"
int = objAccess.FindNextAccess
END IF

LOOP

END IF

Response "<br>Creating New SMTP-DENY List...<br>==================================================<br>"

dim objRs
set objRs = objCn.Execute("SELECT AddressMask,Host,Mode,Account,[Right],Status FROM TEMPmeroSMTPDENY;")

IF objRs.eof THEN
Response "No records to add.<br>Will move on...<br>"
ELSE

dim strIP

DO UNTIL objRs.eof
strIP = objRs("AddressMask") &""
Response "Adding IP: "& strIP
objAccess.AddressMask = strIP
objAccess.Host = objRs("Host") &""
objAccess.Mode = objRs("Mode")
objAccess.Account = objRs("Account") &""
objAccess.Right = objRs("Right") &""
objAccess.Status = objRs("Status")
objAccess.AddAccess
objRs.Movenext
Response(" Done.<br>")
LOOP

END IF

Response "<br>Closing Mail Enable SMTP-DENY configuration.<br>==================================================<br>"

set objAccess = nothing

END SUB

Who is online

Users browsing this forum: No registered users and 1 guest