Email notification without internet access -> SMTP server?

  • My router (firewall) is configured so that the NAS has no internet access at all. But anyway I'd like to receive Email notifications, for example, about the disk health.


    Has anyone set up an email server on his NAS? What would be the preferable way: direct setup or via docker image? Are the tiny and easy to configure solutions?

    • Offizieller Beitrag

    Why don’t allow the nas hace access to the remote mail server only?
    Notifications already work in Omv by using postfix as MTA.


    Or are you just talking about fetching the mail notification from the local lan only?

  • I just want to get notifications in the LAN, no need to access them from the WAN side of the router. Is there an easy way to achieve this?

    I do this all the time. Just add some type of POP server into your OMV. I used popa3d.

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

  • I had to do some non-standard configuration of the SMTP server for it to behave as a local mail server. This can be problematic because making certain changes within OMV can and will overwrite that customization, leading to an unreliable solution. You would be far better off just allowing your OMV server to access the internet for outgoing mail.


    But if you are still interested, let me know and I will try to put something together for you.

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

  • But if you are still interested, let me know and I will try to put something together for you.

    I am still interested. As far as I understand it, the only thing that is missing for this to work is a pop or imap access, as postfix is able to do everything else, isn't it?


    It would be great if you could drop some lines here.

  • In the meantime I was able to figure out how OMV can be configured to deliver notification emails locally, without being overwritten by OMV.


    This can be achieved by setting the variables OMV_POSTFIX_MAIN_MYDESTINATION and OMV_POSTFIX_MAIN_INET_INTERFACES in /etc/default/openmediavault

    Code
    echo 'OMV_POSTFIX_MAIN_MYDESTINATION="server.local, server, localhost.local, localhost"' | sudo tee -a /etc/default/openmediavault
    echo 'OMV_POSTFIX_MAIN_INET_INTERFACES="localhost"' | sudo tee -a /etc/default/openmediavault


    In the GUI the following has to be set
    - Enable
    - SMTP server: localhost
    - SMTP port: 25
    - E-Mail sender: omv@localhost.home
    - Primary E-Mail: omv@localhost.home


    Test mails and notifications will be stored in /var/mail/omv afterwards. Now, only a service to fetch the mails via pop3 or imap is missing.


    EDIT:
    Some imap/ pop3 servers only work with emails in Maildir/ format and not with the default mbox format from above.
    To solve this, the line home_mailbox = Maildir/ has to be appended to the postfix config in /etc/postfix/main.cf. Therefore I created the file /usr/share/openmediavault/mkconf/postfix.d/15main_custom with the following content:

    Bash
    #!/bin/sh
    echo 'home_mailbox = Maildir/' | sudo tee -a /etc/postfix/main.cf

    which only appends the desired line to the postfix config. After restarting postfix it stores emails in the folder ~/Maildir.


    To be continued...

Jetzt mitmachen!

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