Max. message size (attachment size)
Open data/conf/postfix/extra.cf and set the message_size_limit accordingly in bytes. See main.cf for the default value.
You will also need to adjust message size in Rspamd and Clamav configurations:
- in
data/conf/rspamd/local.d/options.incaddmax_messageparameter, check Rspamd Docs for defaults - in
data/conf/rspamd/local.d/external_services.confadjustmax_sizeparameter foroletools - in
data/conf/rspamd/local.d/antivirus.confadjustmax_sizeparameter forclamav - in
data/conf/clamav/clamd.confadjustMaxScanSizeandMaxFileSize - in
mailcow.confsetNGINX_MAX_BODY_SIZEabove the new message size (default128m), it limits requests to SOGo webmail, CalDAV/CardDAV and ActiveSync. Apply it withdocker compose up -d.
Restart Postfix, Rspamd and Clamav:
docker compose restart postfix-mailcow rspamd-mailcow clamd-mailcow
docker-compose restart postfix-mailcow rspamd-mailcow clamd-mailcow
Request size limits in nginx¶
nginx limits the size of requests:
- SOGo webmail, ActiveSync and CalDAV/CardDAV:
NGINX_MAX_BODY_SIZEinmailcow.conf, default128m. The value uses nginx syntax (e.g.128mor1g),0means unlimited, an invalid value falls back to128m. Keep it abovemessage_size_limit, otherwise large mails cannot be sent through SOGo or ActiveSync (error413). - mailcow UI, API, Rspamd UI and own locations in
site.*.custom: 64 MB. For larger uploads in own locations, setclient_max_body_sizethere (see Config expansion in mailcows Nginx).