Solved

Canceling a sendmail message from the queue

Posted on 1998-09-07
1
361 Views
Last Modified: 2013-12-26
Hello,
 Whats the official way of canceling a message in a sendmail queue? I have a system that spends most of its time not connected to the internet and then connects periodically to exchange mail. More than once I have needed to cancel a message in the sendmail queue, I usually do this by deleting the three files in the queue, but occasionally the message as gone anyway. Is there a sendmail command that I can use which will properly cancel the message (even if its begun to try and send it - ie mailq shows a * next to the message)

Thanks in advance,
Nicholas Waltham
0
Comment
Question by:nwaltham
1 Comment
 
LVL 2

Accepted Solution

by:
blowfish earned 50 total points
ID: 1293115
If you need to do any "queue maintenance", then the first thing that you should do is stop any currently running sendmail processes.  The easiest way I know of to do that is to run the sendmail script with a stop argument.  For Solaris that would be;

    /etc/init.d/sendmail stop

and for Linux (RedHat) that would be;

    /etc/rc.d/init.d/sendmail stop

Once you have stopped all running sendmail processes, you can delete a queued message by removing all of it's related queue files.  I actually prefer to move the selected queue files into a temporary directory.  But if all you want to do is delete them, the following will work (assuming a queue id of MAA12345);

    cd /var/spool/mqueue
    rm ?fMAA12345

There is no sendmail command that will remove queue files for you, you must remove them from the queue yourself.  

Cheers,

--frankf

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 137
MaxSpan challenge 9 96
fix34  challenge 9 123
Execute multiple curl cmds with sleep and send output to file 10 97
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question