NTDOCAdministrator
(KiX Master)
2004-12-15 02:32 AM
MX Record lookup help

Does anyone know of a FREE tool or method to perform an MX record lookup from within KiXtart to supply an address to an application?

Microsoft's NSLOOKUP allows you to set a filter to do this, but not in a non-interactive mode.
How to obtain Internet Mail Exchanger records with the Nslookup.exe Utility
http://support.microsoft.com/default.aspx?scid=kb;EN-US;203204

Example:
NSLOOKUP
[now puts you into an interactive mode]
set q=mx [now only queries mx records]
mymailserver.mycompany.com

Would come back with something similar to this:
Server: mydnsserver.mycompany.com
Address: 122.120.100.1

authoritative answer:
mymailserver.mycompany.com MX preference = 10, mail exchanger = server1.eastcoast.mycompany.com
mymailserver.mycompany.com MX preference = 0, mail exchanger = server1.westcoast.mycompany.com
mymailserver.mycompany.com MX preference = 0, mail exchanger = server2.westcoast.mycompany.com



What I'm attempting to do is use BLAT to send e-mail, but I want to have KiXtart check and verify first that the server is up and if not then check the next server in line
BLAT does not appear to natively support an MX record lookup so I want to attempt to have KiX support it for BLAT.

I've found tools to do it, but would prefer a free method or tool to do so. In my case I already know all the real names, so I could manually code it in KiXtart, but I would rather automate it so that in case a server is changed I don't have to modify my code, which is the purpose of having an MX record in the first place.


Email Toolbox MX Record
http://www.arclab.com/products/emailtoolbox/mxrecord.html

HexValidEmail
http://www.hexillion.com/hg/asp-email-verification-component/

I'm sure Howard could supply an EXE using Perl to do this. Too bad Microsoft does not allow this in a non-interactive mode


AllenAdministrator
(KiX Supporter)
2004-12-15 04:03 AM
Re: MX Record lookup help

Maybe I'm misunderstanding the problem but nslookup does have a noninteractive mode... so wouldn't what you want be:

nslookup -q=mx mymailserver.mycompany.com

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nslookup.mspx


NTDOCAdministrator
(KiX Master)
2004-12-15 05:56 AM
Re: MX Record lookup help

Thanks Al - consider your DOUBLE CTRL-ALT-DEL paid off

I thought I had tried that already, but was on someone else's VMware session and it did not appear to work.

I just tried it at home and it seems to work. Will try it again at work tomorrow on my own system.

Cheers


LonkeroAdministrator
(KiX Master Guru)
2004-12-15 08:47 AM
Re: MX Record lookup help

hmm...
dunno what MX record has to do with server being on or off...


NTDOCAdministrator
(KiX Master)
2004-12-15 09:38 PM
Re: MX Record lookup help

An application that supports it (Exchange Server) will query the MX records and test that the remote system is responding, if so it will send the e-mail. If not responding it will check the next available server in the list and so on until it either finds a server responding or not.

As an example, these servers all handle e-mail for you.

10 smtp.Gwspikval.Com
30 smtp.inet.fi
20 smtp.tele.fi

1st try goes to smtp.Gwspikval.Com
2nd try goes to smtp.tele.fi
3rd try goes to smtp.inet.fi


NTDOCAdministrator
(KiX Master)
2004-12-15 09:39 PM
Re: MX Record lookup help

Al,

Yes it does work. Thanks. Now I'll have to write up some code to emulate the checking of the remote systems based upon the returned data.


terron
(Fresh Scripter)
2004-12-16 07:30 AM
Re: MX Record lookup help

i always wondered how you could 'set type=mx' from a prompt. Al Po, you're my internet hero :>

AllenAdministrator
(KiX Supporter)
2004-12-16 08:16 AM
Re: MX Record lookup help

Quote:

you're my internet hero




aw shucks



Richard H.Administrator
(KiX Supporter)
2004-12-16 10:29 AM
Re: MX Record lookup help

You can also use redirection.

For simple queries:
Code:
echo ls sgb.co.uk | nslookup



For multi-line queries, write the lines to a file and redirect it in:
Code:
nslookup < ns_lookup_commands.txt



