So don't just rush a fix out. Think about what the effects of a configuration change like this might be, and whether you are just making more problems for yourself down the line trying to fix something quickly.
So don't just rush a fix out. Think about what the effects of a configuration change like this might be, and whether you are just making more problems for yourself down the line trying to fix something quickly.
Ideally you want to inform the client that their mail was discarded due to size. But you cannot make the mail bounce at that point because it magically turned into http already. The actual delivery is already done. You also cannot trigger an automated reply in your Django app, because it was nginx who dropped it and your app never saw it.
https://docs.sendgrid.com/api-reference/mail-send/mail-send
So OP should have actually only increased the size limit to 30 mb since that’s all that SendGrid supports anyway. Then OP can simply rely on SendGrid’s SMTP server to respond to the client appropriately when they attach too big of files. OP would want to verify with docs and/or SendGrid support that they actually do that, of course, and won’t arbitrarily increase the limit without releasing a new API version before completely relying on SendGrid. But presumably as a paying user of the product he could do that.