pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/nopop3d Initial import of nopop3d, a POP3 server ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/eb471b6525ac
branches:  trunk
changeset: 441243:eb471b6525ac
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Fri Oct 30 10:19:22 2020 +0000

description:
Initial import of nopop3d, a POP3 server for when you don't want mail.

nopop3d is not a POP3 server. It can be useful as part of a simple
authentication service that happens to be implemented as POP3.

nopop3d consists of qmail-pop3d with several POP3 verbs and all the file
access removed.

diffstat:

 mail/nopop3d/DESCR            |   5 ++
 mail/nopop3d/Makefile         |  27 ++++++++++++++
 mail/nopop3d/PLIST            |   2 +
 mail/nopop3d/distinfo         |   6 +++
 mail/nopop3d/files/nopop3d.c  |  78 +++++++++++++++++++++++++++++++++++++++++++
 mail/nopop3d/files/nopop3d.mk |  14 +++++++
 6 files changed, 132 insertions(+), 0 deletions(-)

diffs (156 lines):

diff -r c77217799c6c -r eb471b6525ac mail/nopop3d/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/nopop3d/DESCR        Fri Oct 30 10:19:22 2020 +0000
@@ -0,0 +1,5 @@
+nopop3d is not a POP3 server. It can be useful as part of a simple
+authentication service that happens to be implemented as POP3.
+
+nopop3d consists of qmail-pop3d with several POP3 verbs and all the file
+access removed.
diff -r c77217799c6c -r eb471b6525ac mail/nopop3d/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/nopop3d/Makefile     Fri Oct 30 10:19:22 2020 +0000
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1 2020/10/30 10:19:22 schmonz Exp $
+
+DISTNAME=              notqmail-1.08
+PKGNAME=               nopop3d-20201030
+CATEGORIES=            mail
+MASTER_SITES=          # empty
+
+MAINTAINER=            schmonz%NetBSD.org@localhost
+HOMEPAGE=              # none
+COMMENT=               POP3 server for when you don't want mail
+LICENSE=               public-domain
+
+BUILD_TARGET=          ${PKGBASE}
+
+DJB_RESTRICTED=                no
+
+INSTALLATION_DIRS=     bin
+
+post-extract:
+       ${CP} ${FILESDIR}/${PKGBASE}.c ${WRKSRC}
+       ${CAT} ${FILESDIR}/${PKGBASE}.mk >> ${WRKSRC}/${MAKE_FILE}
+
+do-install:
+       ${INSTALL_PROGRAM} ${WRKSRC}/${PKGBASE} ${DESTDIR}${PREFIX}/bin
+
+.include "../../mk/djbware.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r c77217799c6c -r eb471b6525ac mail/nopop3d/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/nopop3d/PLIST        Fri Oct 30 10:19:22 2020 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2020/10/30 10:19:22 schmonz Exp $
+bin/nopop3d
diff -r c77217799c6c -r eb471b6525ac mail/nopop3d/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/nopop3d/distinfo     Fri Oct 30 10:19:22 2020 +0000
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2020/10/30 10:19:22 schmonz Exp $
+
+SHA1 (notqmail-1.08.tar.gz) = 7647b9920134cd433b31c5e27563f0728fbd0056
+RMD160 (notqmail-1.08.tar.gz) = ea1417fe5aebc24cb1d06e9992d941e91045e3b0
+SHA512 (notqmail-1.08.tar.gz) = eca97f74a20522e85435fa76015a72adcc040e1acc401cbdbd7f55f41a720fabc6f251e606ff1d236e44de295f066538ec42aca415b4344c1cd15964f38c7085
+Size (notqmail-1.08.tar.gz) = 225713 bytes
diff -r c77217799c6c -r eb471b6525ac mail/nopop3d/files/nopop3d.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/nopop3d/files/nopop3d.c      Fri Oct 30 10:19:22 2020 +0000
@@ -0,0 +1,78 @@
+/* $NetBSD */
+
+#include <stdlib.h>
+#include "commands.h"
+#include "sig.h"
+#include "substdio.h"
+#include "readwrite.h"
+#include "timeoutread.h"
+#include "timeoutwrite.h"
+
+void die() { exit(0); }
+
+int saferead(fd,buf,len) int fd; char *buf; int len;
+{
+  int r;
+  r = timeoutread(1200,fd,buf,len);
+  if (r <= 0) die();
+  return r;
+}
+
+int safewrite(fd,buf,len) int fd; char *buf; int len;
+{
+  int r;
+  r = timeoutwrite(1200,fd,buf,len);
+  if (r <= 0) die();
+  return r;
+}
+
+char ssoutbuf[1024];
+substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf);
+
+char ssinbuf[128];
+substdio ssin = SUBSTDIO_FDBUF(saferead,0,ssinbuf,sizeof ssinbuf);
+
+void err_unimpl(arg) char *arg; {
+  substdio_putsflush(&ssout,"-ERR unimplemented\r\n");
+}
+
+void okay(arg) char *arg;
+{
+  substdio_putsflush(&ssout,"+OK \r\n");
+}
+
+void pop3_list(arg) char *arg;
+{
+  substdio_putsflush(&ssout,"+OK \r\n.\r\n");
+}
+
+void pop3_stat(arg) char *arg;
+{
+  substdio_putsflush(&ssout,"+OK 0 0\r\n");
+}
+
+void pop3_quit(arg) char *arg;
+{
+  okay();
+  die();
+}
+
+struct commands pop3commands[] = {
+  { "quit", pop3_quit, 0 }
+, { "stat", pop3_stat, 0 }
+, { "list", pop3_list, 0 }
+, { "noop", okay, 0 }
+, { 0, err_unimpl, 0 }
+} ;
+
+void main(argc,argv)
+int argc;
+char **argv;
+{
+  sig_alarmcatch(die);
+  sig_pipeignore();
+ 
+  okay(0);
+  commands(&ssin,pop3commands);
+  die();
+}
diff -r c77217799c6c -r eb471b6525ac mail/nopop3d/files/nopop3d.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/nopop3d/files/nopop3d.mk     Fri Oct 30 10:19:22 2020 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: nopop3d.mk,v 1.1 2020/10/30 10:19:22 schmonz Exp $
+
+nopop3d: \
+load nopop3d.o commands.o case.a timeoutread.o timeoutwrite.o \
+sig.a stralloc.a alloc.a substdio.a error.a str.a \
+socket.lib
+       ./load nopop3d commands.o case.a timeoutread.o timeoutwrite.o \
+       sig.a stralloc.a alloc.a substdio.a error.a str.a \
+       `cat socket.lib`
+
+nopop3d.o: \
+compile nopop3d.c \
+commands.h sig.h substdio.h readwrite.h timeoutread.h timeoutwrite.h
+       ./compile nopop3d.c



Home | Main Index | Thread Index | Old Index