Postfix limit queue size

5.5k Views Asked by At

Sometimes my RPI drops internet connection and cron jobs starts failing left and right and the queue grows incredibly fast, and once I reconnect it just floods me with email.

I'd like to limit the mail queue to a fixed number, is this possible?

2

There are 2 best solutions below

1
Jeff On

Yes, You can limit the maximal number of recipients and active queue size,

In main.cf please add these config options

qmgr_message_active_limit = 40000
qmgr_message_recipient_limit = 40000

Refer this links for better understanding active limit, recipient limit

0
Ralf Hildebrandt On

What you want is not really possible.

I'd say a solution would be to either limit the size of the queue (by using the queue_minfree parameter) or make the system more robust regarding internet outages (like not sending mails for every error cron produces).