summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorSteve Price <steve@FreeBSD.org>1999-05-03 02:44:24 +0000
committerSteve Price <steve@FreeBSD.org>1999-05-03 02:44:24 +0000
commita63d37261eb47e46f4e0dce1a775d33f92d16a51 (patch)
tree532264764bc8cdd9ac884b0f9fdb5470665f029e /mail
parentInitial import of nicetext version 0.9. (diff)
Initial import of qmail-contrib version 0.1.
A set of contrib'd tools for qmail. PR: 8899 Submitted by: Neil Blakey-Milner <nbm@rucus.ru.ac.za>
Notes
Notes: svn path=/head/; revision=18372
Diffstat (limited to 'mail')
-rw-r--r--mail/qmail-contrib/Makefile78
-rw-r--r--mail/qmail-contrib/distinfo2
-rw-r--r--mail/qmail-contrib/files/extra-patch-newaliases113
-rw-r--r--mail/qmail-contrib/files/extra-patch-striplocal28
-rw-r--r--mail/qmail-contrib/pkg-comment1
-rw-r--r--mail/qmail-contrib/pkg-descr6
-rw-r--r--mail/qmail-contrib/pkg-plist10
7 files changed, 238 insertions, 0 deletions
diff --git a/mail/qmail-contrib/Makefile b/mail/qmail-contrib/Makefile
new file mode 100644
index 000000000000..98b7df03e933
--- /dev/null
+++ b/mail/qmail-contrib/Makefile
@@ -0,0 +1,78 @@
+# New ports collection makefile for: qmail-contrib
+# Version required: 1.0
+# Date created: 28 November 1998
+# Whom: Neil Blakey-Milner <nbm@rucus.ru.ac.za>
+#
+# $Id$
+
+DISTNAME= qmail-contrib-0.1
+CATEGORIES= mail
+MASTER_SITES= ftp://ftp.qmail.org/pub/software/ \
+ ftp://rucus.ru.ac.za/pub/mail/qmail/src/
+DISTFILES= dot-forward-${DF_VER}.tar.gz \
+ fastforward-${FF_VER}.tar.gz
+
+MAINTAINER= ports@freebsd.org
+
+RUN_DEPENDS= ${QMAIL_DIR}/bin/qmail-send:${PORTSDIR}/mail/qmail
+
+NO_PACKAGE= Unsure of djb\'s license
+
+ALL_TARGET= it
+INSTALL_TARGET= setup
+
+MAN1= dot-forward.1 fastforward.1 printforward.1 setforward.1
+MAN1+= newaliases.1 printmaillist.1 setmaillist.1 newinclude.1
+
+PLIST_SUB= DOCDIR=${DOCDIR}
+
+.if exists(${PREFIX}/qmail/bin/qmail-send)
+QMAIL_DIR?= ${PREFIX}/qmail
+PREFIX?= ${PREFIX}/qmail
+.else
+QMAIL_DIR?= /var/qmail
+PREFIX?= /var/qmail
+.endif
+
+.if (${PREFIX} == "/usr/local")
+DOCDIR= share/doc/qmail
+.else
+DOCDIR= doc
+.endif
+
+FF_VER= 0.51
+DF_VER= 0.71
+QCK_VER= 0.1
+
+WRKFF= ${WRKDIR}/fastforward-${FF_VER}
+WRKDF= ${WRKDIR}/dot-forward-${DF_VER}
+
+NO_MTREE= yes
+
+pre-patch:
+ @cd ${WRKFF} \
+ && ${PATCH} -s <${FILESDIR}/patch-newaliases
+# && ${PATCH} <${FILESDIR}/patch-striplocal
+# apparently the above patch is no longer needed
+
+post-patch:
+ @perl -pi.bak -e "s|-O2|${CFLAGS}|" ${WRKFF}/conf-cc
+ @perl -pi.bak -e "s|.var.qmail|${QMAIL_DIR}|" ${WRKFF}/conf-qmail
+ @perl -pi.bak -e '$$_ = "" if /cat/' ${WRKFF}/hier.c
+ @perl -pi.bak -e "s|-O2|${CFLAGS}|" ${WRKDF}/conf-cc
+ @perl -pi.bak -e "s|.var.qmail|${QMAIL_DIR}|" ${WRKDF}/conf-qmail
+ @perl -pi.bak -e '$$_ = "" if /cat/' ${WRKDF}/hier.c
+
+do-build:
+ @cd ${WRKDIR}/dot-forward-${DF_VER} \
+ && make ${ALL_TARGET}
+ @cd ${WRKDIR}/fastforward-${FF_VER} \
+ && make ${ALL_TARGET}
+
+do-install:
+ @cd ${WRKDIR}/dot-forward-${DF_VER} \
+ && make ${INSTALL_TARGET}
+ @cd ${WRKDIR}/fastforward-${FF_VER} \
+ && make ${INSTALL_TARGET}
+
+.include <bsd.port.mk>
diff --git a/mail/qmail-contrib/distinfo b/mail/qmail-contrib/distinfo
new file mode 100644
index 000000000000..f425e227b630
--- /dev/null
+++ b/mail/qmail-contrib/distinfo
@@ -0,0 +1,2 @@
+MD5 (dot-forward-0.71.tar.gz) = 1fefd9760e4706491fb31c7511d69bed
+MD5 (fastforward-0.51.tar.gz) = 6dc619180ba9726380dc1047e45a1d8d
diff --git a/mail/qmail-contrib/files/extra-patch-newaliases b/mail/qmail-contrib/files/extra-patch-newaliases
new file mode 100644
index 000000000000..58a5341f7077
--- /dev/null
+++ b/mail/qmail-contrib/files/extra-patch-newaliases
@@ -0,0 +1,113 @@
+*** newaliases.c.orig Fri Apr 24 17:34:58 1998
+--- newaliases.c Fri Apr 24 17:38:32 1998
+***************
+*** 12,17 ****
+--- 12,21 ----
+
+ #define FATAL "newaliases: fatal: "
+
++ stralloc fnsrc = {0};
++ stralloc fncdb = {0};
++ stralloc fntmp = {0};
++
+ void nomem()
+ {
+ strerr_die2x(111,FATAL,"out of memory");
+***************
+*** 26,36 ****
+ }
+ void writeerr()
+ {
+! strerr_die2sys(111,FATAL,"unable to write to /etc/aliases.tmp: ");
+ }
+ void readerr()
+ {
+! strerr_die2sys(111,FATAL,"unable to read /etc/aliases: ");
+ }
+ void die_control()
+ {
+--- 30,40 ----
+ }
+ void writeerr()
+ {
+! strerr_die4sys(111,FATAL,"unable to write to ",fntmp.s,": ");
+ }
+ void readerr()
+ {
+! strerr_die4sys(111,FATAL,"unable to read ",fnsrc.s,": ");
+ }
+ void die_control()
+ {
+***************
+*** 270,288 ****
+ if (cdbmss_add(&cdbmss,key.s,key.len,instr.s,instr.len) == -1) writeerr();
+ }
+
+! void main()
+ {
+ int fd;
+
+ umask(033);
+ readcontrols();
+
+! fd = open_read("/etc/aliases");
+ if (fd == -1) readerr();
+ substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
+
+! fd = open_trunc("/etc/aliases.tmp");
+! if (fd == -1) strerr_die2sys(111,FATAL,"unable to create /etc/aliases.tmp: ");
+ if (cdbmss_start(&cdbmss,fd) == -1) writeerr();
+
+ if (!stralloc_copys(&line,"")) nomem();
+--- 274,305 ----
+ if (cdbmss_add(&cdbmss,key.s,key.len,instr.s,instr.len) == -1) writeerr();
+ }
+
+! void main(argc,argv)
+! int argc;
+! char **argv;
+ {
+ int fd;
+
+ umask(033);
+ readcontrols();
+
+! if (!stralloc_copys(&fnsrc,argv[1] ? argv[1] : "/etc/aliases")) nomem();
+! if (!stralloc_0(&fnsrc)) nomem();
+!
+! if (!stralloc_copys(&fncdb,fnsrc.s)) nomem();
+! if (!stralloc_cats(&fncdb,".cdb")) nomem();
+! if (!stralloc_0(&fncdb)) nomem();
+!
+! if (!stralloc_copys(&fntmp,fnsrc.s)) nomem();
+! if (!stralloc_cats(&fntmp,".tmp")) nomem();
+! if (!stralloc_0(&fntmp)) nomem();
+!
+! fd = open_read(fnsrc.s);
+ if (fd == -1) readerr();
+ substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
+
+! fd = open_trunc(fntmp.s);
+! if (fd == -1) strerr_die4sys(111,FATAL,"unable to create ",fntmp.s,": ");
+ if (cdbmss_start(&cdbmss,fd) == -1) writeerr();
+
+ if (!stralloc_copys(&line,"")) nomem();
+***************
+*** 314,321 ****
+ if (fsync(fd) == -1) writeerr();
+ if (close(fd) == -1) writeerr(); /* NFS stupidity */
+
+! if (rename("/etc/aliases.tmp","/etc/aliases.cdb") == -1)
+! strerr_die2sys(111,FATAL,"unable to move /etc/aliases.tmp to /etc/aliases.cdb: ");
+
+ _exit(0);
+ }
+--- 331,338 ----
+ if (fsync(fd) == -1) writeerr();
+ if (close(fd) == -1) writeerr(); /* NFS stupidity */
+
+! if (rename(fntmp.s,fncdb.s) == -1)
+! strerr_die6sys(111,FATAL,"unable to move ",fntmp.s," to ",fncdb.s,": ");
+
+ _exit(0);
+ }
diff --git a/mail/qmail-contrib/files/extra-patch-striplocal b/mail/qmail-contrib/files/extra-patch-striplocal
new file mode 100644
index 000000000000..8017b679fa71
--- /dev/null
+++ b/mail/qmail-contrib/files/extra-patch-striplocal
@@ -0,0 +1,28 @@
+*** fastforward.c.orig Thu Apr 23 20:35:48 1998
+--- fastforward.c Thu Apr 23 20:37:05 1998
+***************
+*** 261,270 ****
+ if (gettarget(1,"?",addr))
+ if (!stralloc_copy(&sender,&data)) nomem();
+ if (!gettarget(1,":",addr))
+! if (flagpassthrough)
+! _exit(0);
+! else
+! strerr_die1x(100,"Sorry, no mailbox here by that name. (#5.1.1)");
+ dodata();
+ }
+
+--- 261,273 ----
+ if (gettarget(1,"?",addr))
+ if (!stralloc_copy(&sender,&data)) nomem();
+ if (!gettarget(1,":",addr))
+! if (strpbrk(addr,"-"))
+! if (!str_copy(addr,strpbrk(addr,"-")+1)) nomem();
+! if (!gettarget(1,":",addr))
+! if (flagpassthrough)
+! _exit(0);
+! else
+! strerr_die1x(100,"Sorry, no mailbox here by that name. (#5.1.1)");
+ dodata();
+ }
+
diff --git a/mail/qmail-contrib/pkg-comment b/mail/qmail-contrib/pkg-comment
new file mode 100644
index 000000000000..b4ae9e0e73a4
--- /dev/null
+++ b/mail/qmail-contrib/pkg-comment
@@ -0,0 +1 @@
+Contributed programs for qmail.
diff --git a/mail/qmail-contrib/pkg-descr b/mail/qmail-contrib/pkg-descr
new file mode 100644
index 000000000000..b853a61de151
--- /dev/null
+++ b/mail/qmail-contrib/pkg-descr
@@ -0,0 +1,6 @@
+These are a collection of contributed programs for qmail.
+
+fastforward allows the use of a new method of storing aliases, in a
+compact database.
+
+dotforward allows old-style ".forward" files to work correctly.
diff --git a/mail/qmail-contrib/pkg-plist b/mail/qmail-contrib/pkg-plist
new file mode 100644
index 000000000000..db4bfe010005
--- /dev/null
+++ b/mail/qmail-contrib/pkg-plist
@@ -0,0 +1,10 @@
+doc/fastforward/ALIASES
+bin/dot-forward
+bin/fastforward
+bin/printforward
+bin/setforward
+bin/newaliases
+bin/printmaillist
+bin/setmaillist
+bin/newinclude
+@dirrm doc/fastforward