On Mon, Nov 27, 2000 at 09:07:03PM -0500, Peter Samuel wrote:
> On Mon, 27 Nov 2000, Paul Fontenot wrote:
> 
> > What is the equivalent of the mailq command? Is it qmail-queue? And if so
> > can I just drop it in place of mailq in my scripts?
> 
>     /var/qmail/bin/qmail-qread
> 
> You need root privileges (or qmailq really) to run it.

Which is why some people run it as a network service. Something like
this does the trick:


/usr/local/bin/tcpserver -v -H -R -u1008 -g1003 127.0.0.1 81 
/var/qmail/bin/qmail-qread 

Where 1008 is the uid of qmails and 1003 is the group id of qmail.

Then create a mailq command thusly:

cat <<EOD >/bin/mailq
#! /bin/sh
/usr/local/bin/tcpclient 127.0.0.1 801 sh -c 'exec /bin/cat -v <&6'
EOD

chmod a=rx /bin/mailq

By binding to 127. only local users can access the port. And they all get
access without needing any special permissions.


Regards.

Reply via email to