Article 6FMMM Delete sendmail mail queue

Delete sendmail mail queue

by
Pedroski
from LinuxQuestions.org on (#6FMMM)
I am sudo user pedro on this little cloud server using Ubuntu 22.04 Server

I am trying to delete the mail in the sendmail mail queue, but the file permissions are:

Quote:
pedro@ubuntu:/var/spool$ ls -l /var/spool/
total 16
drwxr-xr-x 3 root root 4096 May 18 02:08 cron
lrwxrwxrwx 1 root root 7 May 18 02:08 mail -> ../mail
drwxr-s--- 2 smmta smmsp 4096 Oct 17 06:41 mqueue
drwxrws--- 2 smmsp smmsp 4096 Oct 17 06:31 mqueue-client
drwx------ 2 syslog adm 4096 Dec 30 2021 rsyslog
pedro@ubuntu:/var/spool$
I can't touch the mail queue!

First I stopped the sendmail service, then tried to delete:

Quote:
pedro@ubuntu:/var/log/apache2$ sudo rm /var/spool/mqueue/*
rm: cannot remove '/var/spool/mqueue/*': No such file or directory
pedro@ubuntu:/var/log/apache2$ cd /var/spool/mqueue
-bash: cd: /var/spool/mqueue: Permission denied

I can see the mail queue with mailq or sendmail -bp, but that also takes a long time to display anything! Minutes!

What is the best way to get rid of the queue?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments