Question

How do I remove maximum limit size for email?

Posted June 7, 2015 21.6k views
Debian Email DigitalOcean Articles Configuration Management

I have successfully set up an email server using this tutorial: [How To Configure a Mail Server Using Postfix, Dovecot, MySQL, and SpamAssasin](https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin) but there appears to be some sort of limit to the size of email attachments I can send or receive. It means I have to resize photographs before sending them and my correspondents cannot understand why they cannot send me pictures either. I need this communication for my work.

Can anybody please tell me where to find where such limits are set among the huge plethora of configuration files in this set up? I have been steadily ploughing through them but it is taking far too long and there are still far to many left to plough through.

I believe it is the server, not the client. But just in case it helps, the client is Thunderbird.

TIA.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

3 answers

Welcome to DigitalOcean.

To change the maximum limit you need to edit /etc/postfix/main.cf

Search for message_size_limit using :

nano /etc/postfix/main.cf

Use Google to calculate Bytes to GB (1GB in Bytes) for e.g. 1GB are 1000000000 Bytes

now change message_size_limit to e.g. message_size_limit = 1000000000 if you want 1GB

PS: Show some love if it works by clicking the hearth

  • Are there any policy or other limits that could prevent those limits to be applied?
    I am unable to send a message larger than default setting to user accounts.

    My config:
    postconf -n | grep size
    mailboxsizelimit = 0
    messagesizelimit = 35720000
    virtualmailboxlimit = ${messagesizelimit}0

    The error I am getting on sending side:
    552 Requested mail action aborted: exceeded storage allocation

    I am obviously missing something here.

That line currently reads “mailboxsizelimit = 0” which, if I understand it correctly, means unlimited in postfix. That’s how I want it. I don’t want a limit set anywhere else either. However, I believe that line refers to the total amount of all the emails, aggregated together, which can be held within a mailbox, not to the maximum size of any one email including attachments.

As it stands I cannot send more than a couple of photos under 1MB and none over 1MB. Which actually confirms the line quoted does not mean zero size of either the mailbox or of the individual messages therein.

I have no wish to change the limit to any particular size. I want to remove it altogether so the arithmetic, which I understand perfectly well already thanks, is irrelevant. But where, if not in /etc/postfix/main.cf, is a limit being imposed?

  • @freshscaped you are right. The line mailbox_size_limit = 0 says that the User e.g. user@example.com has unlimited storage for his mailbox.

    As i understand you want change the “limit to the size of email attachments I can send or receive” to unlimited, for that you need to change message_size_limit to message_size_limit = 0.
    If you don´t have the line message_size_limit just add message_size_limit = 0 for unlimited size of email attachments.

    Sorry I did not read that you wanted unlimited size of email attachments, that is the reason I explained it with 1GB.

Thanks Eldin. That’s done the trick. Sorry, I misread your response at first pass. The message size limit line was indeed missing.

Submit an Answer