Hi, I recently installed NCP and I’m trying to learn its ins and outs.
Whenever I am doing something as root, I often get interrupted mid-keystroke with “You have new mail in /var/mail/root”.
I looked at the mail, per these instructions, and it was mostly updates from cron about updating FreeDNS and lists of CVE vulnerabilities from daemon
I’m still learning how to be my own sysadmin. None of these messages are that interesting to me. How is it recommended to solve the problem of annoying mail in root? Something like:
redirect the routine mail to some kind of log that logrotates?
disable the “you have new mail” message and let it manage itself?
You probably can’t say there is a “best” way to do it.
If the function you are calling, provides a way to set a log level that you can then set to your needs.
In case of errors, it depends on you if you prefer to be notified by mail, or if you e.g. observer logfiles (like logwatch, logcheck, …). In that case, perhaps the process already write logs independently, then you could just silence the cron output.
Ideally, to manage to get just the log messages you need, not too many to be bombarded with noise, but not too few to miss important things.
I don’t use NextcloudPi myself, but now that I think of it again, there’s probably an option in the NextcloudPi admin interface where you can configure an actual email account to forward these messages to.
As for why you are receiving the messages in the first place, I can only guess, but it is probably because you have enabled the FreeDNS DynDNS service somewhere in the NextcloudPi admin interface. If you are not using the FreeDNS service, you may want to disable it in the admin interface, which should also stop the messages from beeing sent.
According to the code on Github, this particular cronjob is stored in /etc/cron.d/freeDNS. However, I think you should probably not just maually delete it, but as mentioned above, look for an option in the Nextcloud Pi settings that either forwards the notifications to a real email address or properly disables FreeDNS if you are not using it.
Hi, thanks a lot for your help, especially for finding where the cronjob was located.
I looked for where to setup email on https://docs.nextcloudpi.com/, but unfortunately the whole page disappears as soon as you type 3 letters into the search box. This probably deserves its own thread, but details are hidden
Documentation website with 3 letters typed in search bar (mostly blank screen)
I do want to continue to get updates from freeDNS, but hopefully only when things go wrong, not every time. Currently it interrupts me if I’m typing at the terminal with “You have new mail in /var/mail/root” when I’m in the middle of a keystroke.
I found a reference for the WebUI configuration, and some of the other plugins like fail2ban support adding a personal email address for updates, but no global option, and no option in the freeDNS section.
I ended up editing /usr/local/bin/freeDNS.sh and commenting out every line that started with “echo” as a start. There is probably a better way to do this.