[Solved] Email size adjustment: message_size_limit not taking effect

3 posts / 0 new
Last post
#1 Wed, 10/29/2014 - 13:39
benjamin_dk

[Solved] Email size adjustment: message_size_limit not taking effect

I am trying to allow larger email sizes (20MB) and followed the advice given in the various threads here on the forum, including adjusting

Webmin -> Servers -> Postfix -> General Resource Control > "Max size of a message"

and also upped the file upload and http post PHP settings as suggested here

https://www.virtualmin.com/node/25404

even though I don't see how PHP is relevant for normal mail delivery.

I reloaded and restarted the postfix server, but still I get errors when trying to send a 16 MB image as an attachment.

/var/log/mail.log:

postfix/smtpd[27841]: NOQUEUE: reject: MAIL from mail-ig0-f182.google.com[209.85.213.182]: 552 5.3.4 Message size exceeds fixed limit; proto=ESMTP helo=<mail-ig0-f182.google.com>

The message size setting:

postconf | grep message_size_limit

message_size_limit = 20480000

The postfix configuration file

/etc/postfix/main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
inet_interfaces = all
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
mydestination = $myhostname, localhost.$mydomain, localhost, <my FQDN>
mailbox_size_limit = 0
allow_percent_hack = no
smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem
smtpd_tls_CAfile = /etc/postfix/postfix.ca.pem
smtpd_tls_security_level = may
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = high
alias_maps = hash:/etc/aliases, nis:mail.aliases
message_size_limit = 20480000
Wed, 10/29/2014 - 14:22
andreychek

Howdy,

You may want to try setting your max message size just a little bit bigger than that... maybe 25 or 30MB.

When sending an attachment, it's first converted to text (MIME), which causes it to be a bit larger... 25% - 33% larger, if I remember correctly.

In your case, that would likely cause the message to be a bit larger than 20MB.

-Eric

Wed, 10/29/2014 - 15:21
benjamin_dk

Hi Eric, you're right. I wasn't aware of the MIME conversion causing an expansion. Thanks! Best regards, Ben

Topic locked