Email queue management: limit total email
When the number of email in postfix queue is above "some thousands", the queue management page reports a php memory allocation failure.
I propose to limit the maximum number of email handled per request to 1000.
If the total number is higher, remaining email can be handled after dealing with the first 1000.
#1 Updated by Filippo Carletti over 3 years ago
- Status changed from NEW to TRIAGED
- Assignee set to Filippo Carletti
- % Done changed from 0 to 20
I'd change /usr/share/nethesis//NethServer/Module/Mail/Queue.php
- $process = $this->getPlatform()->exec('/usr/bin/sudo /usr/sbin/postqueue -p | /usr/libexec/nethserver/mailq2json'); + $process = $this->getPlatform()->exec('/usr/bin/sudo /usr/sbin/postqueue -p | head -n 4000 | /usr/libexec/nethserver/mailq2json');
Every mail needs 4 lines, -n 4000 means 1000 emails.
#4 Updated by Filippo Carletti over 3 years ago
- Status changed from MODIFIED to ON_QA
- % Done changed from 60 to 70
1. fill the queue
service postfix stop for i in $(seq 1 5000); do mail -stest firstname.lastname@example.org </root/anaconda-ks.cfg ; done
2. access the queue management interface: php error
3. update and access queue management again
Note: during update postfix will be restarted and will try to deliver email
Remember to empty queue after test.
#6 Updated by Giacomo Sanchietti over 3 years ago
- Status changed from ON_QA to VERIFIED
- Assignee deleted (
- % Done changed from 70 to 90
Before update, the GUI displays this error:
 Allowed memory size of 33554432 bytes exhausted (tried to allocate 101 bytes) See the system log for details.
After the the update, the web interface displays about 1.3 K mails.