From anders@totem.fix.no  Sun Jan  7 14:14:54 2001
Return-Path: <anders@totem.fix.no>
Received: from totem.fix.no (totem.fix.no [213.142.66.130])
	by hub.freebsd.org (Postfix) with ESMTP id AA75837B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Jan 2001 14:14:53 -0800 (PST)
Received: by totem.fix.no (Postfix, from userid 1000)
	id 3F6213C9A; Sun,  7 Jan 2001 23:14:52 +0100 (CET)
Message-Id: <20010107221452.3F6213C9A@totem.fix.no>
Date: Sun,  7 Jan 2001 23:14:52 +0100 (CET)
From: Anders Nordby <anders@fix.no>
Sender: anders@totem.fix.no
Reply-To: Anders Nordby <anders@fix.no>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Update port: mail/imap-uw
X-Send-Pr-Version: 3.2

>Number:         24135
>Category:       ports
>Synopsis:       Update port: mail/imap-uw
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 07 14:20:01 PST 2001
>Closed-Date:    Thu Mar 22 19:04:26 PST 2001
>Last-Modified:  Thu Mar 22 19:04:43 PST 2001
>Originator:     Anders Nordby
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Fluxpod Information eXchange
>Environment:

FreeBSD eggsilo.localnet 4.2-STABLE FreeBSD 4.2-STABLE #0: Sun Dec 17 19:09:13 CET 2000     root@eggsilo.localnet:/space/tmp/obj/usr/src/sys/EGGSILO  i386

>Description:

* Update the imap-uw port to use PAM again, as it used to. We do have imap by
default in /etc/pam.conf, so it must be better to compile imap-uw with PAM
authentication too no?
* Changed the PAM service name for the POP3 daemon from pop to pop3 as that is
what we have in our default pam.conf.
* Update the port with optional DRAC support.

This adds the patches patch-ah and patch-ai.

>How-To-Repeat:

	

>Fix:

diff -Nur imap-uw.old/Makefile imap-uw/Makefile
--- imap-uw.old/Makefile	Tue Dec 26 23:27:23 2000
+++ imap-uw/Makefile	Sun Jan  7 21:45:52 2001
@@ -23,6 +23,9 @@
 MAINTAINER=	ports@FreeBSD.org
 
 LIB_DEPENDS=	c-client4.8:${PORTSDIR}/mail/cclient
+.if defined(WITH_DRAC)
+BUILD_DEPENDS=	${LOCALBASE}/lib/libdrac.a:${PORTSDIR}/mail/drac
+.endif
 
 Y2K=		http://www.washington.edu/imap/IMAP-FAQs/faqs.xml#general1
 
@@ -49,5 +52,15 @@
 		${WRKSRC}/src/imapd/imapd.8c ${PREFIX}/man/man8/imapd.8
 	${INSTALL_MAN} \
 		${WRKSRC}/src/ipopd/ipopd.8c ${PREFIX}/man/man8/ipopd.8
+
+.if defined(WITH_DRAC)
+post-install:
+	@${ECHO} "================================================================================"
+	@${ECHO} "To have DRAC working, you must create ${PREFIX}/etc/dracd.host, containing"
+	@${ECHO} "the hostname of the DRAC server:"
+	@${ECHO}
+	@${ECHO} "localhost"
+	@${ECHO} "================================================================================"
+.endif
 
 .include <bsd.port.post.mk>
diff -Nur imap-uw.old/files/patch-ab imap-uw/files/patch-ab
--- imap-uw.old/files/patch-ab	Wed Dec 20 23:03:54 2000
+++ imap-uw/files/patch-ab	Sun Dec 31 19:13:36 2000
@@ -1,5 +1,23 @@
---- src/osdep/unix/Makefile.orig	Tue Oct 31 13:55:01 2000
-+++ src/osdep/unix/Makefile	Sun Dec 17 23:39:05 2000
+--- src/osdep/unix/Makefile.old	Tue Oct 31 22:55:01 2000
++++ src/osdep/unix/Makefile	Sun Dec 31 19:11:17 2000
+@@ -23,7 +23,7 @@
+ EXTRAAUTHENTICATORS=
+ SPECIALAUTHENTICATORS=
+ EXTRADRIVERS=mbox
+-PASSWDTYPE=std
++PASSWDTYPE=pam
+ 
+ 
+ # Extended flags needed for non-standard passwd types.  You may need to modify.
+@@ -37,7 +37,7 @@
+ # AFSLDFLAGS may also need -L/usr/ucblib -lucb
+ DCECFLAGS= -DDCE_MINIMAL -DPASSWD_OVERRIDE=\"/opt/pop3/passwd/passwd\"
+ DCELDFLAGS= -ldce
+-PAMLDFLAGS= -lpam -ldl
++PAMLDFLAGS= -lpam
+ 
+ 
+ # Build parameters normally set by the individual port
 @@ -74,7 +74,7 @@
  # Commands possibly overriden by the individual port
  
