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:



    Why?

    NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 5xWD40EFRX | OMV6

    • Offizieller Beitrag

    I'm not able to replicate this problem. What is the output of:


    cat /etc/anacrontab

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Here you go:

    NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 5xWD40EFRX | OMV6

    • Offizieller Beitrag

    What is the output of: grep -r MAILTO /etc/*

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Zitat

    /etc/cron-apt/config:MAILTO="me@gmail.com"
    /etc/cron.daily/openmediavault-pending_config_changes:MAILTO=""

    NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 5xWD40EFRX | OMV6

  • In /usr/share/openmediavault/mkconf/anacron, I notice the following section which sets the command to send emails:

    Code
    if [ "${sendemail}" = "1" ]; then
        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 | 5xWD40EFRX | OMV6

  • I am guessing the mails are sent by anacron itself as described in this man-page:

    Zitat

    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 | 5xWD40EFRX | OMV6

    • Offizieller Beitrag

    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 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Only recently, I began getting daily mail from anacron. No idea what the problem is though.


    Message Body:


    /etc/cron.daily/openmediavault-cron-apt:stdin: is not a tty

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • 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.

    True. But it makes me wonder what the use is of the "send email" parameter on an anacron job in OMV...

    NAS: Celeron G1840T | ASUS H87I-Plus | Samsung SSD 850Pro 256 GB | 5xWD40EFRX | OMV6

    • Offizieller Beitrag

    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 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!