[ I've taken this off-list since (a) you seem to be the only person helping,
and (b) debugging scripts isn't really on-topic. :-) ]
* Jörgen Persson <[EMAIL PROTECTED]> [010320 19:04]:
> You can rewind by saving FD3 to an ordinary file. Try this example:
Great!
> I don't know if you mind the file /tmp/pwd or if it is possible to get
> rid of it at all but pop is insecure anyway -- don't forget to create a
> unique file instead (and to remove it after the session).
Right.
> I had the same problem with $HOME/Maildir when I started qmail-pop3d by
> itself...
>
> This example isn't all good since qmail-pop3d terminates directly :)
Here's the latest:
#!/bin/sh
exec 0<&3
cat>/tmp/auth.info
exec 3</tmp/auth.info
/usr/local/vpopmail/bin/vchkpw qmail-pop3d Maildir/
rc=$?
echo "rc1: $rc" >> /tmp/debug
if [ $rc -ne 0 ]; then
echo "vpopmail failed" >> /tmp/debug
exec 3</tmp/auth.info
exec /usr/bin/checkvpw qmail-pop3d Maildir/
else
exec 3</tmp/auth.info
exec /usr/local/vpopmail/bin/vchkpw qmail-pop3d Maildir/
fi
echo "exit: $rc" >> /tmp/debug
exit "$rc"
Obviously, the ``echo "exit:...'' line and following are never reached,
since both conditions of the if-else result in an exec. So it probably isn't
needed. However, I cannot get an interactive POP session at all. Here's what
happens when I use a vpopmail/vchkpw user:
(pcg@rome) ~> telnet localhost 1100
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK <[EMAIL PROTECTED]>
user [EMAIL PROTECTED]
+OK
pass <censored>
+OK
+OK
Connection closed by foreign host.
[log]
rc1: 0
And here's what happens when I use a vmailmgr/checkvpw user:
(pcg@rome) ~> telnet localhost 1100
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK <[EMAIL PROTECTED]>
user [EMAIL PROTECTED]
+OK
pass st0rmfel
+OK
Connection closed by foreign host.
[log]
rc1: 3
vpopmail failed
Both times, authentication succeeds, but the connection just dies. Any other
ideas?
BTW, I am really sorry if this is easy stuff, or if I'm wasting your time.
If you need to be doing something else, please let me know and I'll leave
you alone. Otherwise, thank you a whole bunch for your patience! :-)
/pg
--
Peter Green : Gospel Communications Network, SysAdmin : [EMAIL PROTECTED]
---
Sometimes when I feel like killing someone, I do a little trick to calm myself
down. I'll go over to the persons house and ring the doorbell. When the person
comes to the door, I'm gone, but you know what I've left on the porch? A
jack-o-lantern with a knife stuck in the side of it's head with a note that
says: 'You.' After that I usually feel a lot better, and no harm done.
(Jack Handey)