1

I have mail server with spec:

  • Centos 7
  • Roundcube 1.3.5
  • MTA Postfix 2.10.1

I have limited the attachment upload size to 5M in:

  • /etc/php.ini => post_max_size = 10M , upload_max_filesize = 5M
  • Roundcube => config.php : $config['max_message_size'] = 5M
  • postfix => main.cf : message_size_limit= 5242880

As far as i Know, this configuration should allow attachment of 5Mb file, but i am even unable to attach below 5Mb file size. Any help please

EDIT: I am able to send email with attachment of 4 mb size. And if i increase the roundcube configuration to 6 MB, then i am able to attach and send email of 5Mb file size. I think postfix and php.ini configuration are okay.

Ratan Thapa
  • 48
  • 1
  • 7

3 Answers3

1

try to change php.ini => upload_max_filesize = as you want

Rajib Chy
  • 111
  • 2
0
  1. You could have more than one php.ini file, and you may have changed the wrong one. Check if the change took effect with phpinfo().

  2. Were you able to upload files before you changed the limit? It could be that you don’t have file_uploads = On in your php.ini.

  3. Are you able to upload files elsewhere on the same server? If yes, there is an issue with either postfix or roundcube.

  4. What happens when you try to upload the file? Are you able to upload but not send? If yes, the issue is with Postfix, not PHP or Roundcube.

  5. Did you restart (or reload) the php and postfix services after changing the config files?

Note: Your Postfix configuration limits the size of the message, not attachments. Even if you get this working, you won’t be able to upload two 5M files to one message. You may also run into issues if you have a lot of text in the email. 282K should be enough for more text than you would possibly ever want to write in an email, though.

DCowan
  • 38
  • 3
0

The message_size options refer to the whole email message, headers and body included. If the attachment itself is as big as the limit, then the mail will be rejected, since added headers will make the message grow beyond the limit.

Also, be aware that there are some things which can increase message size without being obvious:

  • Binary attachments are sent after base64-encoding them, growing their size by about an extra 30%
  • Special characters, if encoded with "Quoted-printable" encoding will take up more than one characters (at least 3)
  • Mails containing a HTML part usually contain the message twice (as HTML, and as plain text), further increasing their size.
Lacek
  • 6,585
  • 22
  • 28