42

I want to create a filter for all email sent by me only to me.

I do that because when I have a note that I want to remember, I send it to myself. I want to label all those notes so I can find them easily.

15 Answers 15

26

To search for email sent only to you and not to a mailing list, for example, you have to add the following to the search box (and then you can create a filter using that search; there is a link in the expanded search box that says "Create filter >>" or something):

To:me AND -*

This means it'll search for email sent to "me" (that's you) and not to everybody else (including you) (that's *), but the first part (i.e., To:me) overrides that.

5

This new answer works if one of the other recipients has a top level domain that is common-ish and different from yours.

Aaron's answer appears not to work, for two reasons. The first is that google does not implement wild cards in gmail (Wildcard search in Gmail). The second reason is that, from experience, I find the search considers BOTH conjuncts, to:me and, say, -to:com. It's easy to check by entering to:me -to:com in the search bar, and finding that nothing sent to your gmail.com address is there.

From the question I linked above we know that you need to search tokens; e.g., top level domains like .com and .org. But we know we can't just do

to:me to:(-com -org -edu -gov -uk -net -ca -de -jp -fr -au -us -ru -ch -it -nl -se -no -es -mil)

As an aside, don't try and putting ALL top level domains in, as the search will be rejected for length. I got the above list from This blog post about common TLDs.

There is one more thing to deal with, and that is the empty to: field. My work around is to use is:important to limit the intrusion of these. Gmail complained when I tried to make a filter with this flag, but it did properly filter a new (important) email to me.

So, we come to my answer, where my own top level domains are .com and .uk (.ac.uk, but the .uk is a token in itself):

is:important to:((-com OR me) -coop -org -edu -gov (-uk OR me) -net -ca -de -jp -fr -au -us -ru -ch -it -nl -se -no -es -mil)

This enforces the following two properties: 1. Emails to anyone with a listed domain different from yours are rejected 2. If an email has one of your domains, it must be (at least) to you.

In a similar manner, you can add specific email addresses that you commonly receive email together with you by adding something like -<coworker@yourdomain.com>

4

In the To field, use me -*. This could also be broken out in the other fields with to:me to:-*.

Here's a thread on Google's help forum..

  • Do you have a link to documentation of this feature by any chance? – Senseful Aug 2 '10 at 22:58
  • @Senseful, Unfortunately I don't. It is just something I tried. I did some searching and found a link that is somewhat helpful. Edited my post to include it. – Rebecca Chernoff Aug 2 '10 at 23:32
  • 1
    I get the to:me part, but it doesn't seem like the -* part does anything (i.e. I get the same results with and without it). Does it show different results for you? – Senseful Aug 2 '10 at 23:40
  • I believe the second example should be to:me -to:*. However, the search doesn't seem to exclude messages sent to a list of addresses. – dgw Aug 3 '10 at 0:02
  • to:me to:-* and to:me -to:* seem to give me the same results. – Rebecca Chernoff Aug 3 '10 at 0:10
4

Try replacing -* with a couple of common email addresses in the heavy emailers list. something like this might work to:(me -*@aol.com)

  • 1
    A set of custom filters helped me to remove the generic email. However, -*@aol.com doesn't seem to work any more. – Josiah Yoder Aug 8 '17 at 13:55
2

When creating the filter, can you put your email address in the from field and in the to field. I just tried this and it only includes emails that I've sent to myself.

Here is some of the help on Gmail's search (somewhat unrelated): http://mail.google.com/support/bin/answer.py?hl=en&answer=6593

  • 2
    That will also match mails you sent to yourself and to someone else, which is not what the OP wanted. – Vaddadi Kartick Jul 29 '16 at 12:06
0

Since we're talking about Gmail...

I use a lesser known feature of Gmail combined with a filter to accomplish this:

The feature is that Gmail (personal) supports any number of . in the address.

So if my email address is johndoe@gmail.com then sending mail to all of the following permutations (and many more) will still go to johndoe@gmail.com

e.g.

john.doe@gmail.com
j.ohndoes@gmail.com
john......doe@gmail.com
j.o.h.n.d.o.e@gmail.com

You get the idea.


Your request:

I want to create a filter for all email sent by me only to me.

To accomplish this I send all these "notes" to a permutation that I know no one else uses. E.g. john__doe@gmail.com

The filter I set up is very simple after that

  To:john__doe@gmail.com

Note: I also use this trick to filter email when signing up for questionable sites by signing up with a permutation I can filter straight to trash

You'll note from the blog that there is a similar Gmail feature that is more straightforward. I could use `johndoe+note@gmail.com' and now the filter is obvious and easier to remember.

To sum up:

  1. send these notes to a specific alias johndoe+note@gmail.com
  2. create to: filters for these special alias permutations
0

My solution:

  1. create a Google script in a project, using Gmail classes (https://developers.google.com/apps-script/reference/gmail/ to get the mails. Iterate through the GmailThreads and check for the getTo() mail addresses
  2. Check, if this is only one recipient and if it is your mail address
  3. If yes, label this mail by a special (user) label. Use addLabel() in GmailThread class
  4. run the script periodically - let's say once per hour
  5. filter your inbox mails by the special label set in the script. Bingo!
  • I have implemented this, see my answer. – thdox Jul 30 at 9:21
0

it's simple......

create a filter like this, click on the arrow for the advanced search options

Show search options

You will reveal the advanced search features, type from:myaddress@gmail.com in the "includes the words" field and click "create filter with this search". You will have to create a label when you go to the next screen

example of where the filter goes

follow the prompts and thats it.

  • Or you could just type your email address in the from field, the problem here is everyone is thinking the wrong way, you don't make the filter using to: you have to use from: – Peter Feb 11 '18 at 4:56
  • 1
    Wouldn't this find all the messages sent from "myaddress@gmail.com"? The question was about finding the messages sent from "from:myaddress@gmail.com" to "from:myaddress@gmail.com" only. – user135384 Feb 12 '18 at 2:31
0

Try this simple solution:

to:me -{cc:me} 
0

I have implemented a solution in Google App Script. Basically, this is very close to the solution proposed by @Christian Krüger.

The pre-requisite is to create the label 'meonly' (I could have done it programmaticaly, but for readability I did not put it below).

Here is the Google App Script code:

function to_me_only()
{
  var search = 'to:me -is:chats in:inbox -label:meonly';

  try {
    var label = GmailApp.getUserLabelByName('meonly');
    var threads = GmailApp.search(search);
    var gmailMessages = GmailApp.getMessagesForThreads(threads);

    for(var i=0; i<threads.length; i++) {
      var messagesForThread = gmailMessages[i];
      for(var j=0; j<messagesForThread.length; j++) {
        var messageTo = messagesForThread[j].getTo()
        if(   messageTo.toLowerCase()=='"lastname, firstname" <firstname.lastname@company.com>'
           || messageTo.toLowerCase()=='"firstname.lastname" <firstname.lastname@company.com>'
           || messageTo.toLowerCase()=='firstname lastname <firstname.lastname@company.com>'
           || messageTo.toLowerCase()=='firstname.lastname@company.com'
           || messageTo.toLowerCase()=='<firstname.lastname@company.com>'){
          threads[i].addLabel(label);
        }
      }
    }
  } catch (e) {
    console.log('Error');
    console.log(e);
  }
}

I have then created a trigger to execute the above code every 5 minutes.

-1

I think it should work with below filter in "Includes the word" below line. I have tested this sending mail from other mail ID, and now I am putting same on live filter to check if everything is working fine.

to:yourmailid@domain.com -{cc:yourmailid@domain.com}
-2

I gave up on filters but this works:

  • Select your Sent Mail.

  • In the search box, enter to: me.

-3
to:me AND from:me 

Works very well.

  • 3
    That will also show email that's sent to me and 3 other people. It won't limit the results to email only sent to me. Thanks any way. – Andrew Warner Feb 7 '16 at 6:01
-3

It can be done by using -> To: me is: important where To is a field you will find it in settings while creating a new filter. No brackets nothing simply write me is: important in To field.(ignore the error & proceed)

  • This doesn't address the question. – Folk Nov 10 '16 at 21:01
-3

Use your complete address after to: instead of to:me and you'll get better results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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