Sendmail by command line in cPanel

Pputnik

Member
May 20, 2016
11
1
3
Poland
cPanel Access Level
Root Administrator
Hello,

What should I do if there's no /bin/mail?

# /bin/mail
-bash: /bin/mail: No such file or directory

the only 'mail' I found is /usr/local/cpanel/bin/admin/Cpanel/mail, but it does not answer either on --help or just attempt to start from shell.

WHM 58.0 (build 31)

Please advise.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello,

Are you accessing the command line as the "root" user? If so, what's the output when you run the "whereis mail" command? It's located at /usr/bin/mail on a test system running CentOS 7.

Thank you.
 

Pputnik

Member
May 20, 2016
11
1
3
Poland
cPanel Access Level
Root Administrator
hi Michael,

Are you accessing the command line as the "root" user?
yes

If so, what's the output when you run the "whereis mail" command?
mail: /etc/mail
Also
# mail
-bash: mail: command not found

It's located at /usr/bin/mail on a test system running CentOS 7.
# ll /usr/bin/mail

Code:
/bin/ls: cannot access /usr/bin/mail: No such file or directory

# cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2016.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2016.09"
PRETTY_NAME="Amazon Linux AMI 2016.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2016.09:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

AMAZON Enterprise 2016.09 x86_64 xenhvm – aw
Thank you.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
You can try manually installing the package with a command such as:

Code:
yum install mailx
Thank you.