1. I received three junk mails yesterday.

2. I received three junk mail yesterday.

3. I got three spam mails yesterday.
4. I got three spam mail yesterday.

5. I received many spam/junk mails every day.
6. I receive much spam/junk mail every day.
-----------------------------
Which expressions are grammatical? It seems that 'mail' is used as a countable noun and an uncountable noun.

Neither 1 nor 2 is correct. Here's the correction:

I received three pieces of junk mail yesterday.

(Mail or junk mail or spam or email -- all are non-count nouns. You need a count noun in there so that the numbers and "many" make sense. http://grammar.ccc.commnet.edu/grammar/noncount.htm )

Make corrections in 3 - 6, and I'll check them for you.

1. I received three pieces of junk mail yesterday.

4. I got three pieces of spam mail yesterday.

6. I receive much spam/junk mail every day.

(Thank you for your help.)

With the word "spam," you don't need to attach the word "mail."

These mean the same thing:
~ spam
~ junk mail

All of the expressions you provided are grammatically correct, although there are slight differences in meaning and usage.

1. "I received three junk mails yesterday." - This sentence is grammatically correct, but it sounds a bit less natural. Typically, when referring to unsolicited email, we use "junk mail" as a mass noun, rather than a countable noun. Therefore, it would be more common to say "I received three pieces of junk mail yesterday" or simply "I received three junk emails yesterday."

2. "I received three junk mail yesterday." - This sentence is not grammatically correct because "junk mail" is a noun phrase that requires an article before it. It should be "I received three pieces of junk mail yesterday" or "I received three emails of junk mail yesterday."

3. "I got three spam mails yesterday." - This sentence is similar to the first example, but it uses the term "spam mail" instead of "junk mail." Just like with junk mail, it would be more common to say "I got three pieces of spam mail yesterday" or "I got three spam emails yesterday."

4. "I got three spam mail yesterday." - Similar to the second example, this sentence is not grammatically correct. It should be "I got three pieces of spam mail yesterday" or "I got three spam emails yesterday."

5. "I received many spam/junk mails every day." - Both "spam mails" and "junk mails" are grammatically correct here because they are being used as countable nouns. However, it might be more common to use "spam emails" or "junk emails" instead of "spam mails" or "junk mails" in this context.

6. "I receive much spam/junk mail every day." - Similarly, both "spam mail" and "junk mail" are grammatically correct when used as uncountable nouns here. However, it is more common to use "spam email" or "junk email" when referring to unsolicited emails in general. Therefore, it would be more natural to say "I receive much spam email every day" or "I receive a lot of junk email every day."