NTDOCAdministrator
(KiX Master)
2004-12-16 10:44 AM
Re: MX Record lookup help

You have any tips for the Telnet portion Richard?

So far in my testing the errorcode level is the same if it can or can not connect to the remote server. So for now I'm using PING for the connection test, but want/need to use telnet for the test. Not sure how to complete a connection and send it a quit command and then check the errorlevel code.


Richard H.Administrator
(KiX Supporter)
2004-12-16 11:28 AM
Re: MX Record lookup help

The most obvious answer would be to use WScript.Shell and the .Exec method to start a telnet process.

Use the StdIn property to send commands, and StdOut to get results.

If I get a chance I'll write a wrapper for this, as it could be quite useful for general "send/expect" tasks. It'll be a little while though as I'm just back from a business trip to Prague and will need to catch up on paperwork.


Howard Bullock
(KiX Supporter)
2004-12-16 01:21 PM
Re: MX Record lookup help

Or http://home.comcast.net/~habullock/habobjects.htm


Bryce
(KiX Supporter)
2004-12-16 02:55 PM
Re: MX Record lookup help

well... kixform's is working on gettings its socket support working....

NTDOCAdministrator
(KiX Master)
2004-12-16 10:02 PM
Re: MX Record lookup help

Richard
hmmm... Well then I see this as a reason to request functionality to an upcoming new version of KiXtart.

Howard
Thanks for the idea of your HABobjects.DLL but for what I really wanted it for it really has to be something that is either native to KiXtart or native to 2000/XP.

I guess for now I'll just manually input my mail server address and wait for KiXtart to support such a feature, or perhaps look further into WSH as Richard suggests.


NTDOCAdministrator
(KiX Master)
2004-12-17 02:23 AM
Re: MX Record lookup help

Well not pretty and not a best practice but it works.

Al_Po wrote this little tid-bit up and we cleaned it up a little for presentation until such time as there is a better method.

Code:
If MailServerUp($Server)

? 'System is responding'
Else
? 'System did not respond'
EndIf

Function MailServerUp($mailserver)
Dim $output,$,$fh,$line,$path
$output='%temp%\output.txt'
If Exist($output)
Del $output
EndIf
Run '%comspec% /c telnet -f ' + $output + ' ' + $mailserver + ' 25'
Sleep 2
$=EndProc('telnet.exe')
Sleep 1
$fh=FreeFileHandle()
If Open($fh,$output)=0
$line=ReadLine($fh)
While @ERROR=0
If Left($line,3)=220
$MailServerUp=1
EndIf
$line=ReadLine($fh)
Loop
$=Close($fh)
EndIf
If Exist($output)
Del $output
EndIf
EndFunction

Function EndProc($proc, optional $strComputer)
DIM $Process
If $strComputer=''
$strComputer='.'
EndIf
For Each $Process In GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $strComputer +
"\root\cimv2").ExecQuery("Select * from Win32_Process where Name= " +'"'+$Proc+'"')
$Process=$Process.Terminate
Next
EndFunction



AllenAdministrator
(KiX Supporter)
2004-12-17 05:27 AM
Re: MX Record lookup help

All I can say is, I warned DOC it wasn't going to be pretty.

LonkeroAdministrator
(KiX Master Guru)
2004-12-17 01:03 PM
Re: MX Record lookup help

doc...
thinking about that telnet shit...

you could use sendmail() udf.
only problem is, it will flash on your screen but at least it requires no installation


NTDOCAdministrator
(KiX Master)
2004-12-17 07:02 PM
Re: MX Record lookup help

I'm actually using BLAT for sending the e-mail. I was just wanting the application to send the e-mail correctly like a full fledged mail application does. The application checks to make sure there is a response from the SMTP server, if not it then checks the next and so on.

For my production script I won't bother, I'll plug in the actual name of the main SMTP mail server. I just thought it was an interesting [thinking outside the box] method of how Al accomplished the check.

I'll clean up the script and post an example. Hopefully maybe Ruud will consider some type of socket support so that we could perform this and other types of TCPIP tasks.


