On Sat, 2007-07-14 at 21:04 +0100, Brian Candler wrote:
> > 
> > # ls -ld /home/test501/Maildir/*
> > drwx------ 2 test501 test501 4096 2007-07-14
> > 13:39 /home/test501/Maildir/cur
> > drwx------ 2 test501 test501 4096 2007-07-14
> > 13:40 /home/test501/Maildir/new
> > drwx------ 2 test501 test501 4096 2007-07-14
> > 13:39 /home/test501/Maildir/tmp
> 
> OK, looks reasonable.
> 
> Just a long shot - you don't happen to have two users with different uids
> called 'test501'? That caught me out once upon a time, a long time ago :-)
> 
> "ls -lnd" to be 100% sure.

Nope, these are actually the only two non-system accounts on the
machine:

# ls -lnd /home/test500/Maildir/
drwx------ 6 500 500 4096 2007-07-16 08:25 /home/test500/Maildir/

# ls -lnd /home/test501/Maildir/
drwx------ 6 501 501 4096 2007-07-16 08:25 /home/test501/Maildir/


> 
> > Also, both users can login over ssh and traverse everywhere in their
> > Maildir, touch files, etc.  I created a test499 user at one point and he
> > had the same problems as 501.  Something definitely seems amiss, unless
> > I have simply been staring at things too long.
> 
> Hmm, another thing to check is that you are running courier-imap as root,
> not as user test500.
> 
>     ps auxwww | grep tcpd

Running as root:

# ps auxwww | grep tcpd
root      4744  0.0  0.0   1724   420 ?        S    Jul13
0:00 /usr/sbin/courierlogger -pid=/var/run/imapd.pid -start
-name=imapd /usr/lib/courier-imap/libexec/couriertcpd -address=0
-maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup
143 /usr/lib/courier-imap/sbin/imaplogin /usr/lib/courier-imap/bin/imapd
Maildir
root      4745  0.0  0.0   1836   548 ?        S    Jul13
0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40
-maxperip=4 -nodnslookup -noidentlookup
143 /usr/lib/courier-imap/sbin/imaplogin /usr/lib/courier-imap/bin/imapd
Maildir
root      4753  0.0  0.0   1728   340 ?        S    Jul13
0:00 /usr/sbin/courierlogger -pid=/var/run/imapd-ssl.pid -start
-name=imapd-ssl /usr/lib/courier-imap/libexec/couriertcpd -address=0
-maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup
993 /usr/lib/courier-imap/bin/couriertls -server
-tcpd /usr/lib/courier-imap/sbin/imaplogin /usr/lib/courier-imap/bin/imapd 
Maildir
root      4754  0.0  0.0   1836   528 ?        S    Jul13
0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40
-maxperip=4 -nodnslookup -noidentlookup
993 /usr/lib/courier-imap/bin/couriertls -server
-tcpd /usr/lib/courier-imap/sbin/imaplogin /usr/lib/courier-imap/bin/imapd 
Maildir
root      4761  0.0  0.0   1724   336 ?        S    Jul13
0:00 /usr/sbin/courierlogger -pid=/var/run/pop3d.pid -start
-name=pop3d /usr/lib/courier-imap/libexec/couriertcpd -address=0
-maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup
110 /usr/lib/courier-imap/sbin/pop3login /usr/lib/courier-imap/bin/pop3d
Maildir
root      4762  0.0  0.0   1832   528 ?        S    Jul13
0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40
-maxperip=4 -nodnslookup -noidentlookup
110 /usr/lib/courier-imap/sbin/pop3login /usr/lib/courier-imap/bin/pop3d
Maildir
root      4769  0.0  0.0   1724   336 ?        S    Jul13
0:00 /usr/sbin/courierlogger -pid=/var/run/pop3d-ssl.pid -start
-name=pop3d-ssl /usr/lib/courier-imap/libexec/couriertcpd -address=0
-maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup
995 /usr/lib/courier-imap/bin/couriertls -server
-tcpd /usr/lib/courier-imap/sbin/pop3login /usr/lib/courier-imap/bin/pop3d 
Maildir
root      4770  0.0  0.0   1832   528 ?        S    Jul13
0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40
-maxperip=4 -nodnslookup -noidentlookup
995 /usr/lib/courier-imap/bin/couriertls -server
-tcpd /usr/lib/courier-imap/sbin/pop3login /usr/lib/courier-imap/bin/pop3d 
Maildir



> 
> Otherwise, the next thing to do is to run imapd directly as the user, rather
> than logging in via TCP/IP. You do this by ssh'ing in as that user, then
> running:
> 
> $ /path/to/imapd Maildir
> 
> This should give you an active IMAP session, bypassing the login phase. Or
> it might give you the same 'permission' error you were talking about.


This worked perfectly for both users.  I was able to get in as test501
with no issues:

imapd /home/test501/Maildir
* PREAUTH Ready.
INFO: LOGIN, user=test501, ip=[127.0.0.1], protocol=IMAP
ab select inbox
* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)] Limited
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1184588749] Ok
* OK [MYRIGHTS "acdilrsw"] ACL
ab OK [READ-WRITE] Ok
ab status inbox (messages)
* STATUS "inbox" (MESSAGES 0)
ab OK STATUS Completed.
ab create inbox.test1    
ab OK "inbox.test1" created.
ab logout
* BYE Courier-IMAP server shutting down
ab OK LOGOUT completed
INFO: LOGOUT, user=test501, ip=[127.0.0.1], headers=0, body=0, rcvd=114,
sent=562, time=255

> 
> In the latter case, you then run the same command again but prefix with
> 'strace', and you'll see exactly what file it's trying to access and

<snip>

> P.S. Another thought: if you're running a system with selinux, you could try
> turning it off.

No selinux.


Thanks for all the help.  This seems to keep pointing back to PAM.

-Jeff




-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to