diff -Nur imap-uw.old/files/patch-ac imap-uw/files/patch-ac
--- imap-uw.old/files/patch-ac	Wed Dec 20 23:03:54 2000
+++ imap-uw/files/patch-ac	Sun Jan  7 20:41:29 2001
@@ -1,6 +1,6 @@
---- src/imapd/Makefile.orig	Tue Oct 24 16:54:32 2000
-+++ src/imapd/Makefile	Sun Dec 17 23:44:22 2000
-@@ -18,30 +18,25 @@
+--- src/imapd/Makefile.old	Wed Oct 25 01:54:32 2000
++++ src/imapd/Makefile	Sun Dec 31 17:35:27 2000
+@@ -18,30 +18,31 @@
  # CPYRIGHT, included with this Distribution.
  
  
@@ -19,10 +19,16 @@
 +#CCLIENTLIB = $C/c-client.a
  CC = `cat $C/CCTYPE`
 -CFLAGS = -I$C `cat $C/CFLAGS` -DANOFILE=\"$(ANO)\" \
++.if defined(WITH_DRAC)
++CFLAGS = `cat $C/CFLAGS` -DANOFILE=\"$(ANO)\" -DETC_DIR=\"$(PREFIX)/etc\" \
++	-DALERTFILE=\"$(ALERT)\" -DUSERALERTFILE=\"$(USERALERT)\" -DDRAC_AUTH
++LDFLAGS = $(EXTRALDFLAGS) `cat $C/LDFLAGS` -ldrac
++.else
 +CFLAGS = `cat $C/CFLAGS` -DANOFILE=\"$(ANO)\" \
  	-DALERTFILE=\"$(ALERT)\" -DUSERALERTFILE=\"$(USERALERT)\"
 -LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
 +LDFLAGS = $(EXTRALDFLAGS) `cat $C/LDFLAGS`
++.endif
  
  all:	imapd
  
diff -Nur imap-uw.old/files/patch-ad imap-uw/files/patch-ad
--- imap-uw.old/files/patch-ad	Wed Dec 20 23:03:54 2000
+++ imap-uw/files/patch-ad	Sun Dec 31 19:07:48 2000
@@ -1,5 +1,5 @@
---- Makefile.orig	Thu Nov  2 13:04:11 2000
-+++ Makefile	Mon Dec 18 01:13:25 2000
+--- Makefile.old	Thu Nov  2 22:04:11 2000
++++ Makefile	Sun Dec 31 19:06:58 2000
 @@ -43,6 +43,7 @@
  # art	AIX 2.2.1 for RT
  # asv	Altos SVR4
@@ -8,6 +8,15 @@
  # bs3	BSD/i386 3.0 and higher
  # bsd	generic BSD 4.3 (as in ancient 1980s version)
  # bsf	FreeBSD
+@@ -153,7 +154,7 @@
+ # std	system standard (typically passwd file), determined by port
+ # two	try alternative (defined by CHECKPWALT), then std
+ 
+-PASSWDTYPE=std
++PASSWDTYPE=pam
+ 
+ 
+ # The following extra compilation flags are defined.  None of these flags are
 @@ -272,12 +273,12 @@
  #	gradually-increasing intervals, starting at 2800-2900, and becoming
  #	permanent at 48,300.
diff -Nur imap-uw.old/files/patch-af imap-uw/files/patch-af
--- imap-uw.old/files/patch-af	Mon Jul 17 10:47:06 2000
+++ imap-uw/files/patch-af	Sun Jan  7 20:41:43 2001
@@ -1,6 +1,6 @@
---- src/ipopd/Makefile.orig	Tue Apr 14 15:41:55 1998
-+++ src/ipopd/Makefile	Fri Jul  7 00:27:30 2000
-@@ -32,29 +32,22 @@
+--- src/ipopd/Makefile.old	Wed Oct 25 01:55:07 2000
++++ src/ipopd/Makefile	Sun Dec 31 18:23:16 2000
+@@ -19,29 +19,27 @@
  
  
  C = ../c-client
@@ -13,8 +13,13 @@
  CC = `cat $C/CCTYPE`
 -CFLAGS = -I$C `cat $C/CFLAGS`
 -LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