LonkeroAdministrator
(KiX Master Guru)
2004-12-17 07:10 PM
Re: MX Record lookup help

well, no client will do MX checks, that's for sure.
blat is kinda not a email client as it goes directly to smtp layer.
and one using a tool that goes there, should at least have minor understanding what that means.
really.


NTDOCAdministrator
(KiX Master)
2004-12-17 11:19 PM
Re: MX Record lookup help

You're correct in that, most PC clients don't, but they should.

Here is a brief discussion on this subjec from 2002

Redundant Mail Relays with Pine, Eudora and Outlook
http://www.nber.org/redundant.html


If you're really bored and want to do more reading here are further links of information on the subject.

Windows applications appear to be the ones that don't follow the rules as there intended for this subject.

Delivering mail to user AT domain.com
http://www.han.com/dns.html

Simple Mail Transfer Protocol (SMTP)
http://www.auggy.mlnet.com/ibm/3376c46.html#smtpdom

MX, Mail Exchange Records
http://www.domainavenue.com/mx.htm

How do I configure and test the MX Record for my Internet Domain name?
http://www.petri.co.il/configure_mx_records_for_incoming_smtp_email_traffic.htm


NTDOCAdministrator
(KiX Master)
2004-12-17 11:42 PM
Re: MX Record lookup help

Okay, here is a Sample Script for demonstration purposes ONLY! It is not and should not be considered useful for any Production Environment. It is only a concept of how something like this could be used.

I've only posted the code here for those that "might" have been interested in the final script usage.

Currently KiXtart does not natively support a valid method of scripting a TELNET session.

1. Script runs MXRecordLookup to find list of all available SMTP mail servers
2. Script gets the current IP of the workstation during logon.
3. Script gets Antivirus information
[in real life would only send mail if some condition like old definitions found were met]
4. Script checks if highest priority server is available, if not it checks for the next one in the list.
5. Once first available server is found it sends the e-mail via BLAT to that server

Code:
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')
$SO=SetConsole('hide')

Dim $CurrentIP,$NAVInfo,$MailerID,$MailerSubject,$MailerBody,$MailerAlert,$Record,$counter,$MailServer
Global $MailerServer
$Record=MXRecordLookup('somesmtpmailserver.com','somednsserver.com')
$CurrentIP=GetCurrentIP()
$NAVInfo=GetNavAntiVirusInfo()
$MailerID='"'+Join(Split(@Fullname,','),'')+'<'+@UserID+'@@somecompany.com>'+'"'
$MailerSubject='"KAM: Old Definitions "'
$MailerBody='"Please check antivirus definitions ' + @CRLF +
'Definitions dated: ' + $NAVInfo[1] + @CRLF +
'AV Engine: ' + $NAVInfo[0] + @CRLF +
'Computer Name: ' + @WKSTA + @CRLF +
'Current IP: ' + $CurrentIP + @CRLF +
'NIC address: ' + @Address + @CRLF +
'Domain: ' + @DOMAIN + @CRLF +
'User ID: ' + @USERID + @CRLF +
'User Name: ' + @Fullname +'"'

While $counter<= UBound($Record) And $MailerServer=""
If MailServerUp($Record[$counter])
$MailerServer=$Record[$counter]
$MailerAlert=BlatMailerAlert('some.administrator@@somecompany.com',$MailerID,$MailerSubject,$MailerBody)
EndIf
$counter=$counter+1
Loop
If $MailerServer=""
? 'Unable to connect to any server'
EndIf

Function BlatMailerAlert($Recipient,$Sender,$Subject,$Body,optional $Attachment)
Dim $SMTPServer,$MailerLine
$SMTPServer=$MailerServer
$MailerLine=@LDrive+'\blat.exe -' + ' -to ' + $Recipient + ' -f ' + $Sender + ' -subject ' + $Subject + ' -body ' + $Body +
' -server ' + $SMTPServer + ' -q '
Shell $MailerLine
EndFunction

