Hello Everyone,
The following AutoIt script will allow you to add Domains to the safe sender list.
AutoIt Version: 3.3.0.0
Author: Outlook WhiteList - Max Albanese
Script Function:
Adds @domain1.net and @domain2.com to the Outlook Whitelist
#ce ----------------------------------------------------------------------------
AutoItSetOption("TrayIconHide",1)
#include
_FileWriteLog(@TempDir & "\outlwl.log","Starting Outlook Whitelist Script.",-1)
_FileWriteLog(@TempDir & "\outlwl.log","Checking Default EMail Profile.",-1)
$DefaultMailProf = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles","DefaultProfile")
If @error <> 0 Then
Select
Case @error = -1
_FileWriteLog(@TempDir & "\outlwl.log","Error: Unable to Open Requested Key." ,-1)
Case @error = 2
_FileWriteLog(@TempDir & "\outlwl.log","Error: Unable to Open Requested Main Key." ,-1)
Case @error = 3
_FileWriteLog(@TempDir & "\outlwl.log","Error: Unable to Remote Connect to the Registry." ,-1)
Case @error = --1
_FileWriteLog(@TempDir & "\outlwl.log","Error: Unable to Open Requested Value." ,-1)
Case @error = -2
_FileWriteLog(@TempDir & "\outlwl.log","Error: Value Type Not Supported" ,-1)
Case Else
_FileWriteLog(@TempDir & "\outlwl.log","Error: Unknown Remote Registry Error." ,-1)
EndSelect
_FileWriteLog(@TempDir & "\outlwl.log","Error: Exiting Script." ,-1)
Exit
EndIf
_FileWriteLog(@TempDir & "\outlwl.log","Default Profile: " & $DefaultMailProf ,-1)
_FileWriteLog(@TempDir & "\outlwl.log","Reading Existing WhiteList from the registry.",-1)
$var = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" & $DefaultMailProf & "\0a0d020000000000c000000000000046","001f0418")
$write = ""
_FileWriteLog(@TempDir & "\outlwl.log","Changing Whitelist from Binary to String.",-1)
$btost = BinaryToString($var,2)
_FileWriteLog(@TempDir & "\outlwl.log","Current WhiteList: " & $btost,-1)
_FileWriteLog(@TempDir & "\outlwl.log","Searching for items already in the whitelist.",-1)
_FileWriteLog(@TempDir & "\outlwl.log","Searching for @global.umusic.net",-1)
If StringInStr($btost,"@domain1.net",2,1) Then ;Change this line to your domain name you want to add
_FileWriteLog(@TempDir & "\outlwl.log","@domain1.net already found. Checking that it is domain whitelist.",-1)
$pos = 0
$pos = StringInStr($btost,"@domain1.net",2,1) ;Same here
If $pos = 1 Then
_FileWriteLog(@TempDir & "\outlwl.log","Verified Domain Whitelist @domain1.net",-1)
Else
If StringInStr($btost,";@domain1.net",2,1) Then
_FileWriteLog(@TempDir & "\outlwl.log","Verified Domain Whitelist @domain1.net",-1)
Else
$write = "@domain1.net;"
_FileWriteLog(@TempDir & "\outlwl.log","Not a domain entry but a single e-mail. Adding to write queue.",-1)
EndIf
EndIf
Else
$write = "@domain1.net;"
_FileWriteLog(@TempDir & "\outlwl.log","Entry not found. Adding to write queue.",-1)
EndIf
_FileWriteLog(@TempDir & "\outlwl.log","Searching for @domain2.com",-1)
If StringInStr($btost,"@domain2.com",2,1) Then
_FileWriteLog(@TempDir & "\outlwl.log","@domain2.com already found. Checking that it is domain whitelist.",-1)
$pos = 0
$pos = StringInStr($btost,"@domain2.com",2,1)
If $pos = 1 Then
_FileWriteLog(@TempDir & "\outlwl.log","Verified Domain Whitelist @domain2.com",-1)
Else
If StringInStr($btost,";@domain2.com",2,1) Then
_FileWriteLog(@TempDir & "\outlwl.log","Verified Domain Whitelist @domain2.com",-1)
Else
$write = $write & "@domain2.com;"
_FileWriteLog(@TempDir & "\outlwl.log","Not a domain entry but a single e-mail. Adding to write queue.",-1)
EndIf
EndIf
Else
$write = $write & "@domain2.com;"
_FileWriteLog(@TempDir & "\outlwl.log","Entry not found. Adding to write queue.",-1)
EndIf
If $write <> "" Then
$write = $write & $btost
_FileWriteLog(@TempDir & "\outlwl.log","Adding " & $write & " to the Whitelist.",-1)
_FileWriteLog(@TempDir & "\outlwl.log","Converting from String to Binary.",-1)
$sttob = StringToBinary($write,2)
$var = RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" & $DefaultMailProf & "\0a0d020000000000c000000000000046","001f0418","REG_BINARY",$sttob)
Else
_FileWriteLog(@TempDir & "\outlwl.log","Nothing to update. See above.",-1)
EndIf
_FileWriteLog(@TempDir & "\outlwl.log","Exiting Program. ",-1)
This will add the domains domain1.net and domain2.com to the whitelist. My only problem with this is that once the whitelist is updated it does not update to the server. That I am still trying to work out. This works on both Office 2003 and Office 2007.
Any ideas,
Max
MCSE,MCSA,MCSAM