Actually, I abandoned the idea of encrypted cron emails.
However, it's fairly simple to implement.
Copy your gpg public key to your home directory on OMV
modify /etc/cron.d/openmediavault-userdefined - something like this:
GPG_CMD = "ifne /usr/bin/gpg --batch --armor --trust-model always --no-default-keyring --keyring /home/YOURPUBLICKEY.asc.gpg --recipient you@example.de --encrypt"
@daily root /var/lib/openmediavault/cron.d/userdefined-blah-blah 2>&1 | $GPG_CMD | mail -E -s "Cron - Scheduled system backup." -a "From: Cron Daemon <root>" root >/dev/null 2>&1
Of course there's a big problem with this:
# WARNING: Do not edit this file, your changes will get lost.
So it would be nice if you could put your own stuff in the crontab without it getting overwritten.
But I took another approach:
Rather than trying to get OMV to send encrypted mail to my gmail account,
send it a mail server that I have control over. And don't worry about encryption
So I grabbed a postfix/dovecot Docker image off Github and modified to my needs.
I stripped out anything that involves relaying mail over the internet. This is local only.
So now, I just configure OMV to send cron mail to the Docker container.
To read the mail, Thunderbird.
Yes Thunderbird complains about a self-signed certificate. I just "add exception" and it works fine.
I also have several other Linux boxes here at home that send cron mail to the Container.
So now, I don't worry about encrypting cron mail anymore.
For my needs this is exactly what I want.
But, it's kind of specialized, not sure many people would want this.
Sure it would be nice if OMV did this. But it's easy enough to do with Docker.
You guys have your hands full with far more important stuff.
If anyone is interested, I'll gladly send them my Dockerfile and stuff.
Warning, this is the 3rd Docker image I've ever built, and the first one was "hello world".