Mail vs. mail what is the difference

What is this business about mail and Mail?
[On a CentOS box] Why mail does not work but won’t return an error either while Mail works fine with the exact same syntax?

Mail is basically a link to mail, isn’t it?

Sorry, this was a mixup, apparently (for historical reasons?!) there is a mail and a Mail
Nowadays it looks like they both point to the same thing, on my machine:

sr-linux> ls -l `which mail`
-rwxr-xr-x    1 root     mail        66492 Jun 24  2001 /bin/mail
sr-linux> ls -l `which Mail`
lrwxrwxrwx    1 root     root           14 Nov 19  2001 /usr/bin/Mail -> ../../bin/mail

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Historically, there have been many incompatible extensions of the original mail commnad. Mail came from BSD, and took the name Mail rather than mail because it was shipped alongside the incompatible mail program. Later the same story happened with mailx. For more details, read the Heirloom project’s write-up on the different versions of mail. Linux distributions have variously provided one or more of the mail utilities under various names.

For portability, even between installations of the same Linux distribution sometimes, you can’t rely on mail. The mailx command is standardized (not with all the options that might exist on a particular system).

If you want a utility that always behaves in the same way provided it’s present, and you don’t mind that it’s often not installed by default, you can use mutt.

Solution 2

On my system, both binaries point to mailx:

[email protected]:/> which mail
/usr/bin/mail
[email protected]:/> ls -la /usr/bin/mail
lrwxrwxrwx 1 root root 5 Mar  2  2011 /usr/bin/mail -> mailx
[email protected]:/> which Mail
/usr/bin/Mail
[email protected]:/> ls -la /usr/bin/Mail
lrwxrwxrwx 1 root root 5 Mar  2  2011 /usr/bin/Mail -> mailx

Do the same as me to see where mail and Mail are and what they are linked too. That will tell you the details of your system. You’re saying you get an error, which leads me to believe that they are NOT pointing to the same application.

According to this article, mailx and Mail are extended versions of the mail command. They have more options, which is why you might be getting errors.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply