Retrieve list of blocked senders on Mail for Mac

Hello,

I am trying to retrieve the list of blocked senders (those found in Mail -> Preferences -> Junk Mail -> Blocked).

Over the years, I have accumulated a very long list of spammers, domains, etc., but I cannot find a way to export this list.

I have also tried using SQLite in the command line, but I cannot find any corresponding table.

If anyone has an idea or a script, I would greatly appreciate it :)

Thank you in advance.

Best regards

MacBook Pro 16″, macOS 13.1

Posted on Feb 16, 2023 6:07 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 16, 2023 10:47 AM

I finally found :


Blocked senders are located in


~/Library/Preferences/com.apple.cmfsyncagent.plist 


wich is a binary plist


You can copy it somewhere else, and convert it to a readable XML, in Terminal :


cp ~/Library/Preferences/com.apple.cmfsyncagent.plist ~/Downloads/blockedsenders.plist

cd ~/Downloads

plutil -convert xml1 blockedsenders.plist


then it's easy to extract the list using an XML editor on using 'sed' in terminal.

Similar questions

10 replies
Question marked as Top-ranking reply

Feb 16, 2023 10:47 AM in response to Owl-53

I finally found :


Blocked senders are located in


~/Library/Preferences/com.apple.cmfsyncagent.plist 


wich is a binary plist


You can copy it somewhere else, and convert it to a readable XML, in Terminal :


cp ~/Library/Preferences/com.apple.cmfsyncagent.plist ~/Downloads/blockedsenders.plist

cd ~/Downloads

plutil -convert xml1 blockedsenders.plist


then it's easy to extract the list using an XML editor on using 'sed' in terminal.

Feb 20, 2023 11:25 AM in response to Hutchil

Hi Hutchil


Are you running Ventura as OS ?

If not, it may be somewhere else in the earlier versions, maybe with another name.


If you're actually running Ventura com.apple.cmfsyncagent.plist should be there, I checked on other Mac at the office.

You should see a looooong list of .plist files here. (see below)


If you can't see anything, maybe you have a restricted access to this directory.


Launch Terminal

an type "ls -lh ~/Library/Preferences/com.apple.cmfsyncagent.plist"

If it doesn't return anything then you likely have a problem.




Feb 20, 2023 6:21 AM in response to frédéric146

I found your solution of locating the referenced plist, then copy/XML conversion/etc. to appear to be very easy and straightforward. However, I hit a major obstacle at the very beginning - I cannot locate the referenced plist. I went to the /Library/Preferences directory and, it would appear, I am in the correct location from all of the other files; however, so com.apple.cmfsyncagent.plist file. I have also used the Finder search feature to look at that library and across my entire Mac. I have also manually scanned the com.apple files to see if there was something similar. I may have overlooked it, but it's very unlikely. Any suggestions as to why the file is not showing up? How did you locate it to begin with (perhaps I can replicate that method). Thanks in advance for any and all help.

Feb 20, 2023 11:30 AM in response to frédéric146

Thanks for replying again - it was my mistake, I went to Library, not ~/Library. Another user helped clarify my goof and I followed your solution - I'm working on a macro or script to parse the info easier rather than manually editing the subdomains on all of the entries. Like you I have a lot, including phone numbers that I've blocked due to spam texts. Anyway, thanks for a very on-point and succinct solution!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Retrieve list of blocked senders on Mail for Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.