The mail error is, I believe, related to the posgresql error that popped up this morning. See Broken Postgres - #2 by anatoli for a temporary workaround. If you stop apiscp (and stop monit so that it doesn’t restart apiscp) then you can restart postgresql, and finally postqueue -f
and your mail should flow again.