How do I raise the maximum limit on email attachment filesize?

SYSTEM INFORMATION
OS type and version: CentOS 7.9
Webmin version: 1.981
Virtualmin version: 6.17
Related products version: RECOMMENDED

Good day from Singapore,

Recently I installed Virtualmin web hosting server control panel on my CentOS 7.9 VPS Linux server.

When I try to send an email with an attachment of 7.6 MB from gmail to my email account hosted with Virtualmin, it was rejected as the attachment is too big.

How can I raise the maximum limit on email attachment filesize?

I am looking forward to your reply.

Thank you.

Mr. Turritopsis Dohrnii Teo En Ming
Targeted Individual in Singapore

@Turritopsis_Dohrnii,

In Postfix, the ā€œmessage_size_limitā€ is by default set to ā€œ1024000ā€ (approx. 10MB). This size includes every aspect of the message however including: headers, message, and attachments, etc.

Most servers today support a message size of at least 25MB these days, so to increase the size you can execute a few commands from the command line.

sudo postconf | grep ā€˜^message_size_limit =ā€™

This command will tell you what the current ā€œmessage_size_limitā€ is which likely will result in the initial value from the first part of the question.

Next, to change the value execute:

sudo postconf -e ā€˜message_size_limit=25600000ā€™

This will change the value in the Postfix configuration.

Once again, you can run:

sudo postconf | grep ā€˜^message_size_limit =ā€™

Confirm that the value has been changed correctly.

Finally to apply the changes so that Postfix uses the update, run:

sudo systemctl restart postfix

Report back if this addresses your concern, or if you require further assistance.

*** the above instructions increases ā€œmessage_size_limitā€ from 10MB to 25MB ***

Itā€™s quite possible this change could be made from within Webmin via:

Webmin > Servers > Postfix

However Iā€™m old school, so I prefer doing stuff via the command line :slight_smile:

Good luck!

1 Like

Thank you Peter Knowles for sharing pointers with me.

I have successfully changed the message size limit from 10 MB to 25 MB.

I didnā€™t do it from the Linux command line though. I used the Webmin GUI to make changes.

Thank you once again.

Mr. Turritopsis Dohrnii Teo En Ming
Targeted Individual in Singapore

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.