Koozali.org: home of the SME Server

qmHandle, how to list emails in queue

Offline Tillebeck

  • ***
  • 76
  • +0/-0
Re: qmHandle, how to list emails in queue
« Reply #15 on: May 09, 2008, 10:42:38 PM »
Quote
You should be able to work out yourself visually which messages have local recipients and which have remote recipients.
Yes, if I somehow could list those unsent emails. It seems from your post that it is trivial. I just doesn't know where to look for a list of unsent/unprocessed emails (the only Linux I ever worked with is the SME server... so I haven't got the same background knowledge as a typical linux server user).

All I can do is unplug WAN-cable and let qmail do its job and then use qmHandle or the /var/qmail/bin/qmail-qread to view the mails in the local or remote queue.

how can I see the unsent mails when qmail is stopped? Are they physically placed in a folder on the server as separate files? That would be great.

BR. Anders

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: qmHandle, how to list emails in queue
« Reply #16 on: May 09, 2008, 11:01:59 PM »
Yes, if I somehow could list those unsent emails. It seems from your post that it is trivial.

/var/qmail/bin/qmail-qread

Offline Tillebeck

  • ***
  • 76
  • +0/-0
Re: qmHandle, how to list emails in queue
« Reply #17 on: May 09, 2008, 11:21:27 PM »
Well that brings me back to the same old problem.

See here:
I stop qmail, then I wait until there is a few new unsent mails. Since qmail has been stopped the mails will remain unprocessed and not end up in either the remote or the local queue. Therefore (at least on my system) neither qmHandle nor the qmail-qread will be able to list the mails.
Code: [Select]
[root@ronja ~]# sv d /service/qmail
[root@ronja ~]# qmHandle -l -c
Total messages: 5
Messages with local recipients: 0
Messages with remote recipients: 0
Messages with bounces: 0
Messages in preprocess: 5
[root@ronja ~]# /var/qmail/bin/qmail-qread
[root@ronja ~]#
- please notice that both local and remote queue are empty and all 5 mails are preprocessed.

If... I had cut the WAN connection and let qmail run (but not be able to send out the mails due to the WAN beeing disconnected) then mails would not be preprocessed but would build up in the remote and the local queue and both the qmHandle and the qmail-qread will be able to show me some nice results.

I just thought that there should be some way to read mails from the preprocessed queue, or?...

BR. Anders

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: qmHandle, how to list emails in queue
« Reply #18 on: May 10, 2008, 01:07:31 AM »
I stop qmail, then I wait until there is a few new unsent mails. Since qmail has been stopped the mails will remain unprocessed and not end up in either the remote or the local queue. Therefore (at least on my system) neither qmHandle nor the qmail-qread will be able to list the mails.

Hmm, you are right - I didn't realise that qmail-qread didn't show unprocessed messages.

Quote
I just thought that there should be some way to read mails from the preprocessed queue, or?...

cd /var/qmail/queue/todo

Then view the first message:

cat ../mess/*/$(ls | head -1 | tail -1)

and the second:

cat ../mess/*/$(ls | head -2 | tail -1)

etc.

The sender and recipient addresses are embedded in the todo files, which you can see via:

cat $(ls | head -1 | tail -1)
cat $(ls | head -2 | tail -1)

etc.

Offline Tillebeck

  • ***
  • 76
  • +0/-0
Re: qmHandle, how to list emails in queue
« Reply #19 on: May 12, 2008, 12:37:16 PM »
Thanks, Charlie, that is great! I can see from and to now.

I started this thread to figure out who send spam on my local network. If it was a server or a client. We did find a virus infected windows maschine on the network that was sending out spam at a slow rate. So no virus /hacking on our SME Server.

BR. and thanks for all the help.
Anders
« Last Edit: May 13, 2008, 02:42:30 PM by Tillebeck »