Re: [Courier-imap] UID/GID Errors with 4.3.0

2008-01-16 Thread Roddie Hasan
Brian,

Going by Sam's reply, this seemed to be an intentional change in 4.3.0 for 
a sanity check.  I've already fixed-up my system by making the login 
groups match the homedir groups for the affected user.

I would still like to go through the exercise here for my own sanity, 
though.  :-)

 Jan 12 16:35:08 krweb authdaemond: Authenticated: sysusername=roddie,
 sysuserid=null, sysgroupid=20, homedir=/home/roddie, address=roddie,
 fullname=Roddie Hasan, maildir=null, quota=null, options=null

 OK, next check for HAVE_INITGROUPS in numlib/config.h

It's defined to 1.

 Could you explain that last bit? How exactly are you running imapd? The
 group-changing code will only be invoked if imapd is running initially as
 root, and is changing the account to settings returned by courier-authlib

That's what I would have figured, too - I am simply typing imapd, (which 
is not suid/sgid).

Example when login GID does not match Maildir GID:

% id
uid=1037(yawnto) gid=20(staff) groups=20(staff),1002(users)

% ls -ald Maildir/
drwx--  17 yawnto  users  512 Nov  5 12:17 Maildir/

% imapd
* BYE [ALERT] Fatal error: Account's mailbox directory is not owned by the 
correct uid or gid: No such file or directory

When the above GIDs do match (ie. I put yawnto back into users):

% imapd
* PREAUTH Ready.
INFO: LOGIN, user=yawnto, ip=[127.0.0.1], port=[0], protocol=IMAP


Regards,
Roddie

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap


Re: [Courier-imap] UID/GID Errors with 4.3.0

2008-01-16 Thread Brian Candler
On Wed, Jan 16, 2008 at 05:57:12AM -0600, Roddie Hasan wrote:
 Jan 12 16:35:08 krweb authdaemond: Authenticated: sysusername=roddie,
 sysuserid=null, sysgroupid=20, homedir=/home/roddie, address=roddie,
 fullname=Roddie Hasan, maildir=null, quota=null, options=null
 
 OK, next check for HAVE_INITGROUPS in numlib/config.h
 
 It's defined to 1.
 
 Could you explain that last bit? How exactly are you running imapd? The
 group-changing code will only be invoked if imapd is running initially as
 root, and is changing the account to settings returned by courier-authlib
 
 That's what I would have figured, too - I am simply typing imapd, (which 
 is not suid/sgid).

That's what confused me - firstly you showed courier-authlib logs showing
the account being authenticated, but then you said that you're running imapd
directly from the command line (which doesn't perform any authentication at
all, nor change user or groups, so this is a red herring)

 Example when login GID does not match Maildir GID:
 
 % id
 uid=1037(yawnto) gid=20(staff) groups=20(staff),1002(users)
 
 % ls -ald Maildir/
 drwx--  17 yawnto  users  512 Nov  5 12:17 Maildir/
 
 % imapd
 * BYE [ALERT] Fatal error: Account's mailbox directory is not owned by the 
 correct uid or gid: No such file or directory

OK, I see there's an explicit check for this in imap/imapd.c:

if ( buf.st_uid != geteuid() ||
 buf.st_gid != getegid())
write_error_exit(Account's mailbox directory is not 
owned by the correct uid or gid);

I've also seen Sam's reply.

I can see where he's coming from - if you're going to use supplementary
groups then you need to know what you're doing (e.g. use the sticky bit to
ensure that the files created inside are owned by the directory's own group,
rather than the user's primary group)

But for other users, this whole gid check is superfluous: e.g. mode 700 is
perfectly legitimate and often appropriate for a Maildir, in which case it
doesn't matter what group is assigned.

As Sam says - you can always kill the check.

Regards,

Brian.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap


[Courier-imap] -ERR pop3login requires exactly two arguments

2008-01-16 Thread Jesse Vollmar
I recently configured a new mailserver an everything was working. About a
month after finishing the setup, pop3d started throwing an error:
# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
-ERR pop3login requires exactly two arguments.
Connection closed by foreign host.

I get no signs of errors in any logs.

Jesse Vollmar
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap


Re: [Courier-imap] -ERR pop3login requires exactly two arguments

2008-01-16 Thread Sam Varshavchik

Jesse Vollmar writes:


« HTML content follows »
I recently configured a new mailserver an everything was working. About a 
month after finishing the setup, pop3d started throwing an error: 
# telnet localhost 110

Trying 127.0.0.1...
Connected to localhost. 
Escape character is '^]'.

-ERR pop3login requires exactly two arguments.
Connection closed by foreign host.

I get no signs of errors in any logs. 


Somebody modified Courier's startup script, or replaced Courier's startup 
script with some ancient monstrosity they found somewhere else on the Net, 
which was for an older version of Courier and does not work with the current 
version, or there was a problem upgrading Courier.


Reinstall Courier, following the instructions in INSTALL.




pgpgrJOsQ0Qeu.pgp
Description: PGP signature
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap


Re: [Courier-imap] -ERR pop3login requires exactly two arguments

2008-01-16 Thread Jesse Vollmar
Forgot to mention that I am on a gentoo system and use portage ebuilds to
install. I did reinstall with portage with no luck.

Jesse Vollmar
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap