Re: [vchkpw] IP Domains and Courier IMAP

2002-10-24 Thread Bill Shupp
On Thursday, October 24, 2002, at 01:54  PM, Rick Macdougall wrote:


Hi All,

Does anyone have IP Domains (ie just user instead of userdomain) and
courier-imap working together with any version of vpopmail and 
courier-imap?
I think from my testing that it's just plain broken, but I'd like to 
hear if
any does have it working.

Oh, forgot to mention, using couriertcpd to launch imapdlogin, not 
using
tcpserver.  tcpserver works but it doesn't drop from root to the 
localuser.

I don't see any ip alias domains support in 
http://www.inter7.com/vpopmail/preauthvchkpw.c.  That's probably why it 
doesn't work.  ; )  You could add it pretty easily... just use vchkpw.c 
as an example.

Bill




Re: [vchkpw] IP Domains and Courier IMAP

2002-10-24 Thread Rick Macdougall
Hi Bill,

Original response below, but one question... Why does it work when using
tcpserver  (but I'll still take a look a preauthvchkpw.c)

ie
tcpserver -R -t 2 -g 89 -u 89 0 110 /usr/lib/courier-imap/sbin/pop3login \
/usr/lib/courier-imap/libexec/authlib/authvchkpw
/usr/lib/courier-imap/bin/pop3d Maildir

Thanks for the response.  It feels so good when I stop banging my head.

Not much of a C programmer anymore, but I'll whip out my old books and see
what I can do in the next couple of hours.

Thanks again for the response, that helps greatly.

Regards,

Rick

- Original Message -
From: Bill Shupp [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 6:16 PM
Subject: Re: [vchkpw] IP Domains and Courier IMAP


On Thursday, October 24, 2002, at 01:54  PM, Rick Macdougall wrote:

 Hi All,

 Does anyone have IP Domains (ie just user instead of user@domain) and
 courier-imap working together with any version of vpopmail and
 courier-imap?
 I think from my testing that it's just plain broken, but I'd like to
 hear if
 any does have it working.

 Oh, forgot to mention, using couriertcpd to launch imapdlogin, not
 using
 tcpserver.  tcpserver works but it doesn't drop from root to the
 localuser.

I don't see any ip alias domains support in
http://www.inter7.com/vpopmail/preauthvchkpw.c.  That's probably why it
doesn't work.  ; )  You could add it pretty easily... just use vchkpw.c
as an example.

Bill







Re: [vchkpw] IP Domains and Courier IMAP

2002-10-24 Thread Bill Shupp
On Thursday, October 24, 2002, at 03:27  PM, Rick Macdougall wrote:


Hi Bill,

Original response below, but one question... Why does it work when 
using
tcpserver  (but I'll still take a look a preauthvchkpw.c)

ie
tcpserver -R -t 2 -g 89 -u 89 0 110 
/usr/lib/courier-imap/sbin/pop3login \
/usr/lib/courier-imap/libexec/authlib/authvchkpw
/usr/lib/courier-imap/bin/pop3d Maildir

Thanks for the response.  It feels so good when I stop banging my head.

Not much of a C programmer anymore, but I'll whip out my old books and 
see
what I can do in the next couple of hours.

Thanks again for the response, that helps greatly.

Regards,

Rick

Well, I spoke too quickly.  I'm looking at it now, and it looks like 
that occurs in vauth_getpw(), so it should work.  (note to self:  check 
answer BEFORE hitting send).  I'm going to run some tests, but my hunch 
is that it may be related to getting the IP from couriertcpd.  I'll 
post my findings shortlly.

Regards,

Bill Shupp




Re: [vchkpw] IP Domains and Courier IMAP

2002-10-24 Thread Bill Shupp
On Thursday, October 24, 2002, at 03:27  PM, Rick Macdougall wrote:


Hi Bill,

Original response below, but one question... Why does it work when 
using
tcpserver  (but I'll still take a look a preauthvchkpw.c)

ie
tcpserver -R -t 2 -g 89 -u 89 0 110 
/usr/lib/courier-imap/sbin/pop3login \
/usr/lib/courier-imap/libexec/authlib/authvchkpw
/usr/lib/courier-imap/bin/pop3d Maildir

Thanks for the response.  It feels so good when I stop banging my head.

Not much of a C programmer anymore, but I'll whip out my old books and 
see
what I can do in the next couple of hours.

Thanks again for the response, that helps greatly.

Regards,

Rick

Are you using authdaemon?  I know for sure that this will not work.  If 
so, try again without it (--without-authdaemon).  I'm rebuilding 
courier-imap to run some tests, and see if there's a problem with the 
IP formatting (IPV6) of TCPLOCALIP that couriertcpd sets (as suggested 
offlist by Vladimir Kabanov).

Regards,

Bill




Re: [vchkpw] IP Domains and Courier IMAP

2002-10-24 Thread Bill Shupp
On Thursday, October 24, 2002, at 05:31  PM, Bill Shupp wrote:


On Thursday, October 24, 2002, at 03:27  PM, Rick Macdougall wrote:


Hi Bill,

Original response below, but one question... Why does it work when 
using
tcpserver  (but I'll still take a look a preauthvchkpw.c)

ie
tcpserver -R -t 2 -g 89 -u 89 0 110 
/usr/lib/courier-imap/sbin/pop3login \
/usr/lib/courier-imap/libexec/authlib/authvchkpw
/usr/lib/courier-imap/bin/pop3d Maildir

Thanks for the response.  It feels so good when I stop banging my 
head.

Not much of a C programmer anymore, but I'll whip out my old books 
and see
what I can do in the next couple of hours.

Thanks again for the response, that helps greatly.

Regards,

Rick

Are you using authdaemon?  I know for sure that this will not work.  
If so, try again without it (--without-authdaemon).  I'm rebuilding 
courier-imap to run some tests, and see if there's a problem with the 
IP formatting (IPV6) of TCPLOCALIP that couriertcpd sets (as suggested 
offlist by Vladimir Kabanov).

Ok, Vladimir was right, TCPLOCALIP is in IPv6 from couriertcpd.  So, I 
just converted it in host_in_locals(), and now authvchkpw works.  
However, authdaemon still will NOT work, since TCPLOCALIP does not get 
passed to authvchkpw.  The patch below applies to 5.3.11 (available at 
http://shupp.org only right now), but you may be able to apply it to 
your version with little effort.  Let me know if this works for you.

Regards,

Bill Shupp

--- ../vpopmail-5.3.11/vpopmail.c   Wed Oct 23 13:01:40 2002
+++ vpopmail.c  Thu Oct 24 17:38:40 2002
 -1668,6 +1668,14 

 #ifdef IP_ALIAS_DOMAINS
   tmpstr = getenv(TCPLOCALIP);
+
+  /* courier-imap uses IPv6 */
+  if ( tmpstr != NULL   tmpstr[0] == ':') {
+tmpstr +=2;
+while(*tmpstr!=':') ++tmpstr;
+++tmpstr;
+  }
+
   memset(host,0,156);
   if ( vget_ip_map(tmpstr,host,156)==0  !host_in_locals(host)){
 if ( strlen(host)  0 ) {




Re: [vchkpw] IP Domains and Courier IMAP

2002-10-24 Thread Rick Macdougall
Hi Bill,

I'm running 5.3.8 and I am running without authdaemon
(ie --without-authdaemon).  I'll try the patch later on tonight or first
thing in the morning (I have little one's to put to bed now).

Thanks for the help.

Regards,

Rick

- Original Message -
From: Bill Shupp [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 8:48 PM
Subject: Re: [vchkpw] IP Domains and Courier IMAP


On Thursday, October 24, 2002, at 05:31  PM, Bill Shupp wrote:

 On Thursday, October 24, 2002, at 03:27  PM, Rick Macdougall wrote:

 Hi Bill,

 Original response below, but one question... Why does it work when
 using
 tcpserver  (but I'll still take a look a preauthvchkpw.c)

 ie
 tcpserver -R -t 2 -g 89 -u 89 0 110
 /usr/lib/courier-imap/sbin/pop3login \
 /usr/lib/courier-imap/libexec/authlib/authvchkpw
 /usr/lib/courier-imap/bin/pop3d Maildir

 Thanks for the response.  It feels so good when I stop banging my
 head.

 Not much of a C programmer anymore, but I'll whip out my old books
 and see
 what I can do in the next couple of hours.

 Thanks again for the response, that helps greatly.

 Regards,

 Rick

 Are you using authdaemon?  I know for sure that this will not work.
 If so, try again without it (--without-authdaemon).  I'm rebuilding
 courier-imap to run some tests, and see if there's a problem with the
 IP formatting (IPV6) of TCPLOCALIP that couriertcpd sets (as suggested
 offlist by Vladimir Kabanov).

Ok, Vladimir was right, TCPLOCALIP is in IPv6 from couriertcpd.  So, I
just converted it in host_in_locals(), and now authvchkpw works.
However, authdaemon still will NOT work, since TCPLOCALIP does not get
passed to authvchkpw.  The patch below applies to 5.3.11 (available at
http://shupp.org only right now), but you may be able to apply it to
your version with little effort.  Let me know if this works for you.

Regards,

Bill Shupp

--- ../vpopmail-5.3.11/vpopmail.c   Wed Oct 23 13:01:40 2002
+++ vpopmail.c  Thu Oct 24 17:38:40 2002
@@ -1668,6 +1668,14 @@

  #ifdef IP_ALIAS_DOMAINS
tmpstr = getenv(TCPLOCALIP);
+
+  /* courier-imap uses IPv6 */
+  if ( tmpstr != NULL   tmpstr[0] == ':') {
+tmpstr +=2;
+while(*tmpstr!=':') ++tmpstr;
+++tmpstr;
+  }
+
memset(host,0,156);
if ( vget_ip_map(tmpstr,host,156)==0  !host_in_locals(host)){
  if ( strlen(host)  0 ) {