openmediavault-anacron sends mail on job execution despite 'send email' set to false

    • OMV 4.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • openmediavault-anacron sends mail on job execution despite 'send email' set to false

      Using the openmediavault-anacron plugin, I set up a daily job for omv-snapraid-diff as follows:



      SnapRAID is set up as follows:



      With these settings, I would not expect any mail to be sent out. Somehow, though, I receive the following mails upon every execution through anacron:

      Subject: [omv.local] Anacron job 'omv-snapraid-diff' on omv
      Date: Sat, 23 Dec 2017 00:57:07 +0100 (CET)
      From: Anacron <openmediavault@mydomain.be>
      To: me@gmail.com


      Mail should be sent here - SENDMAIL set to false


      Why?
      NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 3xWD40EFRX | WD20EARS | OMV4
    • I'm not able to replicate this problem. What is the output of:

      cat /etc/anacrontab
      omv 4.1.15 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • Here you go:
      # /etc/anacrontab: configuration file for anacron



      # See anacron(8) and anacrontab(5) for details.



      SHELL=/bin/sh
      PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
      HOME=/root
      LOGNAME=root



      # These replace cron's entries
      1 5 cron.daily run-parts --report /etc/cron.daily
      7 10 cron.weekly run-parts --report /etc/cron.weekly
      @monthly 15 cron.monthly run-parts --report /etc/cron.monthly
      # >>> [omvanacron]
      1 0 mergerfs.expireCache.timeBased.30 bash /root/mergerfs.expireCache.timeBased.sh /srv/dev-disk-by-label-S850PRO_3 /srv/86531979-48b9-42be-a7d1-e0d735bd7880 30
      1 7 omv-snapraid-diff /usr/sbin/omv-snapraid-diff
      # <<< [omvanacron]
      NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 3xWD40EFRX | WD20EARS | OMV4
    • In /usr/share/openmediavault/mkconf/anacron, I notice the following section which sets the command to send emails:

      Source Code

      1. if [ "${sendemail}" = "1" ]; then
      2. command2="${command} \| mail -s \"Anacron - ${comment}\" -a \"From: Anacron Daemon <${username}>\" ${username} >/dev/null 2>&1"
      It seems to me like this is not the piece of code that causes mails to be sent out:
      • Command in /etc/anacrontab does not match the command set here (it corresponds to the command set when sendemail is false.
      • Subject ([omv.local] Anacron job 'omv-snapraid-diff' on omv) does not match format set here (Anacron - ${comment}).
      • From (Anacron <openmediavault@mydomain.be>) does not match format set here (Anacron Daemon <${username}>).

      Still looking...
      NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 3xWD40EFRX | WD20EARS | OMV4
    • I am guessing the mails are sent by anacron itself as described in this man-page:
      If an executed job generates any output to standard output or to standard error, the output is mailed to the user under whom Anacron is running (usually root), or to the address specified in the MAILTO environment variable in the /etc/anacrontab file, if such exists. If the LOGNAME environment variable is set, it is used in the From: field of the mail.
      Could it be that Anacron is started with the -d parameter? According to the man-page, this causes any output to be mailed unless the -q parameter is also set. If that is so, then I'd guess the -q parameter would need to be set as well (since sending of emails is handled on a per-job basis through the OMV plugin's UI). Does this make sense?
      NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 3xWD40EFRX | WD20EARS | OMV4
    • You could always send the stdout and stderr output of the command to /dev/null or a log file. Then it shouldn't email you.
      omv 4.1.15 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • apa wrote:

      True. But it makes me wonder what the use is of the "send email" parameter on an anacron job in OMV...
      That was just a temporary solution until I can fix the anacron plugin.
      omv 4.1.15 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!