Email notification without internet access -> SMTP server?

    • OMV 4.x
    • 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?
    • 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 4.x - ASRock Rack C2550D4I - 16GB ECC - Silverstone DS380
    • gderf wrote:

      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

      Source Code

      1. echo 'OMV_POSTFIX_MAIN_MYDESTINATION="server.local, server, localhost.local, localhost"' | sudo tee -a /etc/default/openmediavault
      2. 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.local
      - Primary E-Mail: omv@localhost.local

      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.

      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/ Therefore I created the file /usr/share/openmediavault/mkconf/postfix.d/15main_custom with the following content:


      1. #!/bin/sh
      2. echo 'home_mailbox = Maildir/' | sudo tee -a /etc/postfix/
      which only appends the desired line to the postfix config. After restarting postfix it stores emails in the folder ~/Maildir.

      To be continued...

      The post was edited 4 times, last by myscha ().