This tutorial is available in other languages

English / Italiano /

修改邮件附件大小

要修改邮件附件大小,需要修改三个地方。

修改 postfix 中邮件大小的设置

Postfix 是一个邮件传送代理(MTA),因此,要修改配置以使它能传送大附件的邮件。

假设要修改附件大小为 100MB,需对 message_size_limitmailbox_size_limit 做如下修改:

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

之后重启 Postfix 服务,使上述修改生效:

# /etc/init.d/postfix restart

注意:

这样你就可以通过客户端正常发送邮件了。

修改 Roundcube 网页邮箱的附件上传大小

如果使用 Roundcube 网页邮箱,需要额外更改两个地方:

修改 PHP 设置允许上传大附件

修改 PHP 配置文件 /etc/php.ini 中的 memory_limitupload_max_filesizepost_max_size 三个参数:

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

修改 Roundcube 网页邮箱设置以允许上传大附件

修改 roundcube 目录下的 .htaccess 文件:

注意:某些 Linux/BSD 发行版本可能没有 .htaccess 文件,此时你可以忽略此步骤。

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

重启 Apache 或 php-fpm 服务以使上述修改生效。

修改 Nginx 上传文件大小

在配置文件 /etc/nginx/nginx.conf 中找到参数 client_max_body_size ,按需要修改大小:

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

All documents are available in BitBucket repository, and published under Creative Commons license. You can download the latest version for offline reading. If you found something wrong, please do contact us to fix it.