Shaun,

Try something like this,

Create a root owned Maildir with world read access:

#mkdir /etc/pop3lock
#mkdir /etc/pop3lock/users
#/var/qmail/bin/maildirmake /etc/pop3lock/Maildir
#chmod -R +rx /etc/pop3lock

Add the e-mail message you want the user to retrieve to /etc/pop3lock/Maildir/new/ and
make the file world readable.

Create the file /var/qmail/bin/pop3mail with the following contents:

#!/bin/sh
if [ -e "/etc/pop3lock/users/$USER" ]; then
  exec /var/qmail/bin/qmail-pop3d /etc/pop3lock/Maildir
else
  exec /var/qmail/bin/qmail-pop3d $1
fi


Make this file executable:

#chmod +x /var/qmail/bin/pop3mail


Replace /var/qmail/bin/qmail-pop3d with /var/qmail/bin/pop3mail in the command that
starts you pop3 service.  Restart your pop3 service.

To lock a user's account create a file in /etc/pop3lock/users named the same as the
user's account name:

#touch /etc/pop3lock/users/shaung


With the file in place the user will only retrieve the 'account locked' message that
you created each time they check their mail.

Remove the file to unlock their account:

#rm /etc/pop3lock/users/shaung


This is only one of many, many ways to do this.   I welcome your feedback.

Bob

Shaun Gibson wrote:

> Hi there
>
> I need to do the following :
>
> - lock a mailbox (without deleting it or the mail contained in it)
> - if a user tries to access a mailbox locked like this all they get back
> when trying to collect mail is a preset 'call support to re-enable this
> mailbox'.
>
> Suggestions anyone ?
>
> --
> Shaun Gibson
> ------------------------------------------------------------------------------------
> Associate Unix and NT System Adminstrator              Tel :
> +27-11-2667800 ext 8023
> Intekom, Midrand, South Africa
> -----------------------------------------------------------------------------------

--
Robert Sanderson <[EMAIL PROTECTED]>
ETRN.com, Inc. - The Internet Answering Service.
http://www.ETRN.com



Reply via email to