sendmail cannot be called directly from a shell with the current user id

While sending email using sendmail scirpt, I was getting the error message as -
sendmail: sendmail cannot be called directly from a shell with the current user id

Solution -

1. Login to WHM using root access.
2. Follow - Home >> Server Configuration >> Tweak Settings
3. Disable below two options -

i.  Track email origin via X-Source email headers
ii. Prevent “nobody” from sending email

It resolved my issue. Email sent successfully.

Logs of email has been sent successfully are as follow -

2017-07-14 01:44:01 cwd=/home/cpanel_username/public_html/cgi-bin 2 args: /usr/sbin/sendmail -t
2017-07-14 01:44:01 message_id <= from_email_address U=nobody P=local S=1468 T="Application Name"
for to_email_address
2017-07-14 01:44:01 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1dVvGb-00056K-D3
2017-07-14 01:44:02 message_id3 => to_email_address <to_email_address> R=lookuphost T=remote_smtp
H=email_service_name [mail_server_ip_address] X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 CV=yes C="250 2.0.0
Ok: queued as E8/6B-12306-E5778695"
2017-07-14 01:44:02 message_id Completed

Let me know your thoughts on it!
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

MySQL server is currently offline. Error: Too many connections at /usr/local/cpanel/Cpanel/ line 173.

phpMyAdmin and MySQL Databases in cPanel were displaying me the below error -...

How to to know SSH port on the cPanel server?

Steps to know SSH port of cPanel server -1. Login to WHM with your login details. 2. Go to...

How to preview the edited page in WordPress?

I have edited the WordPress site page but it was not reflected on the live site.Solution :-1....

Account Creation Status: failed. A database owner with the name <account-name> already exists.

I have deleted the account from the WHM but while recreating it, I was getting below error...

Powered by WHMCompleteSolution