On my debian server I got exim4 installed. I know, that the MTA works because I can send mails with php and it uses the account configured in
However when I try on command line
echo "test" | mail -s "test" email@example.com
mail: cannot send message: Process exited with a non-zero status
$? is set to 36
Also /var/log/exim4/mainlog shows no entry just the (successfully) send mails I tried from php and the usual start and end queue run messages, which indicates that the mail command doesn't even reach the MTA.
mail --version mail (GNU Mailutils) 3.1.1 Copyright (C) 2007-2016 Free Software Foundation, inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
I have searched the web and found issues people had with postfix configuration but since my MTA is exim4 and it works fine on it's own, I wonder what the problem is here.
I have set up two other servers where system mail works fine, I use it in cronjobs. There I also just installed exim4 and configured it accordingly and never had this issue.