Function MXRecordLookup($ComputerToFind,optional $Server)
Dim $mxrecords[0],$MX,$Line,$Counter,$record,$c
$MX=WshPipe("nslookup -q=mx " + $ComputerToFind + " " + $Server,1)
For Each $Line in $MX
If InStr($Line,"MX preference")
ReDim PreServe $mxrecords[$Counter]
$mxrecords[$Counter]="" + Trim(Split(Split($Line,",")[0],"=")[1]) + ":" + Trim(Split(Split($line,",")[1],"=")[1])
$Counter = $Counter + 1
EndIf
Next
$MXRecords=QS($mxrecords)
For each $record in $mxrecords
$MXRecords[$c]=split($record,":")[1]
$c=$c+1
Next
$MXRecordLookup=$MXRecords
EndFunction

Function QS($a)
DIM $b[32],$c[32],$d,$e,$f,$g,$h,$i,$j,$k,$l
$b[0]=0
$c[0]=UBOUND($a)
$d=0
While $d >=0
$e=$b[$d]
$f=$c[$d]
While $e < $f
$h=$e+($f-$e)/2
$k=$a[$e]
$A[$e]=$A[$h]
$A[$h]=$k
$i=$e+1
$j=$f
$l=0
Do
While ($i<$j) AND $A[$e] > $A[$i]
$i=$i+1
Loop
While ($j>=$i) AND $A[$j] > $A[$e]
$j=$j-1
Loop
IF $i>=$j
$l=1
ELSE
$k=$A[$i]
$A[$i]=$A[$j]
$A[$j]=$k
$j=$j-1
$i=$i+1
ENDIF
Until $l=1
$k=$a[$e]
$a[$e]=$a[$j]
$a[$j]=$k
$g=$j
If $g-$e <= $f - $g
If $g+1 < $f
$b[$d]=$g+1
$c[$d]=$f
$d=$d+1
Endif
$f=$g-1
Else
If $g-1 > $e
$b[$d]=$e
$c[$d]=$g-1
$d=$d+1
Endif
$e=$g+1
Endif
Loop
$d=$d-1
Loop
$qs=$a
EndFunction

Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho $Output Endif
$WshPipe=Split(Join(Split($Output,CHR(13)),''),CHR(10))
Exit($oExec.ExitCode)
EndFunction

Function MailServerUp($mailserver)
Dim $output,$,$fh,$line,$path
$output='%temp%\output.txt'
If Exist($output)
Del $output
EndIf
Run '%comspec% /c telnet -f ' + $output + ' ' + $mailserver + ' 25'
Sleep 2
$=EndProc('telnet.exe')
Sleep 1
$fh=FreeFileHandle()
If Open($fh,$output)=0
$line=ReadLine($fh)
While @ERROR=0
If Left($line,3)=220
$MailServerUp=1
EndIf
$line=ReadLine($fh)
Loop
$=Close($fh)
EndIf
If Exist($output)
Del $output
EndIf
EndFunction

Function EndProc($proc, optional $strComputer)
DIM $Process
If $strComputer=''
$strComputer='.'
EndIf
For Each $Process In GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $strComputer +
"\root\cimv2").ExecQuery("Select * from Win32_Process where Name= " +'"'+$Proc+'"')
$Process=$Process.Terminate
Next
EndFunction

Function GetCurrentIP()
Dim $TempFile, $Line, $cf
$TempFile = '%TEMP%\PING.TXT'
If Exist($TempFile)
Del $TempFile
EndIf
Shell '%COMSPEC% /C PING -n 1 ' + @WKSTA + '>'+$TempFile
If open(1, $TempFile) = 0
$Line = ReadLine(1)
While @ERROR = 0
If InStr($Line,@WKSTA)
$Line = SubStr($Line,InStr($Line,"[")+1)
$GetCurrentIP = SubStr($Line,1,InStr($Line,"]")-1)
EndIf
$Line = ReadLine(1)
Loop
$cf = Close(1)
EndIf
If Exist($TempFile)
Del $TempFile
EndIf
EndFunction

