[How to] Set an email sender for OMV emails

    • OMV 5.x (beta)
    • [How to] Set an email sender for OMV emails

      Hi people,

      During my testing with OMV (version 5) I discovered a behaviour that I really didn't like: majority of emails are sent with the sender root, only in rare occasions the email address is used.
      This can cause two issues:
      • OMV emails might go into spam. Also receiving emails from root it not nice.
      • Some provides simply do not support this configuration. One of them is Zoho Mail, which I use. When I configured this provider, I was not getting emails from OMV and logs were throwing errors about " Relaying disallowed error", a message received from the SMTP Server.
      That's what my provider says:

      Zoho Mail KB wrote:

      Relaying disallowed error


      When the email address (or login credentials) you have provided in the application does not match the email address (or credentials) of your account's outgoing server, you will see a 'Relaying Disallowed' error when you attempt to send an email. The SMTP client will not be able to send the email because of the email address mismatch.
      This can happen when an email address is used as default in a coded program or when you have misspelled the email address while configuring your email inbox. You will receive emails without any issues. To resolve the 'Relaying Disallowed' error, you need to correct the email address provided.
      However there is no such option in OMV. I believe it should be added to the GUI, should be a basic change. Should I submit a product request?

      FIX
      I have found an easy fix for this issue.

      Connect to your server in SSH and edit the following file /etc/postfix/smtp_header_checks with the following:

      Source Code

      1. #Fix sender
      2. /^From: (.*)/ REPLACE From: SenderName <server@yourwebdomain>
      Save the file and restart postfix: service postfix restart
      From now on emails will be sent if your provider enforces/verifies the email address, and they will definitely appear better to your eyes.
    • Those emails are sent as root because they are system emails (probably cron). If you want it to go to a different address, modify /etc/aliases and then run newaliases. Whether OMV should change this or not is a different question.
      omv 5.2.3 usul | 64 bit | 5.3 proxmox kernel | omvextrasorg 5.2.0
      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!
    • Postfix should already be configured to replace root with the configured email address.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • i think this is the config doing that: github.com/openmediavault/open…es/recipient_canonical.j2
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • ryecoaaron wrote:

      Those emails are sent as root because they are system emails (probably cron). If you want it to go to a different address, modify /etc/aliases and then run newaliases. Whether OMV should change this or not is a different question.
      Yes, cron jobs are sent with the 'root' sender, but it does not make sense in my opinion. And breaks my email provider.

      votdev wrote:

      Postfix should already be configured to replace root with the configured email address.
      I encountered this issue about a month ago using whatever was the last version of OMV5. I can repeat the test if you want. By the way, as ryecoaaron mentioned, cron jobs are sent as "root".
    • thedarkness wrote:

      Yes, cron jobs are sent with the 'root' sender, but it does not make sense in my opinion. And breaks my email provider.
      This is a Debian default. gmail has no problem with it.
      omv 5.2.3 usul | 64 bit | 5.3 proxmox kernel | omvextrasorg 5.2.0
      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!
    • ryecoaaron wrote:

      thedarkness wrote:

      Yes, cron jobs are sent with the 'root' sender, but it does not make sense in my opinion. And breaks my email provider.
      This is a Debian default. gmail has no problem with it.
      and because of that OMV configures Postfix to replace that name with it’s real email address.

      Now we need to find out why postfix is not doing that.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • ryecoaaron wrote:

      thedarkness wrote:

      Yes, cron jobs are sent with the 'root' sender, but it does not make sense in my opinion. And breaks my email provider.
      This is a Debian default. gmail has no problem with it.
      Yes, I know Gmail works fine but it's a cosmetic issue too. Potentially other mail providers could break.

      votdev wrote:

      ryecoaaron wrote:


      thedarkness wrote:

      Yes, cron jobs are sent with the 'root' sender, but it does not make sense in my opinion. And breaks my email provider.
      This is a Debian default. gmail has no problem with it.
      and because of that OMV configures Postfix to replace that name with it’s real email address.
      Now we need to find out why postfix is not doing that.
      I don't know if you want to go down this route, but my fix has the highest priority and every email is sent using those settings.
    • Your fix locks wrong too me because it is a catch-all rule. It is not only root that is sending emails.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • and yes, we need a solid solution, otherwise other installations will break.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • As said and shown, postfix is already configured to handle such situations. The question now is why it does not work.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit