- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Clearing the mail queue?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2007 09:04 AM
тАО09-25-2007 09:04 AM
It has been a while since I had to deal with mail on a UNIX host. Well, issued a mailq command on my system, and there is a lot of undelivered mail. How do I clear out the queue, as I don't want these massages to be sent?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2007 09:07 AM
тАО09-25-2007 09:07 AM
Re: Clearing the mail queue?
delete the files in it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2007 10:15 AM
тАО09-25-2007 10:15 AM
Re: Clearing the mail queue?
You can clean up it periodicaly.
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2007 10:37 AM
тАО09-25-2007 10:37 AM
Re: Clearing the mail queue?
If access to the Internet is normal,and DNS resolution is good, most mail will be delivered in seconds.
sendmail -v -q
This will attempt to run the queue and provide verbose output for failures. You should look at some of the failures before manually clearing the mail queue.
You may find spam or something you should research before sending it to the bit bucket.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2007 03:06 PM
тАО09-25-2007 03:06 PM
Solutionmail-queue in the directory /var/spool/mqueue. In this directory the messages can be refound with help of the Q-ID. Each message consists of two files:
qfNAAnnnn -- Job control file (header infos)
dfNAAnnnn -- Data file (message body)
If you want to delete a message you just have to get the Q-ID with the command mailq, then you can delete the belonging qf and df file in the directory /var/spool/mqueue.
WK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2007 03:36 PM
тАО09-25-2007 03:36 PM
Re: Clearing the mail queue?
If you don't want them, in vi you could just use:
:!rm %
Then ":n" to go to the next.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2007 01:56 AM
тАО09-26-2007 01:56 AM
Re: Clearing the mail queue?
for i in `mailq |grep -v Deferred |grep -v mqueue |grep -v - |awk '{print $1}'`
do
rm /var/spool/mqueue/df$i
rm /var/spool/mqueue/qf$i
done
# mailq
/var/spool/mqueue is empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2007 02:35 AM
тАО09-26-2007 02:35 AM
Re: Clearing the mail queue?
/usr/bin/find /var/spool/mqueue/ -mtime 1 |xargs rm -f {}; > /tmp/cleanmqueue.cron.log 2>&1
For cleanliness, restart sendmail...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2007 04:10 AM
тАО09-26-2007 04:10 AM
Re: Clearing the mail queue?
# ls -1 /var/spool/mqueue/* | xargs rm