Increasing E-Mail size

  • So I had a lot of files change and the snapraid diff job was not able to send the report mail because it was too large:


    Code
    postdrop: warning: uid=0: File too large
    send-mail: fatal: root(0): message file too big
    Can't send mail: sendmail process failed with error code 75

    So I tried to change /etc/postfix/main.cf by creating the file /srv/salt/omv/deploy/postfix/99custom.sls :


    Code
    custom_postfix_size_nolimit:
      file.keyvalue:
        - name: /etc/postfix/main.cf
        - key_values:
            mailbox_size_limit: 0
            message_size_limit: 0
        - separator: ' = '
        - uncomment: '# '
        - append_if_not_found: True

    Running omv-salt deploy run postfix returns:


    Code
    ID: custom_postfix_size_nolimit
    Function: file.keyvalue
    Name: /etc/postfix/main.cf
    Result: False
    Comment: file.keyvalue key and value not supplied and key_values empty
    Started: 19:57:21.263072
    Duration: 0.36 ms
    Changes:

    I am pretty sure the formatting on the key_values dictionary is correct (reference).

    Any ideas on what I did wrong or how I can appropriately adjust the size limit for postfix?

  • Why so complicated? Simply use

    Code
    custom_postfix_size_nolimit:
      file.append:
        - name: /etc/postfix/main.cf
        - text: |
            mailbox_size_limit: 0
            message_size_limit: 0


    That's what I tried at first but it will result in:


    Code
    ...
    alias_maps = hash:/etc/aliases
    transport_maps = hash:/etc/postfix/transport
    message_size_limit = 10240000
    mailbox_size_limit = 0
    message_size_limit = 0


    So "message_size_limit" is defined twice.

    I don't know if this is an issue, but anyway it does not look good :)

    That's why I tried to do it properly.


    What does work though is:



    Then again 'mailbox_size_limit' is probably not necessary since I won't be receiving mails and this is probably a question better asked in some SaltStack forum :D

  • ozboss

    Hat das Label gelöst hinzugefügt.
  • ozboss If you want to approach the issue in another way I can provide a Snapraid script that does not display the actual file changes so the email stays nice short and clean.

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • I see, message_size_limit can be customized via the environment variable OMV_POSTFIX_MAIN_MAILBOX_SIZE_LIMIT. Please check https://openmediavault.readthe…l#environmental-variables how to do that.

    This seems like a clean solution that I am happy to use. Thank you.

    Maybe rename the variable to OMV_POSTFIX_MAIN_MESSAGE_SIZE_LIMIT?

    I definitely have to start using these variables more often.


    auanasgheps yes I would be interested to see an alternative Snapraid script.

  • This seems like a clean solution that I am happy to use. Thank you.

    Maybe rename the variable to OMV_POSTFIX_MAIN_MESSAGE_SIZE_LIMIT?

    I definitely have to start using these variables more often.


    auanasgheps yes I would be interested to see an alternative Snapraid script.

    Variables are a clever solution to change advanced stuff that must be persisted and is not worth showing in GUI.
    You'll be surprised by the amount of variables available.


    To see all of them, run


    grep -r 'default:OMV_' /srv/salt/omv/* | cut -d ":" -f3 | cut -d')' -f1 | sort | uniq


    I'll PM you the script I've put together.

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • ozboss If you want to approach the issue in another way I can provide a Snapraid script that does not display the actual file changes so the email stays nice short and clean.

    Can you please share such a script?

    Is it also possible to have the script that does display all the file changes just save the changes to a log file and send out an email saying that it ran and with a short summary? This way emails are readable and if there are problems then one can refer back to the full log.

  • Can you please share such a script?

    Is it also possible to have the script that does display all the file changes just save the changes to a log file and send out an email saying that it ran and with a short summary? This way emails are readable and if there are problems then one can refer back to the full log.

    That's what my script does!

    Please send me a PM so I don't forget (quite busy during these days)

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

Jetzt mitmachen!

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