Skip site navigation (1)Skip section navigation (2)
Date:      2 Jul 2006 11:34:51 +1000
From:      Alexander Logvinov <user@blg.akavia.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/99704: [new port] mail/mdpop3d A simple and small POP3 daemon
Message-ID:  <20060702013451.56483.qmail@blg.akavia.ru>
Resent-Message-ID: <200607020140.k621eJdN039671@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         99704
>Category:       ports
>Synopsis:       [new port] mail/mdpop3d A simple and small POP3 daemon
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 02 01:40:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Logvinov
>Release:        FreeBSD 6.1-RELEASE-p2 i386
>Organization:
>Environment:

>Description:

A simple and small POP3 daemon implementation with Maildir support

>How-To-Repeat:
>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mdpop3d
#	mdpop3d/Makefile
#	mdpop3d/files
#	mdpop3d/files/patch-01
#	mdpop3d/distinfo
#	mdpop3d/pkg-descr
#	mdpop3d/pkg-plist
#
echo c - mdpop3d
mkdir -p mdpop3d > /dev/null 2>&1
echo x - mdpop3d/Makefile
sed 's/^X//' >mdpop3d/Makefile << 'END-of-mdpop3d/Makefile'
X# New ports collection makefile for:	mdpop3d
X# Date created:		2 July 2006
X# Whom:			Alexander Logvinov <info@logvinov.com>
X#
X# $FreeBSD$
X
XPORTNAME=	mdpop3d
XPORTVERSION=	0.97
XCATEGORIES=	mail
XMASTER_SITES=	ftp://ftp.corpit.ru/home/mjt/mdpop3d/
XDISTNAME=	${PORTNAME}-${PORTVERSION}
X
XMAINTAINER=	lightsquid@logvinov.com
XCOMMENT=	A simple and small POP3 daemon implementation with Maildir support
X
XMAN8=		mdpop3d.8
XMANCOMPRESSED=  no
X
XOPTIONS=        PAM   "Build with PAM support"                      	off \
X		APOP  "Build with APOP command support (requires PAM)"	off
X
X.include <bsd.port.pre.mk>
X
Xpost-patch:
X	@${REINPLACE_CMD} -e 's|LIBS = -lpam -ldl|LIBS = -lpam|' \
X	                                ${WRKSRC}/Makefile
X.if defined(WITHOUT_PAM)
X	@${REINPLACE_CMD} -e 's|LIBS = -lpam|LIBS = -lcrypt|' \
X			${WRKSRC}/Makefile
X	@${REINPLACE_CMD} -e 's|DEFS = -DUSE_PAM|#DEFS = -DUSE_PAM|' \
X	                ${WRKSRC}/Makefile
X	@${REINPLACE_CMD} -e 's|OPTS = -DUSE_APOP|#OPTS = -DUSE_APOP|' \
X	                ${WRKSRC}/Makefile
X.endif
X
X.if defined(WITHOUT_APOP)
X	@${REINPLACE_CMD} -e 's|OPTS = -DUSE_APOP|#OPTS = -DUSE_APOP|' \
X	                ${WRKSRC}/Makefile
X.endif
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/libexec
X	${INSTALL_MAN} ${WRKSRC}/mdpop3d.8 ${PREFIX}/man/man8
X
X.include <bsd.port.post.mk>
END-of-mdpop3d/Makefile
echo c - mdpop3d/files
mkdir -p mdpop3d/files > /dev/null 2>&1
echo x - mdpop3d/files/patch-01
sed 's/^X//' >mdpop3d/files/patch-01 << 'END-of-mdpop3d/files/patch-01'
X--- mdpop3d.c.orig	Tue Feb 27 00:12:50 2001
X+++ mdpop3d.c	Sun Jul  2 10:31:40 2006
X@@ -67,8 +67,8 @@
X #ifdef USE_APOP
X # error APOP requires PAM
X #endif
X-#include <shadow.h>
X-#include <crypt.h>
X+#include <pwd.h>
X+#include <unistd.h>
X #endif
X 
X static const char *rhost; /* = NULL; remote host/addr for logging */
X@@ -258,7 +258,7 @@
X }
X 
X static void info() {
X-  putline(OK "maildir: %d message(s) %ld octet(s)", cmsg, msgsz);
X+  putline(OK "maildir: %d message(s) %ld octet(s)", cmsg, (long int)msgsz);
X }
X 
X static char *msgfn(int n) {
X@@ -397,7 +397,8 @@
X   int r;
X   struct popdata d;
X   const char *u = NULL;
X-
X+  const char **ptr_u = &u;
X+  
X   d.pass = pass;
X   d.msg = NULL;
X   convstruct.appdata_ptr = &d;
X@@ -416,7 +417,7 @@
X 	PAMOK(pam_set_item(pamh, PAM_RHOST, rhost)) &&
X 	PAMOK(pam_authenticate(pamh, 0)) &&
X 	PAMOK(pam_acct_mgmt(pamh, 0)) &&
X-	PAMOK(pam_get_item(pamh, PAM_USER, (const void **)&u))) {
X+	PAMOK(pam_get_item(pamh, PAM_USER, (const void **)ptr_u))) {
X     pw = getpwnam(u && *u ? u : user); /* use username from pam if any */
X     if (!maildir) /* try to get MAILDIR from PAM */
X       maildir = pam_getenv(pamh, maildirenv);
X@@ -450,22 +451,17 @@
X   return NULL;
X 
X #else /* !USE_PAM */
X-
X-  char *p;
X-  if ((pw = getpwnam(user)) != NULL) {
X-    p = pw->pw_passwd;
X-    if (!p || !strcmp(p, "x")) {
X-      struct spwd *sp = getspnam(user);
X-      p = sp ? sp->sp_pwdp : NULL;
X-      endspent();
X-    }
X-    if (p && strcmp(crypt(pass, p), p) == 0)
X+    
X+  pw = getpwnam(user);
X+  endpwent();
X+  if (pw != NULL)
X+   {
X+    if (pw->pw_passwd && strcmp(crypt(pass, pw->pw_passwd), pw->pw_passwd) == 0)
X       return pw;
X     syslog(LOG_INFO, "[%s] login incorrect for [%s]", rhost, user);
X   }
X   else
X     syslog(LOG_INFO, "[%s] user unknown: [%s]", rhost, user);
X-  sleep(3);
X   putline(ERR "login incorrect");
X   return NULL;
X 
X@@ -565,7 +561,7 @@
X       *s = ':';
X   }
X   else
X-    putmline("%s%d %ld", code, n+1, msgp[n]->size);
X+    putmline("%s%d %ld", code, n+1, (long int)msgp[n]->size);
X }
X 
X static void finalupdate() {
X@@ -621,7 +617,7 @@
X 
X static void finallog(const char *why) {
X   syslog(LOG_INFO, "[%s][%s] %s (%d/%ld msgs/bytes left, %d/%ld deleted)",
X-         rhost, user, why, cmsg, msgsz, o_nmsg - cmsg, o_msgsz - msgsz);
X+         rhost, user, why, cmsg, (long int)msgsz, o_nmsg - cmsg, (long int)o_msgsz - (long int)msgsz);
X }
X 
X static void die(const char *why) {
X@@ -932,7 +928,7 @@
X       else if (a)
X 	extraarg(), --junk;
X       else
X-	putline(OK "%d %ld", cmsg, msgsz);
X+	putline(OK "%d %ld", cmsg, (long int)msgsz);
X     }
X 
X     else if (!strcmp(line, "top") || !strcmp(line, "retr")) {
END-of-mdpop3d/files/patch-01
echo x - mdpop3d/distinfo
sed 's/^X//' >mdpop3d/distinfo << 'END-of-mdpop3d/distinfo'
XMD5 (mdpop3d-0.97.tar.gz) = 57f6da1c5db5e3bf3fa98c3ecbdb5fa9
XSHA256 (mdpop3d-0.97.tar.gz) = 8202012c82d0880e1362e44cdfbbb69d0ed589087b468eda7b0466c49ade39fc
XSIZE (mdpop3d-0.97.tar.gz) = 17110
END-of-mdpop3d/distinfo
echo x - mdpop3d/pkg-descr
sed 's/^X//' >mdpop3d/pkg-descr << 'END-of-mdpop3d/pkg-descr'
XThis is a simple and small POP3 daemon implementation designed for
XMaildir support.  It have direct support for authenticating regular
Xunix users, has UIDL command support, can access maildirs in
Xnon-default location, and have support for external (pre-)authenticators.
X
XAuthor: Michael Tokarev <mjt@corpit.ru>
END-of-mdpop3d/pkg-descr
echo x - mdpop3d/pkg-plist
sed 's/^X//' >mdpop3d/pkg-plist << 'END-of-mdpop3d/pkg-plist'
Xlibexec/mdpop3d
END-of-mdpop3d/pkg-plist
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060702013451.56483.qmail>