# cyrus imap issue; can't su cyrus

## dogghaus

I'm trying to reconstruct my mailbox after reloading my cyrus/postfix server from redhat to gentoo.  Problem is, I try to su - cyrus to do this, and it does not work.  Here is the excerpt from the log file:

Jan  7 17:09:53 mail su(pam_unix)[8509]: session opened for user cyrus by root(uid=0)

Jan  7 17:09:53 mail su(pam_unix)[8509]: session closed for user cyrus

So, it does not want to stay open.  I am using ldap to authenticate cyrus-imapd, I can log in fine to create mailboxes, but no luck trying to switch to cyrus as a local user.  Also, a local user I created can su to fine.  I am not using ldap for system authentication (yet), and the cyrus admin user is not cyrus.  So, all users are fine except for the local cyrus user.  When I run "passwd cyrus," I get:

passwd: Authentication token manipulation error

I have never had this problem on other OS's.  Any ideas?

----------

## steveb

do you get any output from the following command:

```
grep ^cyrus /etc/passwd
```

if you don't get any output, then you need to execute:

```
useradd -c cyrus -d /usr/cyrus -g mail -s /bin/false -u 96 cyrus
```

cheers

SteveB

----------

## dogghaus

Thanks for the reply, but I found the problem.  In teh /etc/passwd, the cyrus login shell was /bin/false; I can't attest that it was different on any other machine I tried, but when I changed this to /bin/bash, it worked, and I could reconstruct the mailbox.  Strange.  Is there some setting somewhere that will allow root to log in as a user with this shell (non-shell)?

----------

## steveb

/bin/false is /bin/false, even for root  :Wink: 

cheers

SteveB

----------

## dogghaus

I wonder what is going on that it won't allow the su based on that.  From your original reply it seems that setting is correct for cyrus (I've never noticed), so it must be something on my machine that is not configured correctly, or the fact that cyrus was configured with ldap and pam as USE statements that tweaked it somehow.  Well, that is what my test machine is for, although I guarantee my afternoon would have been slightly less hectic had I tested it fully yesterday.  At least all is well now.

Thanks again, I'll post an answer here if I find out what happened.

----------

## Tripwire

I'm sure I jsut set it up wrong, but I'm completely lost here. I'm trying to setup Cyrus imapd and pop3d. I have emerged the packages, and they respond properly to requests, but they don't let me in.   :Crying or Very sad:    For example:

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

+OK thedungeon Cyrus POP3 v2.1.15 server ready <4112046213.1074275444@thedungeon>

user dan

+OK Name is a valid mailbox

pass <hidden>

-ERR [SYS/PERM] Unable to open maildrop            

I even tried stracing the daemon to see where it was trying to look and I cannot see that it is trying to open the mail box at all.

Maybe I'm going about this all wrong. The end reuslt I need is a working pop3d/imapd that will read/write maildir format.     :Question: 

Any help is greatly appreciated! Perhaps pointing me to a howto that explains setting up this on Gentoo.

----------

## arctic_import

tripwire:  Cyrus Imap doesn't do maildir you're looking for courier-imap.  Not Cyrus.

----------

## Tripwire

 *arctic_import wrote:*   

> tripwire:  Cyrus Imap doesn't do maildir you're looking for courier-imap.  Not Cyrus.

 

Oh DOH!   :Embarassed:   Thanks! I'll try that one :>

Hmmm. Unmerged cyrus-imapd and cyrus-sasl, then emerged courier-imapd. It went in fine, I made the config changes I could see, like pointing MAILDIR to ${HOME}/.mail/ which is where people will have their mail, but it's not working.  Maybe I don't understand how to configure the system, but I cannot log in. I started the pop3 daemon, and watch:

thedungeon etc # /etc/init.d/courier-pop3d start

 * Starting courier-pop3d...                                              [ ok ]

thedungeon etc # telnet localhost 110

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

+OK Hello there.

user dan

+OK Password required.

pass <hidden>

-ERR Login failed.

 :Confused: 

I *KNOW* my password was correct. Why can I not login? What did I miss?

 :Confused: 

----------

## Tripwire

Ok.  I'm getting closer I think. I tweaked things a bit more, and now I think I'm almost there. I am having one problem still though...

I have the mail system set to deliver to $HOME/.mail/inbox/ for the inbound maildir. But I cann't figure out how to make courier-pop3d become the user so things like ~/ or $HOME will log the user into their home directory. As it is, setting Maildir to ~/.mail/ results in the systme trying to open /root/.mail when I login as dan.

----------