++.if defined(WITH_DRAC)
++CFLAGS = `cat $C/CFLAGS` -DDRAC_AUTH -DETC_DIR=\"$(PREFIX)/etc\"
++LDFLAGS = `cat $C/LDFLAGS` -ldrac
++.else
 +CFLAGS = `cat $C/CFLAGS`
 +LDFLAGS = `cat $C/LDFLAGS`
++.endif
  
  ipopd: ipop2d ipop3d
  
diff -Nur imap-uw.old/files/patch-ah imap-uw/files/patch-ah
--- imap-uw.old/files/patch-ah	Thu Jan  1 01:00:00 1970
+++ imap-uw/files/patch-ah	Sun Jan  7 21:41:00 2001
@@ -0,0 +1,83 @@
+--- src/ipopd/ipop3d.c.old	Wed Oct 25 01:15:46 2000
++++ src/ipopd/ipop3d.c	Sun Jan  7 21:40:25 2001
+@@ -35,6 +35,11 @@
+ #include <time.h>
+ #include "c-client.h"
+ 
++#ifdef DRAC_AUTH
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <stdlib.h>
++#endif /* DRAC_AUTH */
+ 
+ /* Autologout timer */
+ #define KODTIMEOUT 60*5
+@@ -61,6 +66,12 @@
+ 
+ /* Global storage */
+ 
++#ifdef DRAC_AUTH
++#define DRACTIMEOUT 10*60       /* check every 10 minutes */
++time_t lastdrac = 0;          /* time of last drac check */
++extern char *getenv ();
++#endif /* DRAC_AUTH */
++
+ char *version = "2000.69";	/* server version */
+ short state = AUTHORIZATION;	/* server state */
+ short critical = NIL;		/* non-zero if in critical code */
+@@ -104,7 +115,7 @@
+ #include "linkage.c"
+ 				/* initialize server */
+   server_init ((s = strrchr (argv[0],'/')) ? s + 1 : argv[0],
+-	       "pop3","pop3s","pop",clkint,kodint,hupint,trmint);
++	       "pop3","pop3s","pop3",clkint,kodint,hupint,trmint);
+   challenge[0] = '\0';		/* find the CRAM-MD5 authenticator */
+   if (i = mail_lookup_auth_name ("CRAM-MD5",NIL)) {
+     AUTHENTICATOR *a = mail_lookup_auth (i);
+@@ -692,6 +703,46 @@
+       }
+       sprintf (tmp,"+OK Mailbox open, %lu messages\015\012",nmsgs);
+       PSOUT (tmp);
++             {
++               #ifdef DRAC_AUTH
++                   if (time (0) > lastdrac + DRACTIMEOUT)
++                   {
++                       FILE *dracconf;
++                       char host[100];
++                       char *drachost;
++                       char *err;
++                       char *p;
++ 
++                       if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
++                       {
++                         syslog (LOG_INFO, "dracd: error opening /etc/mail/dracd.host config file");
++                         exit(1);
++                       }
++ 
++                       fgets(host, 100, dracconf);
++                       p = strchr(host, '\n');
++                       if(p != NULL)
++                         *p = '\0';
++                       fclose(dracconf);
++ 
++                       if( drachost = (host) )
++                       {
++                           struct sockaddr_in sin;
++                           int sinlen = sizeof (struct sockaddr_in);
++                           char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
++                             "UNKNOWN" : inet_ntoa (sin.sin_addr);
++ 
++                           lastdrac = time(0);
++ 
++                           if (dracauth(drachost, inet_addr(client), &err) != 0)
++                               syslog (LOG_INFO, err);
++                           else
++                               syslog (LOG_INFO, "dracd: authorized ip %s", client);
++                       }
++                   }
++               #endif /* DRAC_AUTH */
++             }
++
+       return TRANSACTION;
+     }
+     else sayonara = "-ERR Can't get lock.  Mailbox in use\015\012";
diff -Nur imap-uw.old/files/patch-ai imap-uw/files/patch-ai
--- imap-uw.old/files/patch-ai	Thu Jan  1 01:00:00 1970
+++ imap-uw/files/patch-ai	Sun Jan  7 20:26:15 2001
@@ -0,0 +1,99 @@
+--- src/imapd/imapd.c.old	Sat Nov 18 05:16:29 2000
++++ src/imapd/imapd.c	Sun Dec 31 18:53:25 2000
+@@ -17,7 +17,7 @@
+  * The full text of our legal notices is contained in the file called
+  * CPYRIGHT, included with this Distribution.
+  */
+-
++
+ /* Primary I/O calls */
+ 
+ #define PBIN getchar		/* primary byte input */
+@@ -43,6 +43,11 @@
+ #include "c-client.h"
+ #include <sys/stat.h>
+ 
++#ifdef DRAC_AUTH
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <stdlib.h>
++#endif /* DRAC_AUTH */
+ 
+ /* Timeouts and timers */
+ 
+@@ -66,7 +71,7 @@
+ #define SELECT 1
+ #define OPEN 2
+ #define LOGOUT 3
+-
++
+ /* Body text fetching */
+ 
+ typedef struct text_args {
+@@ -98,7 +103,7 @@
+   char *date;			/* current date */
+   STRING *message;		/* strintstruct of message */
+ } MSGDATA;
+-
++
+ /* Function prototypes */
+ 
+ int main (int argc,char *argv[]);
+@@ -181,6 +186,12 @@
+ 
+ /* Global storage */
+ 
++#ifdef DRAC_AUTH
++#define DRACTIMEOUT 10*60       /* check every 10 minutes */
++time_t lastdrac = 0;          /* time of last drac check */
++extern char *getenv ();
++#endif /* DRAC_AUTH */
++
+ char *version = "2000.284";	/* version number of this server */
+ time_t alerttime = 0;		/* time of last alert */
+ time_t sysalerttime = 0;	/* time of last system alert */
+@@ -1131,6 +1142,44 @@
+ 	      lasterror ());
+       return;
+     }
++
++#ifdef DRAC_AUTH
++    if (time (0) > lastdrac + DRACTIMEOUT)
++    {
++        FILE *dracconf;
++        char host[100];
++        char *drachost;
++        char *err;
++        char *p;
++
++        if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
++        {
++          syslog (LOG_INFO, "dracd: error opening /etc/mail/dracd.host config file");
++          exit(1);
++        }
++
++        fgets(host, 100, dracconf);
++        p = strchr(host, '\n');
++        if(p != NULL)
++          *p = '\0';
++        fclose(dracconf);
++
++        if( drachost = (host) )
++        {
++            struct sockaddr_in sin;
++            int sinlen = sizeof (struct sockaddr_in);
++            char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
++              "UNKNOWN" : inet_ntoa (sin.sin_addr);
++
++            lastdrac = time(0);
++
++            if (dracauth(drachost, inet_addr(client), &err) != 0)
++                syslog (LOG_INFO, err);
++            else
++                syslog (LOG_INFO, "dracd: authorized ip %s", client);
++        }
++    }
++#endif /* DRAC_AUTH */
+ 				/* change in number of messages? */
+     if (existsquelled || (nmsgs != stream->nmsgs)) {
+       PSOUT ("* ");

>Release-Note:
>Audit-Trail:

From: Anders Nordby <anders@fix.no>
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: ports/24135: Update port: mail/imap-uw
Date: Wed, 17 Jan 2001 01:29:33 +0100

 On Sun, Jan 07, 2001 at 11:14:52PM +0100, Anders Nordby wrote:
 > * Update the imap-uw port to use PAM again, as it used to. We do have imap by
 > default in /etc/pam.conf, so it must be better to compile imap-uw with PAM
 > authentication too no?
 > * Changed the PAM service name for the POP3 daemon from pop to pop3 as that is
 > what we have in our default pam.conf.
 > * Update the port with optional DRAC support.
 > 
 > This adds the patches patch-ah and patch-ai.
 
 Added SSL support for imapd and ipop3d here too (which is necessary if you want
 to use DRAC and/or avoid stunnel). Which adds patch-aj as well.
 
 The cclient port also needs SSL support for this to work. (And the same SSL
 patch, patch-aj.)
 
 Updated patches to apply can be fetched off:
 
 http://anders.fix.no/ports/archives/imap-uw.diffs_2
 http://anders.fix.no/ports/archives/cclient.diffs
 
 Cheers,
 
 -- 
 Anders.
 

From: "James E. Housley" <jeh@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, anders@fix.no
Cc:  
Subject: Re: ports/24135: Update port: mail/imap-uw
Date: Thu, 22 Mar 2001 20:14:56 -0500

 Have you run these patches by the MAINTAINER <petef@databits.net> ?
 
 Jim
 -- 
 /"\   ASCII Ribbon Campaign  .
 \ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
 / \ -----------------------------------------------------------------
 jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
 jim@TheHousleys.Net  http://www.TheHousleys.net
 ---------------------------------------------------------------------
 Do not meddle in the affairs of dragons, for you are crunchy and taste
     good with ketchup.
State-Changed-From-To: open->closed 
State-Changed-By: jeh 
State-Changed-When: Thu Mar 22 19:04:26 PST 2001 
State-Changed-Why:  
Committed.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24135 
>Unformatted:
