Sample Header Ad - 728x90

Remove specific emails from sendmail mqueue

1 vote
1 answer
325 views
How do I remove emails from mqueue based on destination address. Needing to remove deferred messages going to "" Due to an endless loop (that has been found and corrected) I have a huge amount of emails deferred or qued for retry in var/spool/mqueue. Need to clear these out ASAP as the bounceback messages are filling up my var/log folder space by 1G every 20min. There is legit email also in the que so can't just empty var/spool/mqueue. How do I filter to just the results I am looking for? And, do I need to stop sendmail first? Results from **df -h** in mqueue showing /dev/sda2 filesystem 100% used due to var/log root@tsunami12:/var/log# df -h Filesystem Size Used Avail Use% Mounted on udev 32G 0 32G 0% /dev tmpfs 6.3G 650M 5.7G 11% /run /dev/sda2 28G 28G 0G 100% / tmpfs 32G 0 32G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 32G 0 32G 0% /sys/fs/cgroup /dev/sda4 2.1T 986G 1013G 50% /home tmpfs 6.3G 0 6.3G 0% /run/user/1000 tmpfs 6.3G 0 6.3G 0% /run/user/1002 tmpfs 6.3G 0 6.3G 0% /run/user/1003 Results from ls -lh in mqueue root@tsunami12:/var/spool/mqueue# ls -lh -rw-r----- 1 smmta smmsp 0 Mar 17 2020 df02H2TsFs012156 -rw-r----- 1 root smmsp 2.8K Apr 14 10:17 df33EDseEV018975 -rw-r----- 1 root smmsp 3.6K Apr 14 10:12 df33EECwjo001842 -rw-r----- 1 root smmsp 2.3K Apr 14 10:43 df33EEhHEt023903 -rw-r----- 1 root smmsp 2.3K Apr 14 10:45 df33EEj5ai025020 Results from **mailq** command 33J38Htu005703 3623 Tue Apr 18 23:08 (Deferred) 33J382mj005213 3623 Tue Apr 18 23:08 (Deferred) Results from root@tsunami12:/var/log# **tail mail.log** command Apr 19 15:54:56 tsunami12 sm-mta: 33INJGL5000565: to=,,,, delay=20:35:40, xdelay=00:00:00, mailer=esmtp, pri=10924132, relay=smtpin01.vzw.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by smtpin01.vzw.a.cloudfilter.net. Apr 19 15:54:56 tsunami12 sm-mta: 33J0R2EH028306: to=,, delay=19:27:53, xdelay=00:00:00, mailer=esmtp, pri=10655014, relay=att-e2xms-west.mx.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by att-e2xms-west.mx.a.cloudfilter.net. Apr 19 15:54:56 tsunami12 sm-mta: 33J0R2EH028306: to=, delay=19:27:53, xdelay=00:00:00, mailer=esmtp, pri=10655014, relay=tmo-east.mx.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by tmo-east.mx.a.cloudfilter.net. Apr 19 15:54:56 tsunami12 sm-mta: 33J0R2EH028306: to=,,,, delay=19:27:53, xdelay=00:00:00, mailer=esmtp, pri=10655014, relay=smtpin01.vzw.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by smtpin01.vzw.a.cloudfilter.net.
Asked by Sarah (11 rep)
Apr 19, 2023, 08:26 PM
Last activity: Apr 24, 2023, 03:04 PM