You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Spam emails with generic address text

I am getting a lot of spam emails and, so far, I have blocked each sender individually. Many of these email addresses contain a common character string - is there a way to do a generic block? I've tried writing a rule (address contains "common string") but it doesn't seem to do anything.

MacBook Pro

Posted on Sep 20, 2022 10:21 AM

Reply
3 replies

Sep 24, 2022 8:43 AM in response to IanF65

Hello IanF65,


Thanks for posting in the Apple Support Communities!


It sounds like you're trying to set a filter within the Mail app to help identify and route the email to Trash, Archives, or a Spam folder, right?


If we understood that correctly, check out the following information to confirm the same settings are enabled for this to work. You'll want to confirm the default condition, and enable additional filter preferences if you'd like, then try this out. For more information on this, check out the article: Reduce junk mail in Mail on Mac - Apple Support


Change junk mail filter settings

The default settings catch most of the junk mail you receive, but you can customize the filter.

1. In the Mail app on your Mac, choose Mail > Preferences, then click Junk Mail.

2. Specify what Mail should do when junk mail arrives.

• If you want to verify what the filter identifies as junk mail, select “Mark as junk mail, but leave it in my Inbox.”

• If you’re sure the filter accurately identifies junk mail, select “Move it to the Junk mailbox.”

• To set up other actions, select “Perform custom actions,” then click Advanced.


Note: To make sure the filter’s database is used to identify junk mail, don’t change the default condition “Message is junk mail.”


3. Select options for exempting messages from being evaluated, such as messages received from people who use your full name.

4. To include in the filter any junk mail detection inherent in messages, select “Trust junk mail headers in messages.”


After confirming or making any adjustments, be sure to restart your MacBook Pro to confirm the filter remains and is working. Let us know if that helps.


Have a great day!

Sep 24, 2022 9:38 AM in response to IanF65

In Apple Mail, select a single message that you want to block. Then, in Mail > Preferences > Rules, either edit an existing rule or create a new one. You will see:


[ Any ]

[ From ] [ contains ] [ _____ ]


Click the From header entry and a long menu of choices appears. At the bottom of that menu, select Edit header list… and add Return-path in that exact spelling. It will now appear on that long menu like this:



The reason for adding this is that every email you receive comes from a Return-path server, regardless of what may be in the From header field. Some of these are owned by the sender, or they have one or more accounts on a commercial Mail server for the purposes of spam campaigns, or even legitimate email. Remember, I had you select one of these spam emails before commencing on a rule?


Here is an example Return-path mail header address where x's represent the actual Return-path server you want to block. The anonymous and foo may be your name and ISP Mail server:


Return-path: <SRS0=qpqud=z2=sg.xxxxxxxx.com=bounces+2575098-fc03-anonymous=foo.edu@foo.edu>


You now create a new rule entry. As soon as you enter contains, the entire Return-path header string shown above now populates the right-most field, and you use your arrow keys and backspace to edit that address down to just the principal server address as shown below. Notice I omitted that server's sub-domain (sg.).


[ Any ]

[ Return-path ] [ contains ] [ xxxxxxxx.com ]



When you click the OK button a dialog will appear offering to apply the rule to the previously selected spam message, and if you agree, it will move it to the Trash. All future emails from this source will automatically get sent to the Trash too.









Spam emails with generic address text

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