My problem is: I'm trying to send mails within a cloud foundry container, but I don't have root access to install mailutils (or anything else) via apt install. I read about pre-built binaries and found this project: Running Cron Jobs on Cloud Foundry. In short it contains a pre-built binary from supercronic to run cron jobs (so no installation needed).
Is it possible to build a binary from mailutils using a virtual machine (running Ubuntu) on which I have root access? Or is there another solution? We basically only need to be able to send mails.
I know that one can send mails using any provider (like Gmail) or mail relais. That's not what I'm looking for. I'm fine if only scripts inside this "mail-container" can send mails. I also tried the apt-buildpack together with the multi-buildpack, but that didn't install any package.
I doubt you'll be able to get a functional MTA installed inside your container on Cloud Foundry. You'll never get root access in the container, so you would have to use apt-buildpack or even worse, build one from source. I don't want to say it's impossible, cause someone will go do it out of spite, but it's certainly a lot more work than you really need to do here.
Instead what I would suggest is one of the following:
a.) Use the SMTP libraries of your language of choice to send mail directly from your application. As long as you're only sending email this works perfectly fine.
b.) You could use a script which implements a.) that you shell out to from your application. A quick search found this. I have not tested this script, but I'm linking to it because it's an example of what I mean here.
Hope that helps!