Thay đổi size đính kèm lbk mail

Cách Thay đổi size đính kèm lbk mail? Lời đầu tiên, chúng tôi xin gửi lời cảm ơn chân thành đến quý khách đã tin tưởng và sử dụng dịch vụ email của LBK. Nhằm cải thiện chất lượng sản phẩm, LBK.VN xin phép hướng dẫn cách Thay đổi size đính kèm lbk mail

Thay đổi size đính kèm email

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

  • They don’t have to be same. but mailbox_size_limit (size of the mailbox) MUST be equal to or LARGER than message_size_limit (size of single email message).
  • Postfix is configured to pipe received email to Dovecot for local mail delivery, so the mailbox_size_limit setting is not used, but we still need this setting to surpress Postfix warning while starting Postfix service.

Restart postfix to make it work:

# /etc/init.d/postfix restart

NOTES:

  • 104857600 is 100 (MB) x 1024 (KB) x 1024 (Byte).
  • 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.
  • If mailbox_size_limit is smaller than message_size_limit, you will get error message in Postfix log file like this: fatal: main.cf configuration error: mailbox_size_limit is smaller than message_size_limit.

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

Change PHP settings to upload large file

Please also update PHP config file php.ini to allow uploading large file:

  • on RHEL/CentOS: it’s /etc/php.ini
  • on Debian/Ubuntu, it’s /etc/php/<7.x>/fpm/php.ini (Please replace <7.x> by the real version number on your server).
    • on Ubuntu 16.04 and later releases, it’s /etc/php/7.0/apache2/php.ini for Apache, or /etc/php/7.0/fpm/php.ini for Nginx + php-fpm.
  • on FreeBSD, it’s /usr/local/etc/php.ini for Apache, or /etc/php5/fpm/php.ini for Nginx.
  • on OpenBSD, it’s /etc/php-5.4.ini. If you’re running different PHP release, the version number 5.4 will be different.
memory_limit = 200M;
upload_max_filesize = 100M;
post_max_size = 100M;

Note:

  • If you’re running Nginx as web server, restarting php-fpm service is required.
  • If you’re running Apache as web server, restarting Apache service is required.

Roundcube webmail

Roundcube 1.3.0 and later releases use its own setting max_message_size to limit message size, please add or update this parameter in its config file:

  • on RHEL/CentOS, it’s /opt/www/roundcubemail/config/config.inc.php. Old iRedMail releases use /var/www/roundcubemail/config/config.inc.php.
  • on Debian/Ubuntu, it’s /opt/www/roundcubemail/config/config.inc.php. Old iRedMail releases use /usr/share/apache2/roundcubemail/config/config.inc.php.
  • on FreeBSD, it’s /usr/local/www/roundcubemail/config/config.inc.php
  • on OpenBSD, it’s /opt/www/roundcubemail/config/config.inc.php. Old iRedMail releases use /var/www/roundcubemail/config.inc.php.
$config['max_message_size'] = '100M';

Note: Roundcube preserves some percentage of the max message size (search 1.33 on this page, so if you set the max to 100M, it tells you only 75MB is allowed (100 / 1.33). This is better because email messsage will be encoded before sending to MTA and the encoded attachment is larger than the original file.

Change upload file size in Nginx

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

Old iRedMail releases set this parameter in /etc/nginx/nginx.conf.

client_max_body_size 100m;

Reloading or restarting Nginx service is required.

Tags:

Bình luận

0 bình luận

  • Hãy là người đầu tiên để lại bình luận cho bài viết này!