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!

Was this answer helpful?

 Print this Article

Also Read

Server connection timed out - Unable to access website and cPanel

I tried accessing the website and cPanel from my system (local network) but I was getting error...

How to limit email recipients on exim to 10 email addresses?

You might come under a situation where your client expects you to secure their mail server and...

The mail server could not deliver mail to The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.

All of sudden emails are getting bounced with below bounce back messages on the cPanel server as...

PHP extension soap must be loaded - Magento Issue

While installing the Magento on cPanel server, I got the error as 'PHP extension “soap” must be...

How to setup the root login alert notification email?

Its very important to keep a check on your servers and who logs into the server, From security...

Powered by WHMCompleteSolution