Running reconstruct as cyrus user

Andrew J Caird andrew.caird at fccc.edu
Fri Apr 2 16:26:19 EST 2004


On Fri, 2 Apr 2004, Robert Fitzpatrick wrote:

> I found a script that supposedly will sa-learn Cyrus IMAP mailboxes for
> spam and ham. The script wants to run the reconstruct command as the
> cyrus user, but 'su' seems to have a problem with the way it is setup:
>
> su - -s /bin/sh cyrus -c "/usr/local/cyrus/bin/reconstruct spam"
>
> Aside from the fact that 'su' has a problem with the syntax, if I take
> out the offending options of the shell and '-s', it will give me a
> directory error, of course, because the port install on my FreeBSD-5.2.1
> box setup the user with nologin and nonexistant home directory:
>
> esmtp# su - cyrus -c "/usr/local/cyrus/bin/reconstruct notspam"
> su: no directory
>
> Can someone offer advice on how to get this command the script is trying
> to execute working? Maybe I don't need to be using the 'cyrus' user to
> do this?

Robert,
  If you don't use the "-" in "su - " it won't try to find the environment
of the account you're specifying (cyrus, in this case), so you don't need
to have a home directory.  Of course, you need to make sure that the
environment where you run that has what you need.  I believe that you do
need to use the cyrus user, just try it like:
  su cyrus -c "/usr/local/cyrus/bin/reconstruct notspam"

Good luck.
--
andrew caird
---
Home Page: http://asg.web.cmu.edu/cyrus
Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list