[Exim] Re: BUG: mailq doesn't behave as expected

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Rusty Russell
Dátum:  
Címzett: Philip Hazel
CC: exim-users, mark
Új témák: [Exim] removing messages from the queue, [Exim] removing messages from the queue
Tárgy: [Exim] Re: BUG: mailq doesn't behave as expected
In message <Pine.SOL.4.21.0101281204570.9487-100000@???> you wr
ite:
> The source distribution of Exim does not install a command called mailq.
> However, because some people like the name mailq, the code of Exim does
> recognize if Exim has been called under the name "mailq", and makes this
> do the same thing as "exim -bp", which is the nearest Exim equivalent.


Please see attached patch (v3.22): makes it print the number of
messages in the queue.

> HOWEVER, it is supposed to be the case that a non-admin user who runs
> "exim -bp" should see any messages that they submitted to Exim via the
> standard input, either using -bs or otherwise (but not anybody else's
> messages). I have just tested this using -bs and -bm, and cannot find
> any problem.


Sorry, my error. nmh is connecting to 127.0.0.1 port 25, so this
ownership heuristic breaks down, of course.

Cheers,
Rusty.
--
Premature optmztion is rt of all evl. --DK

--- exim-3.22/src/queue.c    Fri Jan 19 20:32:10 2001
+++ exim-3.22-mailq/src/queue.c    Tue Jan 30 19:00:25 2001
@@ -668,6 +668,7 @@
 void *reset_point;
 queue_filename *f = NULL;
 uschar subdirs[64];
+int num_messages = 0;


/* If given a list of messages, build a chain containing their ids. */

@@ -716,6 +717,7 @@
if (rc == spool_read_notopen && errno == ENOENT && count <= 0) continue;
save_errno = errno;

+  num_messages++;
   if (queue_list_requires_admin && !admin_user &&
      (rc != spool_read_OK || real_uid != originator_uid)) continue;


@@ -809,6 +811,7 @@
     printf("\n");
     }
   }
+  printf(" %u messages in the queue\n", num_messages);
 }