syntax for if statement

This forum is for discussing Mailtraq's Scripting features. Get help with Mailtraq scripts, templates and external ActiveX scripting.

syntax for if statement

Postby bmac » Mon May 04th, 2009 6:20pm

HI all,

I currently have this line in our mail2all.mtq file (thanks to Jim Hill)
if(GetMalboxProp(slot, "Mailgroup") = "Root", blahblah)

we now have to include another mailgroup.
How do I modify this line to say ="Root" OR ="NewMailGroup"?

thanks for any assistance,
bob
bmac
 
Posts: 6
Joined: Wed Aug 08th, 2007 4:18pm

Re: syntax for if statement

Postby Elric Pedder » Mon May 04th, 2009 7:40pm

bmac wrote:we now have to include another mailgroup.
How do I modify this line to say ="Root" OR ="NewMailGroup"?


I think the following will do the job
Code: Select all
if((GetMailboxProp(slot, "Mailgroup") = "Root") | (GetMailboxProp(slot, "Mailgroup") = "NewMailGroup"), blahblah)


If you have any trouble, just shout.
Mailtraq Development and Escalation Support
Novitraq Incorporated
User avatar
Elric Pedder
Mailtraq Escalation Support
 
Posts: 2675
Joined: Tue Nov 23rd, 2004 1:16pm
Location: Montreal, Canada

Re: syntax for if statement

Postby bmac » Tue May 05th, 2009 2:07pm

Thanks Elric,

Appreciate it...

I have another one... I am trying to create a file of ldap attributes and am attempting this:

<@LANGUAGE=Javascript@>
<%
var fso = new ActiveXObject("Scripting.FileSystemObject");
var output = fso.CreateTextFile("E:\\GetAttributes.csv");
var users = Config.GetAllUsers().split(',');
for (var i = 0; i < users.length; i++) {
var user = Config.GetUser(users[i]);
output.WriteLine(user.Name + ',' + user.GetLdapField( Department ) + ',' + user.GetLdapField( Organization ));
}
output.Close();
%>

the above creates an empty file. I tried changing the attributes to 'Department' and that does not work either.

How do I reference to get the ldap attributes? Also, is it possible that GetLdapField is a recent scripting addition?

thanks again, bob
bmac
 
Posts: 6
Joined: Wed Aug 08th, 2007 4:18pm

Re: syntax for if statement

Postby bmac » Tue May 05th, 2009 2:11pm

Is'nt that the case, went back and tried:
user.GetLdapField("OU" )

and it worked!!!
bmac
 
Posts: 6
Joined: Wed Aug 08th, 2007 4:18pm


Return to Mailtraq Scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron