Check mail queue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Check mail queue
# 8  
Old 01-23-2015
Do you have super-user access? If so, the mail will be stored in files according to your system configuration (you don't tell us the distribution) but it's likely to be under /var somewhere. Perhaps one of these:-
  • /var/mail/queue
  • /var/spool/mail
  • /var/spool/mqueue
..... or something similar. Have a look at the manual page for sendmail to see if that gives you some more clues. You can then check to see if there are files in there at all (might see something whilst it is processing) or files over 24-hours old. You can use the find command for that quite nicely.


Does that help you? I'm still not convinced your plan is a good one though. What we do is to have a heartbeat e-mail. Essentially we send a note on a regular basis and someone/something alerts if it hasn't arrived.

Another alternate is you could drive the query from another server. You could write error checking there to alert you if:-
  • You can't connect
  • You can't run the job
  • There is pending e-mail
If you can perform the error checking on this other server, then you could hope that it would be able to notify you, although it still depends on the common infrastructure not being the point of failure.



Robin
This User Gave Thanks to rbatte1 For This Post:
# 9  
Old 01-25-2015
thanks reply ,

it helps , I know the command "mailq" can show all pending mail , what I hope to do is extract such raw data into a alert mail .

thanks
# 10  
Old 01-26-2015
So, if mail is stuck, you still want to send an alert by e-mail.......... Smilie

Unless the manual page for your mailq command gives you a flag to get the mail submission date/time, then you would be best looking in the directories I have suggested or similar to see the file date/times if any exist.

You really do need to think of another route for your alert that won't get stuck in exactly the same way as what you are trying to check up on.

If you can't think of one, then perhaps a regular e-mail that gets reported on if it doesn't arrive. Do you have a 24-hour operation that has people on site round the clock? If they have a team mailbox, then that's a good place to send it and have a check at whatever intervals that it has been received. If not, then they (people) can alert as required.



Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check pending mail in mail queue

I know the command mailq can check the pending mail in mqueue , and also have another command to check POSIX mail queue in server , now I will regularly check the mqueue manually , it is time consuming , would advise the script that could help to check the mail queue , and then send the details to... (3 Replies)
Discussion started by: ust3
3 Replies

2. UNIX for Dummies Questions & Answers

Mail Queue refilling

Hello I'm using Cent OS6 and a webmin interface I've had an issue where over 1 million emails were queued in the sendmail mail queue. I found a thread on here from 2002 explaining how to delete them all and it worked great. Thanks Perderabu unix-for-dummies-questions-and-answers /... (0 Replies)
Discussion started by: bullbreed
0 Replies

3. UNIX for Advanced & Expert Users

can "netif_queue_stopped" function check wether or not the net device queue is stopped?

Hi, all: In linux 3.0.4, can "netif_queue_stopped" function check wether or not the net device queue is stopped? How could I know wether a net device queue is stopped or not? li,kunlun (0 Replies)
Discussion started by: liklstar
0 Replies

4. Shell Programming and Scripting

Check if Queue empty or full in perl

Hi, I got problem with queue code how to determined empty and full and problem with while loop Here is my pseudo code : Input page Access Input Pgae Frame For i =3 to pageframe count by 1 construct queue of size i set pageFaultCount to 0 while morepages do page = NextPage... (1 Reply)
Discussion started by: guidely
1 Replies

5. Shell Programming and Scripting

flush the mail queue

Hi Guys, My mail queue is showing a mail. I want to flush the queue. Can you let me know how to flush the mail queue. Regards, Magesh (12 Replies)
Discussion started by: mac4rfree
12 Replies

6. IP Networking

postfix - reinject mail to postfix from hold queue directory

hi all. Am using smtpd_recipient_restrictions & check_recipient_access in postfix. The hash file looks like this: emailaddress1 HOLD emailaddress2 HOLD The aim is to place email from these recipients in the hold directory,check them then reinject them back in postfix on some... (0 Replies)
Discussion started by: coolatt
0 Replies

7. UNIX for Advanced & Expert Users

mail is not sent, instead just coping into /var/spool/queue dir

Hi, I have some problems w/ the sendmail. I see that messages are queued in the /var/spool/mqueue and they are never sent to the recipients. This problem just suddenly started without any modifications in the current configuration. I already started and stop the sendmail and it did not help.... (3 Replies)
Discussion started by: ktanya
3 Replies

8. Shell Programming and Scripting

shell script needed for mail queue notification

Hi shell experts, I would like to have a shell script running in a redhat server for monitoring the mailqueue status. I have already installed the qmHandle and I am using it to get a status of the mail queue in daily basis. I am executing the qmhandle in the cron. Now I am planning to execute... (10 Replies)
Discussion started by: Nightman
10 Replies

9. Shell Programming and Scripting

MyDoom in mail queue

Is there someone out there that has a script for cleaning up the mail queue after viruses such as MyDoom? (5 Replies)
Discussion started by: pmj1970
5 Replies

10. UNIX for Dummies Questions & Answers

Clearing Mail Queue

Hello, I am trying to clear my mail queue with the following command: rm /var/spool/mqueue/* But when I do this I get this error: /bin/rm: Argument list too long. Can someone tell me what that error means and what I can do to correct it so I can clear my mail queue? Thanks (2 Replies)
Discussion started by: Chet
2 Replies
Login or Register to Ask a Question