summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2020-10-30 10:19:22 +0000
committerschmonz <schmonz@pkgsrc.org>2020-10-30 10:19:22 +0000
commit20d53ce891c4ab8940ff698ba374bf6f78eb77fe (patch)
tree5cc3d55603e6e84a705c4d18d0d5fa644a9fa76c /mail
parent142b530882cdc91edc3c70477bcace9bdfa6363c (diff)
downloadpkgsrc-20d53ce891c4ab8940ff698ba374bf6f78eb77fe.tar.gz
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 (limited to 'mail')
-rw-r--r--mail/nopop3d/DESCR5
-rw-r--r--mail/nopop3d/Makefile27
-rw-r--r--mail/nopop3d/PLIST2
-rw-r--r--mail/nopop3d/distinfo6
-rw-r--r--mail/nopop3d/files/nopop3d.c78
-rw-r--r--mail/nopop3d/files/nopop3d.mk14
6 files changed, 132 insertions, 0 deletions
diff --git a/mail/nopop3d/DESCR b/mail/nopop3d/DESCR
new file mode 100644
index 00000000000..1645681891c
--- /dev/null
+++ b/mail/nopop3d/DESCR
@@ -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 --git a/mail/nopop3d/Makefile b/mail/nopop3d/Makefile
new file mode 100644
index 00000000000..2b600b21fef
--- /dev/null
+++ b/mail/nopop3d/Makefile
@@ -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
+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 --git a/mail/nopop3d/PLIST b/mail/nopop3d/PLIST
new file mode 100644
index 00000000000..3ccf5af7439
--- /dev/null
+++ b/mail/nopop3d/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2020/10/30 10:19:22 schmonz Exp $
+bin/nopop3d
diff --git a/mail/nopop3d/distinfo b/mail/nopop3d/distinfo
new file mode 100644
index 00000000000..358c48da021
--- /dev/null
+++ b/mail/nopop3d/distinfo
@@ -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 --git a/mail/nopop3d/files/nopop3d.c b/mail/nopop3d/files/nopop3d.c
new file mode 100644
index 00000000000..da6ced3251e
--- /dev/null
+++ b/mail/nopop3d/files/nopop3d.c
@@ -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 --git a/mail/nopop3d/files/nopop3d.mk b/mail/nopop3d/files/nopop3d.mk
new file mode 100644
index 00000000000..26cfd543283
--- /dev/null
+++ b/mail/nopop3d/files/nopop3d.mk
@@ -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