Increase email attachment size

Discussion in 'HOWTO-Related Questions' started by mrbronz, Jul 9, 2021.

Tags:
  1. mrbronz

    mrbronz Member HowtoForge Supporter

    I currently have a "Maximum allowed file size is 2.0 MB" for my email

    How do I increase this

    Many thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Where do you see that and which email client you use? Just a guess, you use RoundCube or similar web-based email client and you try to upload a file attachment?
     
    Th0m likes this.
  3. mrbronz

    mrbronz Member HowtoForge Supporter

    I'm using Roundcube and it's just to the right-hand side of the interface when I try and attach a file
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    In this case, your problem is the PHP upload size limit. Edit the apache2 php.ini file (the exact path varies depending of Linux distribution and version) and set the

    upload_max_filesize = 10M
    post_max_size = 10M

    (or the value that you need) and restart apache. if you don't know the path to php.ini, then please post which Linux distribution, version and web server you use.
     
  5. FredZ

    FredZ Member

    Can the email file attachment size be set in the ISPC web UI?
    The assumption here is that roundcube has been installed, and roundcube is reporting the 2Mb limitation.

    Regards

    Fred
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Not to my knowledge.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    What RoundCube reports there is the max upload size of PHP, which also limits attachments as RoundCube is written in PHP. If no files bigger than 2MB can be uploaded by a PHP script, then no attachment in RoundCube can be bigger than 2MB as well. The global PHP max. upload size can be configured in php.ini only. there is no option for this PHP setting in ISPConfig.
     
  8. Sites > Options > Custom php.ini settings:
    I added these two lines for Wordpress site to work.
    upload_max_filesize = 64M
    post_max_size = 64M

    Adding a box like that in the Email section would be awesome.

    By the way, this is my first post and I just wanted to say...
    ISPConfig is amazing. I can't believe how complete and full featured it is. Thanks for this software. I did buy the book too, to show support.
     
    Jonathon Gilbert and till like this.
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Such settings can not be set for the mail system on a per-domain or mailbox basis in postfix, so having such a field in ISPConfig while the underlying service is not able to provide such a feature will not help to configure the system. You can set postfix settings like the max. mail size already in ISPConfig under System > Server config > mail.
     
  10. Thanks for quick response.
    My goal was and still is to not modify setting via the terminal. I had hoped to make all settings changes via the GUI.
    I think I understand the relationship for websites vs mail server php settings.

    I'm just confirming my thoughts with this statement. I'm possibly wrong about this, but the settings under System > Server Config > Mail are not PHP.ini settings. So I believe there is no way to increase the 2MB upload limit on /webmail via the ISPConfig settings GUI.
    upload_max_filesize = 64M
    post_max_size = 64M

    I did a test to confirm some things.
    I installed Thunderbird and was indeed able to send more than 2MB to my ProtonMail account from my ISPConfig email server account.
    The limit is only on /webmail and I'm sure it is a PHP.ini setting limit because for some reason they set 2MB as the default maximum. This is a limit set by the PHP Group and not ISPConfig.
    I'm perfectly willing to make the changes to the PHP.ini file if that is the correct and only way to set it to 10 or 20 MB. For me and like many others, I was just hoping to make all changes via the GUI to avoid any conflicts in the future during system upgrades and such.

    Thanks
    Ranzy
     
  11. I just re-read your post from above.
    You clearly stated that max upload size can only be configured in php.ini.
    No need to re-state this to me. Thanks
     
  12. So a new question then, but I didn't think I should/would go and make a new thread. Since this thread is just about finalized with a simple yes or no. Probably a no.
    Could a global PHP settings be included in the System > Server Config setting of a future ISPConfig GUI?
     
  13. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    it theory, it could. in practice, it probably wouldn't be much use.

    you may want to sell different hosting/email packages, where some packages have higher php memory/upload/filesize limits
    you may have clients with vhosts dedicated to just their own sites, who may want (effectively) unlimited upload sizes.
    it's rarely a one-size-fits-all setting, so you'll most likely either end up setting it very high to avoid having to keep changing it, or you'll have a range of php snippets set for changing it to various sizes depending on requirements.
     
  14. Jonathon Gilbert

    Jonathon Gilbert Member HowtoForge Supporter

    Awesomeness. Thankyou
     

Share This Page