-1

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?

William Boman
  • 2,079
  • 5
  • 26
  • 39

2 Answers2

1

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

Jeff
  • 394
  • 3
  • 13
0

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).

Ralf Hildebrandt
  • 543
  • 2
  • 16