44

Is there a way to create a Gmail filter that sends the filtered items to the spam folder? There is an option to send it to a label, or to "Never send it to Spam" (which is ironic considering what I want to do).

I need this because I'm getting spam emails from a domain called libero.it, and Gmail's spam filter consistently fails to mark them as spam, even though I click "Report Spam" for each of them, so I want to create a filter to mark all messages from that domain as spam.

7 Answers 7

18

I don't believe gmail offers this exact request. Reason being, email marked as spam is used to identify spam globally (not just your account).

Instead you can just create a label called "myspam" or anything really.

  1. Create Filter
  2. From: libero.it
  3. Check [x] Apply the label enter image description here
  4. Click Choose label...
  5. Select New label
  6. Input myspam new label
  7. Click Create
4
  • 11
    While that gets the unwanted messages out of your face, as it were, it does nothing to train Gmail about spam messages. If you do this, you should occasionally open this label, mark all of the messages, and then report them as spam.
    – ale
    Commented Sep 12, 2013 at 12:40
  • 2
    Pretty bullshit Google has this "restriction". I ended up having to do the same, and I just go through now and then and mark them all spam and trash them from spam.
    – Urda
    Commented Oct 7, 2021 at 23:47
  • Not sure how this gets the message out of my view: even with the label, it will still show up in my Primary box, right? I need to send it to another category like Updates that I look at less often? As mentioned in other comments, this still needs to be combined with some automated or manual process to iterate over all emails marked "spam".
    – hsandt
    Commented Sep 6 at 13:03
  • @hsandt If you wanted to go this route, you could check the options to "Mark as read" and "Skip the inbox (archive it)" to get it out of your view. Or you could "Delete" without marking as spam.
    – evan
    Commented Oct 14 at 5:12
12

Sorry I'm late to the party, I found this old question when searching the same issue. Since you can't do it from filters, I wound up creating a Google App Script which does allow marking an email as spam automatically.

The basic gist of what you want to put into a function and schedule using a time driven trigger is:

var threads = GmailApp.search("[your search criteria] -is:spam");
for (var iThread = 0; iThread < threads.length; iThread++) {
   GmailApp.moveThreadToSpam(threads[iThread]);
}
8
  • This worked great for me. Just have to go to script.google.com/home, create an Apps Script, and set a trigger. Commented Dec 20, 2019 at 4:41
  • You now need to do GmailApp.moveThreadToSpam(threads[iThread]); No more need for an intermediate variable.
    – RJVB
    Commented May 6, 2020 at 14:02
  • Thank you @RJVB
    – evan
    Commented Dec 14, 2021 at 3:52
  • Thank you @kyrsquir
    – evan
    Commented Dec 14, 2021 at 3:52
  • GmailApp.moveThreadToSpam(threads[iThread]); can also be threads[iThread].moveToSpam(); as well.
    – Soulis
    Commented Aug 28 at 16:35
8

It doesn't look like this is currently possible.

You could always just create another, separate label and have it sent to there. Something like a Spam 2 label. Once the spam builds up in this label, you can select all and click Report Spam to send it all away at once.

Reference

4

It's possible to block a specific address, but not a whole domain. Here's how it can be done:

  1. Choose "Block ..." from the menu:

enter image description here

  1. Confirm to block:

enter image description here

1
  • Glad I found I can just block a sender! I've been reporting emails from the same sender as spam for weeks and Gmail never learned that these emails should automatically be sent to Spam.
    – Narvarth
    Commented Jul 17 at 19:09
0
  1. First create a search for your spam messages: I am spam you and can do nothing to stop me ruining your life on gmail

  2. Next, hit Create Filter: I am spam you and can do nothing to stop me ruining your life on gmail

  3. Now check Mark as read and Delete it, then hit Create Filter for the last time: I am spam you and can do nothing to stop me ruining your life on gmail

You will never see these emails anymore. They will just fill up your deleted email box for the next 30 days, until gmail clean them up.

0

Our organization uses Google Workspace and I wanted to clamp down on unsolicited vendor emails being sent from outside our organization. There isn't a way to do this through gmail directly but there is a way to restrict who can reach you through Google Admin. I'll just retrace my steps here.

  1. In Google Admin, go to Directory > Organizational units.
  2. In your list of units, create a sub-unit since you (I) don't want this to impact others.
  3. Go to Apps > Google Workspace > Gmail.
  4. Search the page for "Compliance" and open it, select your organizational unit in the section on the left, and look for "Restrict delivery" on the right. Select "Configure".
  5. If you have not already created a list, use the "Create or edit list" option, this will take you to a "manage address lists" page. Add an address list, and where it asks you for addresses it will accept a domain without the username@. Save the list.
  6. Back in Compliance, select "Use existing list" and add your list. Add a rejection message and be sure "Bypass this setting for internal messages" is checked and you are all set!

I will note, this approach is the opposite of what OP is asking for -- I want domains blocked by default and to only receive emails from domains I've explicitly approved of without this restriction impacting other users at our organization.

-6

You can select the delete option, creating a label.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.