Would you like images to download automatically in simulated phishing and notification emails sent by CyberLearn?
In this support article, we guide you through the allowlisting process that adds CyberLearn-managed domains to the Outlook Safelist Collection, ensuring images load automatically.
This also improves the accuracy of the email view metric in simulated phishing campaigns.
However, the email view metric is not essential for campaign success.
Therefore, this allowlisting step is entirely optional and can be added at your own discretion.
Prerequisites
Exchange Online PowerShell Module
Ensure the Exchange Online PowerShell module is installed. If not, install it with:
Install-Module -Name ExchangeOnlineManagement
Administrative Privileges
You must have the appropriate permissions to modify mailbox configurations across your organization.
Step 1: Connect to Exchange Online PowerShell
Open PowerShell with administrative privileges and connect to Exchange Online:
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName your_admin_account@yourdomain.com
Note: Replace
your_admin_account@yourdomain.comwith your actual admin username.
Step 2: Define the Domains to Add
Create an array containing the CyberLearn-managed domains you want to add to the Safe Senders list:
$domains = @(
"cyber-detector.com",
"app-cyberlearn.com",
"api.app-cyberlearn.com",
"veriffy-center.com",
"user-messagee.com",
"access-portall.com",
"delivery-statuss.com",
"document-serviice.com",
"security.cyber-detector.com"
)
These domains are used for simulated phishing and notification email delivery.
Step 3: Add Domains to All Mailboxes
Run the following script to add the specified domains to the Safe Senders list for every user mailbox:
# Fetch all user mailboxes once
$mailboxes = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited
# Add each domain to every mailbox
foreach ($domain in $domains) {
foreach ($mbx in $mailboxes) {
Set-MailboxJunkEmailConfiguration `
-Identity $mbx.Identity `
-TrustedSendersAndDomains @{ Add = $domain }
}
Write-Host "Added '$domain' to TrustedSendersAndDomains for all mailboxes."
Start-Sleep -Seconds 1
}
Explanation
Get-Mailbox -ResultSize Unlimited
Retrieves all user mailboxes in the tenant so they can be updated.
Outer foreach ($domain ...)
Loops through each domain in your $domains array.
Inner foreach ($mbx ...)
Loops through each mailbox and applies the Safe Sender entry.
Set-MailboxJunkEmailConfiguration
Updates junk email settings for the specified mailbox.
-TrustedSendersAndDomains @{ Add = $domain }
Adds the domain to the existing Safe Senders list without overwriting current entries.
step 4: Verify the Changes
To confirm that the domains have been added, check the Safe Senders list for a specific mailbox:
Get-MailboxJunkEmailConfiguration -Identity user@domain.com |
Select-Object -ExpandProperty TrustedSendersAndDomains
Note: Replace
user@domain.comwith the email address of a user in your organization.
Additional Notes
Processing Time
Depending on the number of mailboxes, this operation may take some time to complete and to fully reflect across Outlook clients.
Error Handling
If you encounter errors:
- Verify that your admin account has the required permissions.
- Double-check that all domain names in the
$domainsarray are correctly specified. - Ensure you are connected to Exchange Online (
Connect-ExchangeOnline) and that the session has not timed out.
Maintenance / Removing Domains Later
If you need to remove the domains at a later stage, you can modify the junk email configuration in a similar loop:
foreach ($mbx in $mailboxes) {
Set-MailboxJunkEmailConfiguration `
-Identity $mbx.Identity `
-TrustedSendersAndDomains @{ Remove = $domains }
}
This will remove all domains defined in the $domains array from the TrustedSendersAndDomains list for each mailbox.
