Policy tutorial

Use this forum to post questions relating to WinGate, feature requests, technical or configuration problems

Moderator: Qbik Staff

Policy tutorial

Postby royjm22 » Apr 13 16 7:06 pm

my request to the wingate team is to release some more detailed tutorial about the policies , like creating policies purpose of policies meaning of predefined policies etc because i tried to create policy but unsuccessful and also i am getting an error in predefined policy notification handler error is no email address specified or survived parsing really i do not understand about this policy please help.
royjm22
 
Posts: 21
Joined: Feb 08 16 1:08 am

Re: Policy tutorial

Postby adrien » Apr 14 16 10:39 am

Hi

basically policies are event handlers. There are various things in WinGate that push events, and if you have something attached/connected/hooked to that event, then that thing will be "performed", so if you hook any of the event handlers (double click on an event in the list in Control Panel > Events and you will see a list of processors available for an event) then it will be done.

So Policy is just one of these, but it means if you don't hook a policy to an event, it's not going to do anything.

If you look in the policy that's hooked to your notification events, you'll see an item in there which tries to send an email. It takes a to address, and by default this comes from

{{Data.GetString("AdminEmail")}}

{{ ... some expression ... }}

means take the expression, evaluate it, do whatever it means, and then convert the output to a string (text).

So, this one takes the Data object, gets the string value called "AdminEmail", and uses that in the to address.

What that error is telling you is that after doing this, it had no email address. That's because there's no email address specified in the "adminEmail" string value in global data. Go to Control Panel > Data, and choose (at the bottom) the "Global Data" panel, and you should see it there. Our installer sets this to the value entered when you installed, but if you didn't enter an email address, then there's the problem.

The string may not be empty. The To and From addresses in the "Send Email" item can take name/email combinations. This is so the email can show a name as well as an email address, and the format internally is e..g

WInGate Support <support@wingate.com>

So if there's no email embedded (in angle brackets) in that string value, that explains the error "No email address survived parsing" - this means there may have been something, but after we tried to scrape an email out, we didn't get one. The significance of this can be subtle, but in some cases you may be getting these values from anywhere, and you may have expected there to be an email iln there, so we prefer to be precise in our error string rather.

There's quite a lot of information also in the help file on policy. If you open a policy and hit F1 key you should see this.

Regards

Adrien de Croy
adrien
Qbik Staff
 
Posts: 5441
Joined: Sep 03 03 2:54 pm
Location: Auckland

Re: Policy tutorial

Postby royjm22 » Apr 15 16 12:15 am

thanks for your valuable detailed information
royjm22
 
Posts: 21
Joined: Feb 08 16 1:08 am


Return to WinGate

Who is online

Users browsing this forum: Google [Bot] and 19 guests

cron