How to resolve Junk email validation error

Copper Contributor

I'm attempting to add an email address to all users mailboxes using Set-mailboxJunkEmailConfiguration.
The command fails and returns an email address as the error (see below).

I've dumped the three lists contained in the record and the address displayed in the error isn't in any of them.  The lists are TrustedSendersAndDomains, TrustedRecipientsAndDomains, and BlockedSendersAndDomains.

The command I'm running is:
set-mailboxjunkemailconfiguration -identity email address removed for privacy reasons -TrustedSendersAndDomains @{Remove="email address removed for privacy reasons"}
The error returns:
Set-MailboxJunkEmailConfiguration: |Microsoft.Exchange.Data.Storage.JunkEmailValidationException|Junk email validation error. Value:
email address removed for privacy reasons.
Note: all email addresses have been changed. 
The error happens on a handful of accounts and the value is unique to each user.

This error happens on approx. 20 of 5100 mailboxes.

Any ideas?

8 Replies

@Vince1959 

I tried the commands below and it worked on my end. 

See screenshot below.

  • set-mailboxjunkemailconfiguration -identity email address removed for privacy reasons -TrustedSendersAndDomains @{Remove="email address removed for privacy reasons"}
  • RecepGencaslan_0-1675988972257.png

     

I went ahead and add the address to multiple mailbox safe senders list and I was able to remove the address from the list for multiple mailboxes using the command below. 

  • get-mailbox -ResultSize unlimited | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{remove="email address removed for privacy reasons"}

Please confirm if this helps. 

 

 

If I have answered your question, please mark your post as Solved

If you like my response, please give it a Like :smile:

Appreciate your Kudos! Proud to contribute! :)

 

@Deleted 
Thank you for your response.

I created a PowerShell script that processes all of the licensed mailboxes using a method similar to the one in your post.  The command completes successfully for all but 20 of the 5200 mailboxes.  I ran the commands as shown to reduce the time it takes for the script to complete.

My current working theory is that the Outlook application allows end users to add domain accounts to their mailboxes that PowerShell (and OWA) would block.  Since those entries exist the PowerShell command fails, even when its trying to remove the entries.  To test this theory I will grant myself access to the mailbox and remove the entries to determine if this clears up the issue.

Thanks again for your response!

@Vince1959 

Thank you for providing more information on your findings. 

I reproduced in my environment and added a domain-like account on Outlook client but it was blocked on OWA. Screenshot below shows the behavior (outlook client on the left and OWA on the right). 

  • RecepGencaslan_0-1676117068872.png

     

I checked further on PowerShell and I was unable to add the domain account. However, I was able to remove the domain account entry. See screenshot below showing the powershell output. 

  • RecepGencaslan_1-1676117745072.png

     

Kindly provide the status of your test. Is it possible to check through one of the affected account and see if that is the case? 

If I have answered your question, please mark your post as Solved

If you like my response, please give it a Like :smile:

Appreciate your Kudos! Proud to contribute!

 

This issue occurs because the Exchange server cannot validate the email addresses in the trusted senders list when the server tries to manage the junk email rules that are stored in the mailbox.
REGARDS : thedrivingtutors









@Vince1959 

 

Hi,

 

The error message you're encountering, "Junk email validation error," suggests that there is an issue with the email address you're trying to add to the TrustedSendersAndDomains list. This may be due to a number of reasons, including:

  1. Invalid email address format: Make sure that the email address is entered in a valid format.

    Mark_Albin_0-1676251587759.png

     

  2. Email address not found: Verify that the email address exists and is in use.

  3. Address already in the list: Check if the email address is already in the TrustedSendersAndDomains list and remove it if necessary.

  4. Permission issues: Ensure that you have the appropriate permissions to modify the mailbox's junk email configuration.

You can try to resolve the issue by checking these possible causes and updating the email address or your permissions as needed.

 

(external link removed by moderator)

I've done some digging into the data and I think there are 3 issues that could be making this happen.
1. New users have accounts and mailboxes but the TrustedSendersAndDomains data element isn't created until the mailbox is opened for the first time.
2. Some of the users throwing errors have multiple domain entries in their TrustedSendersAndDomains. I think I can parse them into an object I can pass to test the remove process.
3. Some of the users have large lists. I found serval sites that said the limit is 1024 items.

Since the errors represent less than 1% of the users management has decided they can live with the errors and completing error correctio for this project has been moved to the back burner.

Thanks again for the help!
To answer your questions:
1. I had approximately 5200 accounts an only receive errors on 13-15
2. I'm adding an address, idk how this applies
3. I check the Safe Sanders list for the address and only add it if doesn't exist.
4. The account I'm testing with has Global Administrator permissions

Thankyou for the help!

This issue occurs because the Exchange server cannot validate the email addresses in the trusted senders list when the server tries to manage the junk email rules that are stored in the mailbox.
regards : [link removed by admin]