Changing Mail Message Size Limits in macOS Server

There have been several instances where clients have told me that emails they sent me came back undeliverable. Invariably, it was becuase they were sending attachments that appeared to be too big.

A few times I endevored to figure out how to change the message size limit on macOS (formerly OS X) Server. Because the Apple Support article on the subject has been archived, I was hesitant to try to run their command in case something had changed in newer versions of the OS.

Finally, I decided to take to Twitter to ask for clarification. The ever-helpful @brianstucki from @macminicolo and @macstadium pointed me to @cedge318's website Krypted.com. There, I found this excellent post on configuring the mail server in macOS Server.

There, Charles explains how to either disable to message size limit altogether:

sudo serveradmin settings mail:postfix:message_size_limit_enabled = no

Or set a new messsage size limit that suits you:

sudo serveradmin settings mail:postfix:message_size_limit = 20971520

Apple Support explains how to set that number for the limit:

The number in the command above is equal to the desired message size limit in bytes. To calculate the correct value for the desired size limit, multiply the MB value by 1048576. For example, for a 20 MB limit, the calculation would be 20 x 1048576 = 20971520. The number in the above command would therefore be 20971520.

There's some example size values below fo easy copy/pasting.

Check your current message size limit using this command:

sudo serveradmin settings mail:postfix:message_size_limit

If you're not sure how to execute a terminal command to change the server settings, then just proceed with caution. I'm not saying don't do it, as doing is the best way to learn, but read up on it first and maybe run a backup.

Example macOS Server Mail Message Size Limit Values
MBs valueBytes value
55242880
1010485760
1515728640
2020971520
2526214400
3031457280
4244040192