Function GetNavAntiVirusInfo(optional $wksta,optional $DateCheck,optional $WarnOldDef,optional $WarnNoNav)
Dim $Defdate,$CurDef,$NAVHome,$NavExecutable,$NavParent,$OldDefs,$AlertOldDef,$NAVPath
Dim $ClientType,$ReadClientType,$RegPath,$FilePath,$CurWksta,$NAVInfoArray[9]
Dim $AlertNoNAV,$NoNavWarn,$NoNavMsg,$Notify
$CurWksta = @WKSTA
If $wksta = "" $wksta = @WKSTA EndIf
If $wksta = $CurWksta $RegPath = "" Else $RegPath = '\\'+$wksta+'\' EndIf
If $wksta = $CurWksta $FilePath = "" Else $FilePath = '\\'+$wksta+'\c$' EndIf
If $DateCheck = "" $DateCheck = 14 EndIf
$ReadClientType = ReadValue($RegPath+'HKLM\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion', 'ClientType')
$Defdate = Left(Right(ReadValue($RegPath+'HKLM\SOFTWARE\Symantec\SharedDefs','NAVCORP_70'),12),8)
$Defdate = Left($Defdate,4) + '/' + SubStr($Defdate,5,2) + '/' + Right($Defdate,2)
$CurDef = DateCalc(@DATE, $Defdate)
$NoNavWarn = ExistKey($RegPath+'HKLM\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion\Quarantine')
$NoNavMsg = 'Unable to locate the Symantec/Norton AntiVirus program on this system. '+'[ '+$wksta+' ]'
$NoNavMsg = $NoNavMsg+@CRLF+'Please contact the Helpdesk to have the program installed Or checked For problems '
$NoNavMsg = $NoNavMsg+'with a previous installation.'
$NoNavMsg = $NoNavMsg+@CRLF+@CRLF+'Helpdesk x555-1212'
If $NoNavWarn <> 0
If $WarnNoNav <> 1
$AlertNoNAV = MessageBox($NoNavMsg,'AntiVirus Program Update', 16,)
EndIf
EndIf
$NAVHome = ReadValue($RegPath+'HKLM\software\INTEL\LANDesk\VirusProtect6\CurrentVersion\', 'Home Directory')
$NAVPath = $NAVHome
If $wksta <> $CurWksta
$NAVPath = SubStr($NAVHome,3,)
$NAVPath = $FilePath+$NAVPath
EndIf
$NavExecutable = GetFileVersion($NAVPath +'\vpc32.exe','ProductVersion')
$NavParent = ReadValue($RegPath+'HKLM\SOFTWARE\Intel\LANDesk\VirusProtect6\CurrentVersion','Parent')
Select
Case $ReadClientType = 1 $ClientType = 'Connected Client'
Case $ReadClientType = 2 $ClientType = 'Stand-alone Client'
Case $ReadClientType = 4 $ClientType = 'Server'
If $NavParent = ""
$ClientType = 'Primary Server'
EndIf
Case $ReadClientType = "" $ClientType = 'Unknown'
EndSelect
$OldDefs = 'Warning: Your ANTI-VIRUS definition files are dated '
$OldDefs = $OldDefs +$Defdate+' which makes them '+$CurDef +' days old.'
$OldDefs = $OldDefs +@CRLF+@CRLF+'Your system '+'[ '+$wksta+' ]'+' is vulnerable to recent worms Or viruses.'
$OldDefs = $OldDefs +@CRLF+@CRLF+'Please contact the Helpdesk to help determine why your system '
$OldDefs = $OldDefs +'is Not automatically updating.'
$OldDefs = $OldDefs +@CRLF+@CRLF+'Helpdesk x555-1212 '
$OldDefs = $OldDefs +@CRLF+@CRLF+'Antivirus Engine version: '+$NavExecutable
$OldDefs = $OldDefs +@CRLF+'Antivirus Definition date: '+$Defdate
$OldDefs = $OldDefs +@CRLF+'Age of Definition Files: '+$CurDef
$OldDefs = $OldDefs +@CRLF+'Antivirus Parent Server: '+$NavParent
$OldDefs = $OldDefs +@CRLF+'Antivirus Client Type: '+$ClientType
$OldDefs = $OldDefs +@CRLF+'Antivirus Installation Folder: '+$NAVHome
If $CurDef > $DateCheck
$Notify = 2
If $WarnOldDef <> 1
$AlertOldDef = MessageBox($OldDefs,'AntiVirus - Old Definitions', 48,)
EndIf
EndIf
$NAVInfoArray[0]=$NavExecutable
$NAVInfoArray[1]=$Defdate
$NAVInfoArray[2]=$NavParent
$NAVInfoArray[3]=$ClientType
$NAVInfoArray[4]=$NAVHome
$NAVInfoArray[5]=$wksta
$NAVInfoArray[6]=$NoNavWarn
$NAVInfoArray[7]=$Notify
$NAVInfoArray[8]=$CurDef
$GetNavAntiVirusInfo=$NAVInfoArray
EndFunction

Function DateCalc($date1, $DateOrMod)
Dim $_intDate1, $_intYear1, $_intMonth1, $_intDay1
Dim $_intDate2, $_intYear2, $_intMonth2, $_intDay2
If InStr ($date1,'/') <> 5
Or InStrRev ($date1,'/') <> 8
Or Len ($date1) <> 10
Exit (1)
EndIf
$_intYear1 = Val(SubStr($date1,1,4))
$_intMonth1 = Val(SubStr($date1,InStr($date1,'/')+1,2))
$_intDay1 = Val(SubStr($date1,InStrRev($date1,'/')+1,2))
If $_intMonth1 < 3
$_intMonth1 = $_intMonth1 + 12
$_intYear1 = $_intYear1 - 1
EndIf
$_intDate1 = $_intDay1 + ( 153 * $_intMonth1 - 457 ) / 5 + 365 * $_intYear1 +
$_intYear1 / 4 - $_intYear1 / 100 + $_intYear1 / 400 - 306
Select
Case VarType($DateOrMod) = 3
$_intDate2 = $_intDate1 + $DateOrMod
If InStr($_intDate2,'-') $_intDate2 = Val(SubStr($_intDate2,2,Len($_intDate2)-1)) EndIf
$_intYear2 = ( 100 * ( ( ( 100*($_intDate2+306)-25)/3652425)
- ( ((100*($_intDate2+306)-25)/3652425)/4)
) + (100*($_intDate2+306)-25)
) / 36525
$_intMonth2 = ( 5 * ( ( ( 100*($_intDate2+306)-25)/3652425)
- ( ((100*($_intDate2+306)-25)/3652425)/4)
+ ($_intDate2+306) - 365 * $_intYear2 - $_intYear2 / 4
) + 456
) / 153
$_intDay2 = ( ( ( 100*($_intDate2+306)-25)/3652425)
- ( ((100*($_intDate2+306)-25)/3652425)/4)
+ ($_intDate2+306) - 365 * $_intYear2 - $_intYear2 / 4
) - ( 153 * $_intMonth2 - 457
) / 5
If $_intMonth2 > 12 $_intYear2 = $_intYear2 + 1 $_intMonth2 = $_intMonth2 - 12 EndIf
If Len($_intYear2 ) < 4
$_ = Execute("For $i=1 to 4-Len($$_intYear2) $$_intYear2 = '0' + $$_intYear2 Next")
EndIf
If Len($_intMonth2) < 2 $_intMonth2 = "0$_intMonth2" EndIf
If Len($_intDay2 ) < 2 $_intDay2 = "0$_intDay2" EndIf
$DateCalc = '$_intYear2/$_intMonth2/$_intDay2'
Case VarType($DateOrMod) = 8
If InStr ($DateOrMod,'/') <> 5
Or InStrRev ($DateOrMod,'/') <> 8
Or Len ($DateOrMod) <> 10
Exit (1)
EndIf
$_intYear2 = Val(SubStr($DateOrMod,1,4))
$_intMonth2 = Val(SubStr($DateOrMod,InStr($DateOrMod,'/')+1,2))
$_intDay2 = Val(SubStr($DateOrMod,InStrRev($DateOrMod,'/')+1,2))
If $_intMonth2 < 3
$_intMonth2 = $_intMonth2 + 12
$_intYear2 = $_intYear2 - 1
EndIf
$_intDate2 = $_intDay2 + ( 153 * $_intMonth2 - 457 ) / 5 + 365 * $_intYear2 +
$_intYear2 / 4 - $_intYear2 / 100 + $_intYear2 / 400 - 306

$DateCalc = $_intDate1 - $_intDate2
;comment the Next line If you wish to return negative results also !!!
If InStr($DateCalc,'-') $DateCalc = Val(SubStr($DateCalc,2,Len($DateCalc)-1)) EndIf
Case 1
Exit (1)
EndSelect
EndFunction





AllenAdministrator
(KiX Supporter)
2004-12-18 07:54 AM
Re: MX Record lookup help

Richard, I'm definately interested in seeing if you can create a wrapper for telnet. For one, it would make Docs script cleaner. But also, I'm interested in learning how the stdin and stdout works, as I've never gotten my hands around it, or found any scripting documentation that broke it down to a beginners level.

LonkeroAdministrator
(KiX Master Guru)
2004-12-18 11:40 AM
Re: MX Record lookup help

hmm...
wonder how that wrapper would be...
might be that it's just a dublicate of what's in hoby's admin dll.


LonkeroAdministrator
(KiX Master Guru)
2004-12-18 12:06 PM
Re: MX Record lookup help

and doc...
like just last night discussed about this subject and strickly laid out:
no client needs to be aware of SMTP or the dns records.
to start, SMTP is server to server. clients, stay out of it. period.


Les
(KiX Master)
2004-12-18 05:06 PM
Re: MX Record lookup help

Well... there is another DLL add-on at http://tech.dimac.net/ that was discussed on kforg...
http://www.kixforms.org/forum/viewtopic.php?t=746


NTDOCAdministrator
(KiX Master)
2004-12-18 08:47 PM
Re: MX Record lookup help

Les,

Not sure what you're thinking of lately as you keep referencing 3rd party apps.

For this case I think it down to just a theoritical discussion on how one could do it with scripting VB script.

As for the use of sockets, the download you link to is 86k in size. I'm sure that if that is all the size it takes then Ruud could probably build that into KiX for about half that size as a lot of the overhead is taken up by creation process of making the EXE anyways.

I know you know, put to point out again. How often do we respond to posts asking HOW CAN I INSTALL THIS AS AN ADMIN which is the sort of thing that is needed if you use KF or other 3rd party DLL files, including Howards (which works great by the way).

I'm not looking to install anything on 2,000 desktops I just want to be able to run KiXtart to perform these tasks. If Ruud comes back and says its a NO GO then okay I'll do with out it, or do some other work-around if I really have to have it.


Les
(KiX Master)
2004-12-18 09:00 PM
Re: MX Record lookup help

Quote:

Not sure what you're thinking of lately as you keep referencing 3rd party apps.



What are you insinuating, that I am not a KiX purist... that I am some sort of 3rd part whore? That I am adulterating the KiX cause?

All I am saying is that KiX need not be a Swiss Army Knife with every conceivable tool in its arsenal... that KiX has its roots as a light weight logon script processor. Don't bloat it with all the functionality that few would use.

Why are you doing all this in a logon script anyway? You want to turn every PC into an email server now? That sort of thing would be better to do in an admin script.

There is an old saying that when you are a hammer, everything looks like a nail. Well... you are a KiX sledgehammer.


LonkeroAdministrator
(KiX Master Guru)
2004-12-18 09:33 PM
Re: MX Record lookup help

actually, kixtart is already a swizz knive.
and adding sockets to it, would not bloat it.
going forward and adding highlevel protocol support would be bloating.
just like console control, say, COLOR or BOX.


ShawnAdministrator
(KiX Supporter)
2004-12-18 09:39 PM
Re: MX Record lookup help

I think Ruud should come-out with a .net version of Kix (or a version of Kix that can be used with .net (subtle diff)), keep the legacy support ... then all this talk about what should and shouldn't go into Kix will be a mute point ... EVERYTHING will be available from Kix.

-Shawn


LonkeroAdministrator
(KiX Master Guru)
2004-12-18 09:43 PM
Re: MX Record lookup help

no, that would be bloating.
we have vbs for .net laming.


NTDOCAdministrator
(KiX Master)
2004-12-19 03:11 AM
Re: MX Record lookup help

Les, I think you were missing the point. It is nothing to do with this post about MX records. That discussion is pretty much over as far as I'm concerned.

Actually I'm probably more along the lines of thinking of Shawn and with some previous discussions.

Maybe it is time for Ruud to think of having 2 flavors. KiXtart v4.22 (stop further development and only fix confirmed bugs) Then have a newer KiXtart version that is geared more towards fuller features. Come on lets be real here, a lot of what we're doing with KiX these days is not logon related as much as it is Remote Admin work that could be improved by the addition of new features that would sort of slow or stop people from using it as a logon script except maybe in areas where they have high bandwidth to all desktops.

I think the main discussion about MX records has died unless Richard comes back with example of a wrapper to show.

For further discussion on the advancement of KiX lets please start a new thread in General or in Suggestion forum.


Chris S.
(MM club member)
2004-12-20 05:42 PM
Re: MX Record lookup help

Quote:

I think Ruud should come-out with a .net version of Kix (or a version of Kix that can be used with .net (subtle diff)), keep the legacy support ... then all this talk about what should and shouldn't go into Kix will be a mute point ... EVERYTHING will be available from Kix.




Love your idea, Shawn.

Pet peeve time. It's moot not mute. Other than that, I think you're a genius.


Les
(KiX Master)
2004-12-20 05:51 PM
Re: MX Record lookup help

Quote:

Pet peeve time. It's moot not mute. Other than that, I think you're a genius.



Dang... That is a topic that is best left alone otherwise all the other abuses of the English language will also have to be mentioned.

you're/your
then/than
separate not seperate

the list can go on and on...


Co
(MM club member)
2004-12-20 08:49 PM
Re: MX Record lookup help

I'm always glad to know people for whom english is there native language also make mistakes...
I know my English isn't the best(At school I hated it to learn foreign languages ) but because other people are making mistakes too I'm not afraid to make them by myself...


As long as I don't make typical Dutch English translation faults like:

ondernemer -> undertaker while I mean an entrepreneur
onder = under , nemen = take

They call it Dunglish

Some Dunglishisms you may come across...

Welcome 'in' (should be 'to') Holland
To 'learn' a student (the Dutch word 'leren' means 'to teach' as well as 'to learn')
'Life' music instead of 'Live' Music
Menu: Choice of eggs 'of' chickens - where is the choice? ('of' is the Dutch word for 'or')
'That can': Dunglish for 'that is possible'
In Dunglish, you hear 'according to me' over and over: in English it is better to say 'I think' or 'in my opinion' (and not as often!). Linked to this, people often want to give their 'meaning' (they mean 'opinion' - but get confused with the Dutch 'mening'). In Holland you're entitled to have an opinion, but in other cultures you may not be!

http://www.gcw.nl/wispr/w983301.htm
http://www.shels.nl/nederlands/2.html
http://www.coolabah.com/oz/holland/index17.cfm


Co
(MM club member)
2004-12-20 09:33 PM
Re: MX Record lookup help

Oeps...


"...When PhD student Julia Wright was told by a Molenstraat cinema attendant that the movie would begin at 'half eight,' she arrived on time only to find that she was an hour late. In English, half eight means 8:30, but in Dunglish it means 7:30, because of the direct translation from Dutch..."

Once I have told a nice girl from Australia that I was thirtytwo years old while I meant 23 years old (23 = in dutch drie-en-twintig).... She didn't believed me, she wanted to see my passport


LonkeroAdministrator
(KiX Master Guru)
2004-12-21 12:37 AM
Re: MX Record lookup help

hmm...
half eight?
I understand half past eight being 8:30 but half eight sounds 7:30...
doesn't it have something also attached to it?
something like half to eight?


Co
(MM club member)
2004-12-21 12:53 AM
Re: MX Record lookup help

Yeah that is what they have told me at school...

Half acht = 7:30 = half to eight


Co
(MM club member)
2004-12-21 12:55 AM
Re: MX Record lookup help

Or is it a half past seven

Think I had to pay more attention at school...