I am using RHEL 6.4. I have a script which runs in bash. The script sends an email using the command:

mailx -a report.txt "Monthly Report" "business@user.com" < messageBody.html

where report.txt is a pipe separated text file. The size of this file is unknown; sometimes this file may contain just 10-15 records, on other days it may have millions of records.

Now my questions are:

  1. How do I determine what is the maximum file size that can be sent as an attachment?
  2. How to change that size?
  • 1
    That really depends on your mail delivery system. If it is all internal, then you may be able to send very large files. However, if your mail administrator has limited the size of attachments, which is good practice, then it will be whatever limit has been set. You'd be best off asking your mail administrator what that limit is, if any.
    – Warwick
    Dec 23, 2014 at 22:12
  • mailx is MUA, It's depend on your MTA. Dec 24, 2014 at 0:46
  • Thank you Warwick and Mohsen, i was able to check with our mail administrator and he asked me to run this command: postconf -d | grep message_size which provided me the size on the box.
    – JavaTec
    Dec 24, 2014 at 16:00

1 Answer 1


To check maximum size on systems using postfix as their mail transport agent, we can use the postconf command.

postconf -d | grep message_size

It will show you the size in bytes. To change the value, Run

postconf -e 'message_size_limit = 20480000'

To make the changes effective, restart Postfix afterwards:

service postfix restart

(or equivalent on your system)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.