pkgsrc-Changes archive

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

CVS commit: pkgsrc/mail/nopop3d



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Fri Oct 30 10:19:22 UTC 2020

Added Files:
        pkgsrc/mail/nopop3d: DESCR Makefile PLIST distinfo
        pkgsrc/mail/nopop3d/files: nopop3d.c nopop3d.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/mail/nopop3d/DESCR pkgsrc/mail/nopop3d/Makefile \
    pkgsrc/mail/nopop3d/PLIST pkgsrc/mail/nopop3d/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/mail/nopop3d/files/nopop3d.c \
    pkgsrc/mail/nopop3d/files/nopop3d.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/mail/nopop3d/DESCR
diff -u /dev/null pkgsrc/mail/nopop3d/DESCR:1.1
--- /dev/null   Fri Oct 30 10:19:22 2020
+++ pkgsrc/mail/nopop3d/DESCR   Fri Oct 30 10:19:22 2020
@@ -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.
Index: pkgsrc/mail/nopop3d/Makefile
diff -u /dev/null pkgsrc/mail/nopop3d/Makefile:1.1
--- /dev/null   Fri Oct 30 10:19:22 2020
+++ pkgsrc/mail/nopop3d/Makefile        Fri Oct 30 10:19:22 2020
@@ -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"
Index: pkgsrc/mail/nopop3d/PLIST
diff -u /dev/null pkgsrc/mail/nopop3d/PLIST:1.1
--- /dev/null   Fri Oct 30 10:19:22 2020
+++ pkgsrc/mail/nopop3d/PLIST   Fri Oct 30 10:19:22 2020
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2020/10/30 10:19:22 schmonz Exp $
+bin/nopop3d
Index: pkgsrc/mail/nopop3d/distinfo
diff -u /dev/null pkgsrc/mail/nopop3d/distinfo:1.1
--- /dev/null   Fri Oct 30 10:19:22 2020
+++ pkgsrc/mail/nopop3d/distinfo        Fri Oct 30 10:19:22 2020
@@ -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

Index: pkgsrc/mail/nopop3d/files/nopop3d.c
diff -u /dev/null pkgsrc/mail/nopop3d/files/nopop3d.c:1.1
--- /dev/null   Fri Oct 30 10:19:22 2020
+++ pkgsrc/mail/nopop3d/files/nopop3d.c Fri Oct 30 10:19:22 2020
@@ -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();
+}
Index: pkgsrc/mail/nopop3d/files/nopop3d.mk
diff -u /dev/null pkgsrc/mail/nopop3d/files/nopop3d.mk:1.1
--- /dev/null   Fri Oct 30 10:19:22 2020
+++ pkgsrc/mail/nopop3d/files/nopop3d.mk        Fri Oct 30 10:19:22 2020
@@ -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