Re: [vchkpw] debugging vchkpw?

2003-08-21 Thread Charles Sprickman
On Wed, 20 Aug 2003, John P. Looney wrote:

  Any ideas why this could happen ? Is there docs on running vchkpw so I
 could see how it works ? Yes, the code does have bits  pieces like;

  printf(vchkpw: what the hell are you doing running vchkpw on the
 command line!! It's only for talking with qmail-popup and
 qmail-pop3d.\n);

Yep.  I was trying to figure something out and thought to myself if I
could run vchkpw from the command line, that would be helpful and I got a
similar, but more terse message.  If I'd have gotten that one, I would
have started yelling back at it. :)

Charles


 John





Re: [vchkpw] debugging vchkpw?

2003-08-20 Thread Peter Palmreuther
Hi John,

On 20 Aug 2003 10:23:00 +0100 John P. Looney wrote:

  I have a vpopmail server that's been running fine for over a year.
 
  Now, it's refusing to authenticate people;
[...]
  Any ideas why this could happen ? 

No.

 Is there docs on running vchkpw so I could see how it works ? Yes, the
 code does have bits  pieces like;
 
  printf(vchkpw: what the hell are you doing running vchkpw on the
 command line!! It's only for talking with qmail-popup and
 qmail-pop3d.\n);

printf [EMAIL PROTECTED] | \
 strace -f -s 4096 -o /tmp/vchkpw.log ~vpopmail/bin/vchkpw /bin/true 30

and search for a chdir system call in '/tmp/vchkpw.log'.
If you're not on Linux but e.g. *BSD use 'truss' or anything else that
enables you to trace system calls.
-- 
Ciao,
 Pit



Re: [vchkpw] debugging vchkpw?

2003-08-20 Thread John P. Looney
On Wed, 2003-08-20 at 10:37, Peter Palmreuther wrote:
  Is there docs on running vchkpw so I could see how it works ? Yes, the
  code does have bits  pieces like;
  
   printf(vchkpw: what the hell are you doing running vchkpw on the
  command line!! It's only for talking with qmail-popup and
  qmail-pop3d.\n);
 
 printf [EMAIL PROTECTED] | \
  strace -f -s 4096 -o /tmp/vchkpw.log ~vpopmail/bin/vchkpw /bin/true 30
 
 and search for a chdir system call in '/tmp/vchkpw.log'.
 If you're not on Linux but e.g. *BSD use 'truss' or anything else that
 enables you to trace system calls.

 Thanks for a speedy reply!

 OK, as expected, that looks like it's working fine;

6485  chdir(/hsphere/local/var/vpopmail/domains/hosting365.ie) = 0
6485  getcwd(/var/vpopmail/domains/hosting365.ie, 156) = 36
6485  getpid()  = 6485
6485  brk(0x8057000)= 0x8057000
6485  open(/hsphere/local/var/vpopmail/domains/hosting365.ie/vpasswd.cdb, O_RDONLY) 
= 4

 down the end, it has;

6485  munmap(0x40015000, 4096)  = 0
6485  getpid()  = 6485
6485  rt_sigaction(SIGPIPE, {0x420e46e0, [], 0x400}, {SIG_DFL}, 8) = 0
6485  socket(PF_UNIX, SOCK_DGRAM, 0)= 4
6485  fcntl64(4, F_SETFD, FD_CLOEXEC)   = 0
6485  connect(4, {sin_family=AF_UNIX, path=/dev/log}, 16) = 0
6485  send(4, 21Aug 20 10:42:22 vpopmail[6485]: vchkpw: password fail [EMAIL 
PROTECTED]:, 77, 0) = 77
6485  rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
6485  _exit(3)  = ?

 Which, as I mentioned is strange, as courier imap authenticates off the same vpasswd 
file...

John



Re: [vchkpw] debugging vchkpw?

2003-08-20 Thread John P. Looney

 No, I'm a fool. I had a typo in the password I'd fed to vchkpw on the
command line. I re-did it with the write password (again, the chdir
works) but toward the end is;

25765 munmap(0x40015000, 4096)  = 0
25765 time(NULL)= 1061373355
25765 open(/hsphere/local/var/vpopmail/etc/open-smtp.lock,
O_RDWR|O_CREAT|O_TRUNC, 0666) = 4
25765 fcntl64(4, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0,
len=0}) = 0
25765 open(/hsphere/local/var/vpopmail/etc/open-smtp, O_RDWR) = 5
25765 getpid()  = 25765
25765 open(/hsphere/local/var/vpopmail/etc/open-smtp.tmp.25765,
O_RDWR|O_CREAT|O_TRUNC, 0666) = 6
25765 fcntl64(4, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0,
len=0}) = 0
25765 close(4)  = 0
25765 getuid32()= 0

 So, it looks like that's working  logging in fine, even updating the
pop before smtp database.

 Ominously, there is a file fix.sh in the vpopmail server I've never
considered before, which may be a remnant of a previous sysadmin. Is
this a standard tool ?

John



Re: [vchkpw] debugging vchkpw?

2003-08-20 Thread John P. Looney
On Wed, 2003-08-20 at 10:57, John P. Looney wrote:
  So, it looks like that's working  logging in fine, even updating the
 pop before smtp database.

 I should have pointed out, that although running vchkpw from the
command line works fine, it still gives;

-ERR this user has no $HOME/Maildir

 when I login. Is there a next step in debugging vpopmail you could
recommend ?

John



Re: [vchkpw] debugging vchkpw?

2003-08-20 Thread Peter Palmreuther
Hi John,

On 20 Aug 2003 11:30:44 +0100 John P. Looney wrote:

  So, it looks like that's working  logging in fine, even updating the
 pop before smtp database.
 
  I should have pointed out, 

You primarilly should have pointed out the relevant parts from strace
log. 'open-stmp' is irrelevant if you're searching for a problem related
to the users Maildir.

Nevertheless:

 that although running vchkpw from the command line works fine, it
 still gives;
 
 -ERR this user has no $HOME/Maildir

What makes you think vchkpw gives this error?
In fact it is qmail-pop3d that does.

Check the qmail-pop3d invokation line. It has to be 

qmail-popup HOSTNAME!!! Password-Checker qmail-pop3d maildirname

Additionally try this:

 printf [EMAIL PROTECTED] | \
  ~vpopmail/bin/vchkpw \
  /bin/sh -c 'id; echo; stat $HOME/Maildir' 30

and see if the UID given by 'id' command has correct permissions to
'$HOME/Maildir'.

 Is there a next step in debugging vpopmail you could recommend ?

Yes. Beside the steps above that give some information I'd sit down an
hour or two and heavily think about what has changed on the system.
You wrote:

   I have a vpopmail server that's been running fine for over a year.
 
   Now, it's refusing to authenticate people;

And this gives exactly /ONE/ conclusion: something was changed. Else
behavior wouldn't have.

I've quickly searched qmail sources and there are /EXACTLY/ two
conditions when this error is triggered:

1.) No 'Maildir/' (or other directory name) at the end of qmail-pop3d
invocation
2.) No permissions to 'chdir' to this given directory.
-- 
Ciao,
 Pit