Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mail sending error "-s: command not found" #238

Closed
richardferaro opened this issue Jun 19, 2017 · 2 comments
Closed

Mail sending error "-s: command not found" #238

richardferaro opened this issue Jun 19, 2017 · 2 comments

Comments

@richardferaro
Copy link
Contributor

Mail sending error:

Some setups will encounter the error below due to missing 'mail' command:
/usr/local/maldetect/internals/functions: line 647: -s: command not found

To fix it, I added sendmail for those with limited server support:
richardferaro@3837d00

[New] Added sendmail support
[Fix] Bug in mail '-s: command not found' call when binary does not exists

The above will send the email using sendmail if mail is not available and terminate gracefully when no mail binaries found.

rfxn added a commit that referenced this issue Jul 14, 2017
@rfxn
Copy link
Owner

rfxn commented Jul 14, 2017

Thanks for the contribution!

I made a few changes to how remote_ip is fetched

dig=`which dig 2> /dev/null`
nslookup=`which nslookup 2> /dev/null`
if [ -f "/var/cpanel/mainip" ]; then
remote_ip=`cat /var/cpanel/mainip`
elif [ -f "$dig" ]; then
remote_ip=`$dig +short +time=3 +retry=2 myip.opendns.com @resolver1.opendns.com`
elif [ -f "$nslookup" ]; then
remote_ip=`$nslookup -sil -querytype=A myip.opendns.com resolver1.opendns.com | awk '/^Address: / { print $2 ; exit }'`
fi

@rfxn rfxn closed this as completed Jul 14, 2017
@richardferaro
Copy link
Contributor Author

You're welcome and thanks too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants