This tutorial is available in other languages. Help translate more

Italiano / 简体中文 /

Change mail attachment size

Mail attachment size is configured in multiple places with default iRedMail settings:

Change message size limit in postfix

Postfix is MTA, so we have to change its setting to transfer mail with large attachment.

For example, to allow mail with 100Mb attachment, please change both message_size_limit and mailbox_size_limit settings like below:

# postconf -e message_size_limit=104857600
# postconf -e mailbox_size_limit=104857600

Note

Restart postfix to make it work:

# /etc/init.d/postfix restart

NOTES:

If you use mail clients such as Outlook, thunderbird to send mails, it's now ok to sent large attachment with above setting.

Change upload file size in Roundcube webmail

If you have Roundcube webmail, please change two more settings:

Change PHP setting to allow to upload large attachment

You should change memory_limit, upload_max_filesize and post_max_size in PHP config file /etc/php.ini

memory_limit = 200M;
upload_max_filesize = 100M;
post_max_size = 100M;

Change Roundcube webmail settings to allow large attachment

Change same settings in file .htaccess under roundcube root directory:

Note: this .htaccess file may not exist on some Linux/BSD distributions, if it doesn't exist, you can skip this step.

php_value    memory_limit   200M
php_value    upload_max_filesize    100M
php_value    post_max_size  100M

Restart Apache or php-fpm service to make it work.

Change upload file size in Nginx

Find setting client_max_body_size in Nginx config file /etc/nginx/nginx.conf, change it to a proper value to match your need.

http {
    ...
    client_max_body_size 100m;
    ...
}

Change file size limits in SOGo

SOGo config file is /etc/sogo/sogo.conf (Linux/OpenBSD) or /usr/local/etc/sogo/sogo.conf (FreeBSD), 2 settings are relevant to message size:

    // set the maximum allowed size for content being sent to SOGo using a PUT or
    // a POST call. This can also limit the file attachment size being uploaded
    // to SOGo when composing a mail.
    //
    //  - The value is in kilobyte.
    //  - By default, the value is 0, or disabled so no limit will be set.
    WOMaxUploadSize = 102400;

    // Parameter used to set the maximum allowed email message size when
    // composing a mail.
    // The value is in kilobytes. By default, the value is 0, or disabled so
    // no limit will be set.
    SOGoMaximumMessageSizeLimit = 102400;

Restarting SOGo service is required if you changed any setting in SOGo config file.

Change attachment size limit in Microsoft Outlook

Outlook has its own attachment size limit, and will raise error like The attachment size exceeds the allowable limit.

To modify the default attachment limit size in Outlook on Windows system, follow these steps:

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Preferences
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\Outlook\Preferences

Reference: https://support.microsoft.com/en-us/kb/2222370