The 'cat' command is incorrect. remove the double quotes. cat is expecting a filename.
Remove the quotes on the redirect also.
The quotes aren't a problem. They're almost certainly unnecessary, but they're not a problem. The shell processes the text by first splitting it into "words", assuming the first word is an executable, and invoking it with the other words as arguments. Special characters are space (which separates words), * and ? (which are used in filename matching), $ (which indicates a variable), double quotes (which both the space separation and wildcards, but not the variables) and single quotes (which inhibits the variable matching as well). And various other things too
runs cat with two arguments, this and file. But
runs cat with only one argument "this file", and so you can put spaces into file names (you can use backslashes . Similarly,
runs echo with multiple arguments, one for every file in the current directory, but
runs it with one argument: *.
It's worth noting that this is different from DOS, which doesn't do the the wildcard matching directly, but passes them unexpanded to the program. So in DOS
is ok, and will rename all your jpegs. In Linux, the equivalent
expands into a list of all your .jpg files plus a list of all your .jpeg files. So mv gets a big list of files, and complains.
Anyway. Back to the original question. Try mail with the -d argument, which (according to the man page)
-d Causes mail to output all sorts of information useful for debugging mail.
, or have a look at the files in /var/log immediately after the error, to see what they've logged.