I am sure many people have inadvertantly hit the SEND button a fraction of a second after realiasing that they are sending to the wrong email address. Fortunatly, if you are quick enough, you can catch it before it leaves the linux server.

If you company has a broadband link, you will have to be Speedy Gonzales to dash to the server and disconnect the broadband link. Having broadband means that your link is always on, therefore outgoing mail will get delivered immediately.

If you are unlucky enough to still be stuck on a dialup connection, then you can take a leasurly walk over to the server, and switch off the modem.

Then the fun begins.

All outgoing mail is stored in the directory   /etc/mail/mqueue/  So firstly you would do go there.

cd  /var/spool/mqueue/

An outgoing email sitting in the queue will consist of 2 files. A  DATA file and a CONTROL file. Both these files have to be deleted in order to remove the email from the queue. Below you can see an example of the DATA file  ( dfkB.... ) and CONTROL file ( qfkB....)  Notice that the ID number is indentical except for the  d  and f .



[root@enet mqueue]# ls
dfkBDDGPnP012769  qfkBDDGPnP012769

checking the mail queue, we can see that the email we need to delete is sitting there. Once we delete the 2 files above, it will be removed.

root@enet squid]# mailq
                /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
kBDDGPnP012769*    6247 Wed Dec 13 15:16 <george@foo.co.zw>
                                         <chrisn@foo.com>
                Total requests: 1


Make 100% sure that you are in the correct directory, then you can use the   rm  command to remove the files.

rm  dfkBDDGPnP012769  qfkBDDGPnP012769

You will be prompted for confirmation for removal, which you will say "yes" to, and thats it, the mail should be deleted. Check it by running     mailq again.























Copyright, eNet Solutions 2006