If destination mail server has empty free-space, then the email can't accept an email. Mail server have to store the email temporarily to queuing it before sending it to next destination.
Proper mail server will throw 4xx when it's happened. It means, "I can't accept your mail right now. You may try again later" (RFC 2821 point 4.2.1). When getting 4xx-code from the server, mail client will has several options
- Retry next server based on result of MX lookup
- Wait and retry the primary mail server
Unfortunately RFC doesn't recommend specific behavior when this happened. Mail client may choose first option or second one.
I've try to simulate this condition to gather some data about how several big Mail Provider response to 4xx reply code
- My server with Postfix 2.10 will immediately tries to send email to the secondary mail server
- GMail will keep trying to primary mail server after several minutes later
- Yahoo will keep trying to primary mail server after several minutes later
How to workaround to this problem?
One option was adding some script that regularly check free space of the server. If disk usage was higher than certain threshold then you can shield port 25 with firewall from the internet. Both yahoo and gmail will immediately try to send to next server-preferred when a mail server is unreachable or doesn't respond at all.
Related: SMTP 4xx and secondary MX record as a way to redirect mail