iredmail-doc/html/change.mail.attachment.size...

102 lines
5.0 KiB
HTML
Raw Normal View History

2014-09-30 19:03:36 -05:00
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Change mail attachment size</title>
<link href="./css/markdown.css" rel="stylesheet"></head>
</head>
<body>
<div id="navigation">
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
// <a href="./index.html">Document Index</a>
</div><h1 id="change-mail-attachment-size">Change mail attachment size</h1>
<div class="toc">
<ul>
<li><a href="#change-mail-attachment-size">Change mail attachment size</a><ul>
<li><a href="#change-message-size-limit-in-postfix">Change message size limit in postfix</a></li>
<li><a href="#change-upload-file-size-in-roundcube-webmail">Change upload file size in Roundcube webmail</a><ul>
<li><a href="#change-php-setting-to-allow-to-upload-large-attachment">Change PHP setting to allow to upload large attachment</a></li>
<li><a href="#change-roundcube-webmail-settings-to-allow-large-attachment">Change Roundcube webmail settings to allow large attachment</a></li>
</ul>
</li>
<li><a href="#change-upload-size-in-nginx">Change upload size in Nginx</a></li>
</ul>
</li>
</ul>
</div>
2014-09-30 19:03:36 -05:00
<p>To change mail attachment size, we have to change 3 settings.</p>
<h2 id="change-message-size-limit-in-postfix">Change message size limit in postfix</h2>
<p>Postfix is MTA, so we have to change its setting to transfer mail with large
attachment.</p>
<p>To allow mail with 100Mb attachment, please change 'message_size_limit' setting
like below:</p>
<pre><code># postconf -e message_size_limit='104857600'
</code></pre>
<p>Restart postfix to make it work:</p>
<pre><code># /etc/init.d/postfix restart
</code></pre>
<p><strong>NOTES</strong>:</p>
<ul>
<li><code>104857600</code> is 100 (MB) x 1024 (KB) x 1024 (Bit).</li>
<li>Mail will be encoded by mail user agent (Outlook, Thunderbird, etc) before
transferred, the actual message size will be larger than 100MB, you can
simplily increase above setting to 110Mb or 120Mb to make it work as expected.</li>
</ul>
<p>If you use mail clients such as Outlook, thunderbird to send mails, it's now
ok to sent large attachment with above setting.</p>
<h2 id="change-upload-file-size-in-roundcube-webmail">Change upload file size in Roundcube webmail</h2>
<p>If you have Roundcube webmail, please change two more settings:</p>
<h3 id="change-php-setting-to-allow-to-upload-large-attachment">Change PHP setting to allow to upload large attachment</h3>
2014-09-30 19:03:36 -05:00
<p>You should change <code>memory_limit</code>, <code>upload_max_filesize</code> and <code>post_max_size</code> in
PHP config file <code>/etc/php.ini</code></p>
<ul>
<li>on RHEL/CentOS: it's <code>/etc/php.ini</code></li>
<li>on Debian/Ubuntu, it's <code>/etc/php5/apache2/php.ini</code></li>
<li>on FreeBSD, it's <code>/usr/local/etc/php.ini</code> for Apache, or
<code>/etc/php5/fpm/php.ini</code> for Nginx.</li>
<li>on OpenBSD, it's <code>/etc/php-5.4.ini</code>. If you're running different PHP release,
the version number <code>5.4</code> will be different.</li>
</ul>
<pre><code>memory_limit = 200M;
upload_max_filesize = 100M;
post_max_size = 100M;
</code></pre>
<h3 id="change-roundcube-webmail-settings-to-allow-large-attachment">Change Roundcube webmail settings to allow large attachment</h3>
2014-09-30 19:03:36 -05:00
<p>Change same settings in file <code>.htaccess</code> under roundcube root directory:</p>
<ul>
<li>on RHEL/CentOS, it's <code>/var/www/roundcubemail/.htaccess</code></li>
<li>on Debian/Ubuntu, it's <code>/usr/share/apache2/roundcubemail/.htaccess</code> or
<code>/opt/www/roundcubemail/.htaccess</code>.</li>
2014-09-30 19:03:36 -05:00
<li>on FreeBSD, it's <code>/usr/local/www/roundcubemail/.htaccess</code></li>
<li>on OpenBSD, it's <code>/var/www/roundcubemail/.htaccess</code></li>
</ul>
<p>Note: this <code>.htaccess</code> file may not exist on some Linux/BSD distributions,
if it doesn't exist, you can skip this step.</p>
<pre><code>php_value memory_limit 200M
php_value upload_max_filesize 100M
2014-09-30 19:03:36 -05:00
php_value post_max_size 100M
</code></pre>
<p>Restart Apache or Nginx web server to make it work.</p>
<h2 id="change-upload-size-in-nginx">Change upload size in Nginx</h2>
<p>Find setting <code>client_max_body_size</code> in Nginx config file
<code>/etc/nginx/nginx.conf</code>, change it to a proper value to match your need.</p>
<p>```
http {
...
client_max_body_size 100m;
...
}</p><p style="text-align: center; color: grey;">Document published under a <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">CC BY-ND 3.0</a> license. If you found something wrong, please do <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3293801-21', 'auto');
ga('send', 'pageview');
2014-10-13 19:28:43 -05:00
</script>
</body></html>