Skip to content

"ESA_SPAM_QUARANTINE_BLOCKLIST.ps1" is used to add "email address" or "domain name" into ESA SPAM QUARANTINE BLOCKLIST by calling the ESA API

License

Notifications You must be signed in to change notification settings

banhao/ESA_SPAM_QUARANTINE_BLOCKLIST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESA SPAM QUARANTINE BLOCKLIST

Minimum Supported PowerShell Version Cross Platform PowerShell Gallery Version PowerShell Gallery

"ESA_SPAM_QUARANTINE_BLOCKLIST.ps1" is used to add "email address" or "domain name" into ESA SPAM QUARANTINE BLOCKLIST by calling the ESA API

Initial configuration

$ESAUSERNAME = Read-Host "Please input the ESA Username"
$ESAPASSWORD = Read-Host -assecurestring "Please input the Password"
$ESACREDENTIAL = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($ESAUSERNAME+":"+$([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($ESAPASSWORD)))))
#$ESAUSERNAME = 'admin'
#$ESACREDENTIAL = ''
$ESAURL1 = 'https://esa1.yourcompanydomain.com:6443'
$ESAURL2 = 'https://esa2.yourcompanydomain.com:6443'

If you don't want to input the username and password every time. please comment the following 3 lines, and modify the "ESAUSERNAME" and "ESACREDENTIAL"

$ESAUSERNAME = Read-Host "Please input the ESA Username"
$ESAPASSWORD = Read-Host -assecurestring "Please input the Password"
$ESACREDENTIAL = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($ESAUSERNAME+":"+$([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($ESAPASSWORD)))))

Notice: I have 2 ESAs in cluster mode. So if you only have one ESA, you need change the command

$RAT_DomainList = $(ssh -i ~/.ssh/id_rsa_esa $ESAUSERNAME@$HOST1 "clustermode cluster; listenerconfig EDIT InboundMail RCPTACCESS PRINT" | %{ $_.Split(' ')[0];} | %{ $regex.match($_) }).value | Where-Object {$_}

to get the correct RAT list.

About

"ESA_SPAM_QUARANTINE_BLOCKLIST.ps1" is used to add "email address" or "domain name" into ESA SPAM QUARANTINE BLOCKLIST by calling the ESA API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published