# date | mail -a hugefile.sql email@example.com
# postdrop: warning: uid=0: File too large
send-mail: fatal: root(0): message file too big
# echo "message_size_limit = 102400000" >>/etc/postfix/main.cf && service postfix reload
Reloading Postfix configuration...done.
During massive outages (which thankfully happen rarely), I like to keep my
Nagios monitoring machines online and working. This is because I like to have a view of the servers with remaining problems, or processes that didn’t come back online correctly. However, I stop our MTA (
postfix) on those servers, because I don’t want to receive texts and emails complaining about all the servers that are still down. Once the problem is resumed, I could just startup
postfix, but lets take a look at the mailqueue:
# mailq 2>&1 | tail -1 | cut -d " " -f 5-
Hmm… seems a bit high. If we start
postfix again, guess how many text messages are going to wind up on my phone? Let’s drop all of the messages in the queue:
# postsuper -d ALL
postsuper: Deleted: 428 messages
Now we can start
postfix without excessive messages being sent.
Alternatively, if the main MX relays go down for a period of time, you will see the mailqueue fill up with undelivered mail. After you bring the MXs back online, the mail may be sent to them immediately. Your MTA probably has an increasing retry interval, which could lead to a one hour delay or longer. Do this to attempt to relay all the mail in the queue:
# postqueue -f
It will try to reconnect immediately to the MX relay, and deliver all mail if it can.