Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master z-rejected grimoire by Jeremy Blosser (92012c0e74b63ca65a4fef501b71a3951c39b88d)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jeremy Blosser <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master z-rejected grimoire by Jeremy Blosser (92012c0e74b63ca65a4fef501b71a3951c39b88d)
  • Date: Sun, 1 Apr 2007 15:29:47 -0500

GIT changes to master z-rejected grimoire by Jeremy Blosser
<jblosser-smgl AT firinn.org>:

ChangeLog | 1
z-mail/qmail/BUILD | 4
z-mail/qmail/CONFIGURE | 2
z-mail/qmail/DEPENDS | 1
z-mail/qmail/DETAILS | 53 ++++++++++
z-mail/qmail/HISTORY | 2
z-mail/qmail/INSTALL | 16 +++
z-mail/qmail/PRE_BUILD | 25 +++++
z-mail/qmail/PROVIDES | 2
z-mail/qmail/init.d/qmail | 32 ++++++
z-mail/qmail/patches/local-bind | 170
++++++++++++++++++++++++++++++++++
z-mail/qmail/patches/qmailqueue-patch | 72 ++++++++++++++
z-mail/qmail/xinetd.d/qmail-smtpd | 11 ++
13 files changed, 391 insertions(+)

New commits:
commit 92012c0e74b63ca65a4fef501b71a3951c39b88d
Author: Jeremy Blosser <jblosser-smgl AT firinn.org>
Commit: Jeremy Blosser <jblosser-smgl AT firinn.org>

qmail: Added, this is the vanilla qmail spell I've been using forever.

diff --git a/ChangeLog b/ChangeLog
index dc92858..71d2d16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
2007-04-01 Jeremy Blosser <jblosser-smgl AT firinn.org>
* accounts, groups: Sync with primary grimoire.
+ * z-mail/qmail: Added, vanilla qmail spell.

2007-03-29 Pol Vinogradov <vin.public AT gmail.com>
* z-games/crafty: moved from games grimoire, chess engine
diff --git a/z-mail/qmail/BUILD b/z-mail/qmail/BUILD
new file mode 100755
index 0000000..53e3198
--- /dev/null
+++ b/z-mail/qmail/BUILD
@@ -0,0 +1,4 @@
+echo "gcc ${CFLAGS} -include /usr/include/errno.h" >conf-cc &&
+echo "gcc ${LDFLAGS}" >conf-ld &&
+
+make it man
diff --git a/z-mail/qmail/CONFIGURE b/z-mail/qmail/CONFIGURE
new file mode 100755
index 0000000..9a8dc4c
--- /dev/null
+++ b/z-mail/qmail/CONFIGURE
@@ -0,0 +1,2 @@
+config_query QMAIL_PATCH_QMAILQUEUE "Apply the qmailqueue patch?" n &&
+config_query QMAIL_PATCH_LOCALBIND "Apply the local-bind patch?" n
diff --git a/z-mail/qmail/DEPENDS b/z-mail/qmail/DEPENDS
new file mode 100755
index 0000000..5591d01
--- /dev/null
+++ b/z-mail/qmail/DEPENDS
@@ -0,0 +1 @@
+depends groff
diff --git a/z-mail/qmail/DETAILS b/z-mail/qmail/DETAILS
new file mode 100755
index 0000000..01c51e5
--- /dev/null
+++ b/z-mail/qmail/DETAILS
@@ -0,0 +1,53 @@
+ SPELL=qmail
+ VERSION=1.03
+ SOURCE=$SPELL-$VERSION.tar.gz
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
+ SOURCE_URL[0]=http://cr.yp.to/software/$SOURCE
+
SOURCE_URL[1]=ftp://ftp.net.ohio-state.edu/pub/networking/mail/qmail/$SOURCE
+ SOURCE_URL[2]=ftp://ftp.ntnu.no/pub/unix/mail/qmail/$SOURCE
+ SOURCE_URL[3]=ftp://ftp.eu.uu.net/pub/unix/mail/qmail/$SOURCE
+ SOURCE_URL[4]=ftp://ftp.jp.qmail.org/qmail/$SOURCE
+ WEB_SITE=http://cr.yp.to/qmail.html
+ ENTERED=20051013
+
SOURCE_HASH=sha512:f2cc47c3ef4a3595d5953f216811a9b60f505cf8cbfd31ae31a888ee04916936210ef1c23d59e8d280a5f0e1c3794b90ee212b2b0f36361c5eff842598c8aee2
+ LICENSE[0]=http://cr.yp.to/qmail/dist.html
+ LICENSE[1]=http://cr.yp.to/softwarelaw.html
+ REJECT="has license issues"
+ SHORT="Qmail Mail Transfer Agent"
+ DOCS="$DOCS BLURB* INSTALL* INTERNALS PIC.* REMOVE.* SECURITY
SENDMAIL TEST.* THANKS THOUGHTS"
+cat << EOF
+qmail is a secure, reliable, efficient, simple message transfer agent. It is
+designed for typical Internet-connected UNIX hosts.
+
+Secure: Security isn't just a goal, but an absolute requirement. Mail
delivery
+is critical for users; it cannot be turned off, so it must be completely
+secure.
+
+Reliable: qmail's straight-paper-path philosophy guarantees that a message,
+once accepted into the system, will never be lost. qmail also optionally
+supports maildir.
+
+Efficient: On a Pentium under BSD/OS, qmail can easily sustain 200000 local
+messages per day.
+
+Simple: qmail is vastly smaller than any other Internet MTA. Some reasons
why:
+(1) Other MTAs have separate forwarding, aliasing, and mailing list
mechanisms.
+qmail has one simple forwarding mechanism that lets users handle their own
+mailing lists. (2) Other MTAs offer a spectrum of delivery modes, from
+fast+unsafe to slow+queued. qmail-send is instantly triggered by new items in
+the queue, so the qmail system has just one delivery mode: fast+queued. (3)
+Other MTAs include, in effect, a specialized version of inetd that watches
the
+load average. qmail's design inherently limits the machine load, so
qmail-smtpd
+can safely run from your system's inetd.
+
+Replacement for sendmail: qmail supports host and user masquerading, full
host
+hiding, virtual domains, null clients, list-owner rewriting, relay control,
+double-bounce recording, arbitrary RFC 822 address lists, cross-host mailing
+list loop detection, per-recipient checkpointing, downed host backoffs,
+independent message retry schedules, etc. qmail also includes a drop-in
+``sendmail'' wrapper so that it will be used transparently by your current
UAs.
+
+NOTE: This spell installs according to DJB's required default paths. Also,
it
+runs via regular init.d, with smtp provided by xinetd. It does not yet
+automatically configure itself for daemontools or ucspi-tcp.
+EOF
diff --git a/z-mail/qmail/HISTORY b/z-mail/qmail/HISTORY
new file mode 100644
index 0000000..878f1bc
--- /dev/null
+++ b/z-mail/qmail/HISTORY
@@ -0,0 +1,2 @@
+2007-04-01 Jeremy Blosser <jblosser-smgl AT firinn.org>
+ * ALL: Initial spell commit.
diff --git a/z-mail/qmail/INSTALL b/z-mail/qmail/INSTALL
new file mode 100755
index 0000000..b01b9da
--- /dev/null
+++ b/z-mail/qmail/INSTALL
@@ -0,0 +1,16 @@
+./install &&
+./instcheck &&
+
+# TODO: Update CONFIGURE to prompt for host names and use install_config_file
+# here
+if [ ! -s $INSTALL_ROOT/var/qmail/control/me ]; then
+ ./config-fast `hostname --fqdn`
+fi &&
+
+(cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root) &&
+chmod 644 ~alias/.qmail* &&
+
+ln -sf /var/qmail/bin/sendmail /usr/lib/sendmail &&
+ln -sf /var/qmail/bin/sendmail /usr/sbin/sendmail &&
+
+cp /var/qmail/boot/home /var/qmail/rc
diff --git a/z-mail/qmail/PRE_BUILD b/z-mail/qmail/PRE_BUILD
new file mode 100755
index 0000000..81e0eae
--- /dev/null
+++ b/z-mail/qmail/PRE_BUILD
@@ -0,0 +1,25 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+
+if [ "$QMAIL_PATCH_QMAILQUEUE" == "y" ]; then
+ patch -p1 <$SCRIPT_DIRECTORY/patches/qmailqueue-patch
+fi &&
+if [ "$QMAIL_PATCH_LOCALBIND" == "y" ]; then
+ patch -p0 <$SCRIPT_DIRECTORY/patches/local-bind
+fi &&
+
+mkdir -p /var/qmail &&
+
+create_account alias /var/qmail/alias /bin/false &&
+create_account qmaild /var/qmail /bin/false &&
+create_account qmaill /var/qmail /bin/false &&
+create_account qmailp /var/qmail /bin/false &&
+create_account qmailq /var/qmail /bin/false &&
+create_account qmailr /var/qmail /bin/false &&
+create_account qmails /var/qmail /bin/false &&
+
+sedit '/echo Putting "$fqdn" into control\/locals.../i \
+echo Putting `hostname --short` into control/defaulthost... \
+hostname --short > /var/qmail/control/defaulthost \
+chmod 644 QMAIL/control/defaulthost
+' config-fast.sh
diff --git a/z-mail/qmail/PROVIDES b/z-mail/qmail/PROVIDES
new file mode 100755
index 0000000..bebbaa4
--- /dev/null
+++ b/z-mail/qmail/PROVIDES
@@ -0,0 +1,2 @@
+MAIL-TRANSPORT-AGENT
+SENDMAIL
diff --git a/z-mail/qmail/init.d/qmail b/z-mail/qmail/init.d/qmail
new file mode 100644
index 0000000..4820461
--- /dev/null
+++ b/z-mail/qmail/init.d/qmail
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+NAME=qmail-send
+PROGRAM=/var/qmail/bin/qmail-send
+RUNLEVEL=3
+NEEDS="+network +remote_fs"
+
+. /etc/init.d/smgl_init
+
+loadproc()
+{
+ if [ $# = 0 ] ; then
+ echo "Usage: loadproc {program}"
+ exit 1
+ fi
+
+ getpids $1
+
+ if [ -z "$pidlist" ] ; then
+ ( unset -f echo ; exec "$@" & )
+ evaluate_retval
+ else
+ $SET_WCOL
+ print_status warning running
+ fi
+}
+
+start()
+{
+ echo "Starting $NAME..."
+ loadproc /var/qmail/rc
+}
diff --git a/z-mail/qmail/patches/local-bind b/z-mail/qmail/patches/local-bind
new file mode 100644
index 0000000..9a9b84b
--- /dev/null
+++ b/z-mail/qmail/patches/local-bind
@@ -0,0 +1,170 @@
+From: Chuck Foster <Chuck.Foster AT uk.uu.net>
+To: djb-qmail AT koobera.math.uic.edu
+Subject: binding to local interfaces
+Date: Mon, 19 Jan 1998 09:40:42 +0000 (GMT)
+
+Hi,
+
+Well it finally reached the stage where I needed to do this on one of our
+hosts, as I wanted mail to go out using the virtual interface ip address
+and not the default one. (sigh).
+
+Anyways, if anyone thinks they'll have a use for it, I've included the
+patch to timeoutconn.c to bind to the interface, and an optional
+qmail-remote.c patch to print errors returned from it (if you don't use
+that then the 'standard' SMTP connection failed message gets used).
+
+I used a file called /var/qmail/control/bindroutes, using the same
+ip-address matching as tcpcontrol, ie. 1.2.3.4, 1.2.3., 1.2., 1., none.
+The LHS is the outbound IP (ie. the host you're going to), and the RHS
+is the interface on the local machine to bind to (ie. needs to be
+valid on the host).
+
+Eg.
+
+# Send this on the internal net
+10.:10.0.0.1
+# Rest goes on external "mail" address (yes, its bogus!)
+:301.32.1.1
+# Hey, we could 'cheat' on stopping qmail-remote sending to this host
+555.123.123.123:this-isnt-an-ip-address
+
+The define should be either 0 or 1; 0 means if the bind() fails then go
+ahead and connect() with the os bind; 1 means that a temp error is
+generated and the mail requeued.
+
+
+As usual, if you use these patches yourself it's at your own risk; all
+seems to work fine on my (Solaris 2.5.1) boxes, but if something busts cos
+you've used them then you're on your own (but feel free to tell me!).
+
+C.
+
+From: Bill Nugent <whn AT topelo.lopi.com>
+To: Chuck.Fostera AT auk.uu.net
+cc: nelson AT qmail.org
+Subject: Updated your local bind patch for qmail 1.03
+Date: Tue, 08 Sep 1998 10:10:15 -0400
+
+Howdy Chuck,
+
+I had some minor trouble compiling your local bind patch for qmail 1.03 -
+I had to make a change to the Makefile in addition to applying your patch
+to timeoutconn.c. I've enclosed the diff of the Makefile. It will be a
+few days before I have a chance to test the change.
+
+ Thanks for the patch!
+ Bill
+
+
+*** timeoutconn.c 1998/01/18 12:52:28 1.1
+--- timeoutconn.c 1998/01/19 09:29:57
+***************
+*** 10,15 ****
+--- 10,63 ----
+ #include "byte.h"
+ #include "timeoutconn.h"
+
++ #define BIND_SOCKET 1 /* 0 to ignore bind fail, 1 to tempfail and requeue
*/
++ #ifdef BIND_SOCKET
++ #include "control.h"
++ #include "constmap.h"
++ #include "stralloc.h"
++
++ int bind_socket(s,ip)
++ int s;
++ struct ip_address *ip;
++ {
++ struct sockaddr_in salocal;
++ struct ip_address iplocal;
++ char *ipstr, ipstring[IPFMT+1];
++ int iplen;
++ stralloc routes = {0};
++ struct constmap bindroutes;
++ char *bindroute = (char *)0;
++
++ /* Right, do we actually have any bind routes? */
++ switch(control_readfile(&routes,"control/bindroutes",0))
++ {
++ case 0: return 0; /* no file, no bind to worry about */
++ case -1: return -2; /* buggered up somewhere, urgh! */
++ case 1: if (!constmap_init(&bindroutes,routes.s,routes.len,1)) return
-3;
++ }
++
++ ipstring[0] = '.'; /* "cheating", but makes the loop check easier below!
*/
++ ipstr = ipstring+1;
++ iplen = ip_fmt(ipstr,ip); /* Well, Dan seems to trust its output! */
++
++ /* check d.d.d.d, d.d.d., d.d., d., none */
++ bindroute = constmap(&bindroutes,ipstr,iplen);
++ if (!bindroute) while (iplen--) /* no worries - the lost char must be
0-9 */
++ if (ipstring[iplen] == '.')
++ if (bindroute = constmap(&bindroutes,ipstr,iplen)) break;
++ if (!bindroute || !*bindroute) return 0; /* no bind required */
++ if (!ip_scan(bindroute,&iplocal)) return -4; /* wasn't an ip returned */
++
++ byte_zero(&salocal,sizeof(salocal));
++ salocal.sin_family = AF_INET;
++ byte_copy(&salocal.sin_addr,4,&iplocal);
++
++ if (bind(s, (struct sockaddr *)&salocal,sizeof(salocal))) return
BIND_SOCKET;
++ return 0;
++ }
++
++ #endif
++
+ int timeoutconn(s,ip,port,timeout)
+ int s;
+ struct ip_address *ip;
+***************
+*** 31,36 ****
+--- 79,87 ----
+ if (ndelay_on(s) == -1) return -1;
+
+ /* XXX: could bind s */
++ #ifdef BIND_SOCKET
++ if (ch = bind_socket(s,ip)) return ch;
++ #endif
+
+ if (connect(s,(struct sockaddr *) &sin,sizeof(sin)) == 0) {
+ ndelay_off(s);
+--- Makefile.orig Mon Sep 7 20:44:52 1998
++++ Makefile Mon Sep 7 21:04:33 1998
+@@ -1333,10 +1333,12 @@
+
+ qmail-qmqpc: \
+ load qmail-qmqpc.o slurpclose.o timeoutread.o timeoutwrite.o \
+-timeoutconn.o ip.o control.o auto_qmail.o sig.a ndelay.a open.a \
+-getln.a substdio.a stralloc.a alloc.a error.a str.a fs.a socket.lib
++timeoutconn.o constmap.o case_diffb.o ip.o control.o auto_qmail.o \
++sig.a ndelay.a open.a getln.a substdio.a stralloc.a alloc.a error.a \
++str.a fs.a socket.lib
+ ./load qmail-qmqpc slurpclose.o timeoutread.o \
+- timeoutwrite.o timeoutconn.o ip.o control.o auto_qmail.o \
++ timeoutwrite.o timeoutconn.o constmap.o case_diffb.o \
++ ip.o control.o auto_qmail.o \
+ sig.a ndelay.a open.a getln.a substdio.a stralloc.a alloc.a \
+ error.a str.a fs.a `cat socket.lib`
+
+@@ -2066,12 +2068,14 @@
+
+ tcp-env: \
+ load tcp-env.o dns.o remoteinfo.o timeoutread.o timeoutwrite.o \
+-timeoutconn.o ip.o ipalloc.o case.a ndelay.a sig.a env.a getopt.a \
+-stralloc.a alloc.a substdio.a error.a str.a fs.a dns.lib socket.lib
++timeoutconn.o constmap.o control.o ip.o ipalloc.o case.a open.a \
++getln.a ndelay.a sig.a env.a getopt.a stralloc.a alloc.a \
++substdio.a error.a str.a fs.a dns.lib socket.lib
+ ./load tcp-env dns.o remoteinfo.o timeoutread.o \
+- timeoutwrite.o timeoutconn.o ip.o ipalloc.o case.a ndelay.a \
+- sig.a env.a getopt.a stralloc.a alloc.a substdio.a error.a \
+- str.a fs.a `cat dns.lib` `cat socket.lib`
++ timeoutwrite.o timeoutconn.o constmap.o control.o ip.o ipalloc.o \
++ case.a open.a getln.a ndelay.a sig.a env.a getopt.a stralloc.a \
++ alloc.a substdio.a error.a str.a fs.a \
++ `cat dns.lib` `cat socket.lib`
+
+ tcp-env.0: \
+ tcp-env.1
+
+
diff --git a/z-mail/qmail/patches/qmailqueue-patch
b/z-mail/qmail/patches/qmailqueue-patch
new file mode 100644
index 0000000..ec304b6
--- /dev/null
+++ b/z-mail/qmail/patches/qmailqueue-patch
@@ -0,0 +1,72 @@
+From: Bruce Guenter <bguenter-djb-qmail AT qcc.sk.ca>
+To: qmail AT list.cr.yp.to
+Subject: QMAILQUEUE patch for qmail-1.03
+Date: Mon, 25 Jan 1999 15:37:21 -0600
+
+Greetings.
+
+Appended is a patch to qmail-1.03 that causes any program that would run
+qmail-queue to look for an environment variable QMAILQUEUE. If it is
+present, it is used in place of the string "bin/qmail-queue" when
+running qmail-queue. This could be used, for example, to add a program
+into the qmail-smtpd->qmail-queue pipeline that could do filtering,
+rewrite broken headers, etc. (this is my planned usage for it).
+
+This has undergone virtually no testing, but it looks so simple that it
+almost has to be correct. No warranties, etc. Note that the chdir to
+/var/qmail is always done before exec'ing the program.
+
+Does this look like a reasonable thing to do?
+--
+Bruce Guenter, QCC Communications Corp. EMail: bruce.guenter AT qcc.sk.ca
+Phone: (306)249-0220 WWW: http://www.qcc.sk.ca/~bguenter/
+
+diff -u qmail-1.03-orig/Makefile qmail-1.03/Makefile
+--- qmail-1.03-orig/Makefile Mon Jun 15 04:53:16 1998
++++ qmail-1.03/Makefile Tue Jan 19 10:52:24 1999
+@@ -1483,12 +1483,12 @@
+ trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \
+ datetime.a case.a ndelay.a getln.a wait.a seek.a fd.a sig.a open.a \
+ lock.a stralloc.a alloc.a substdio.a error.a str.a fs.a auto_qmail.o \
+-auto_split.o
++auto_split.o env.a
+ ./load qmail-send qsutil.o control.o constmap.o newfield.o \
+ prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \
+ qmail.o date822fmt.o datetime.a case.a ndelay.a getln.a \
+ wait.a seek.a fd.a sig.a open.a lock.a stralloc.a alloc.a \
+- substdio.a error.a str.a fs.a auto_qmail.o auto_split.o
++ substdio.a error.a str.a fs.a auto_qmail.o auto_split.o env.a
+
+ qmail-send.0: \
+ qmail-send.8
+diff -u qmail-1.03-orig/qmail.c qmail-1.03/qmail.c
+--- qmail-1.03-orig/qmail.c Mon Jun 15 04:53:16 1998
++++ qmail-1.03/qmail.c Tue Jan 19 09:57:36 1999
+@@ -6,14 +6,25 @@
+ #include "fd.h"
+ #include "qmail.h"
+ #include "auto_qmail.h"
++#include "env.h"
+
+-static char *binqqargs[2] = { "bin/qmail-queue", 0 } ;
++static char *binqqargs[2] = { 0, 0 } ;
++
++static void setup_qqargs()
++{
++ if(!binqqargs[0])
++ binqqargs[0] = env_get("QMAILQUEUE");
++ if(!binqqargs[0])
++ binqqargs[0] = "bin/qmail-queue";
++}
+
+ int qmail_open(qq)
+ struct qmail *qq;
+ {
+ int pim[2];
+ int pie[2];
++
++ setup_qqargs();
+
+ if (pipe(pim) == -1) return -1;
+ if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }
+
diff --git a/z-mail/qmail/xinetd.d/qmail-smtpd
b/z-mail/qmail/xinetd.d/qmail-smtpd
new file mode 100644
index 0000000..6a983ef
--- /dev/null
+++ b/z-mail/qmail/xinetd.d/qmail-smtpd
@@ -0,0 +1,11 @@
+service smtp
+{
+ socket_type = stream
+ protocol = tcp
+ wait = no
+ user = qmaild
+ server = /var/qmail/bin/tcp-env
+ server_args = /var/qmail/bin/qmail-smtpd
+ log_on_success = PID HOST USERID EXIT DURATION
+ log_on_failure = HOST USERID ATTEMPT
+}



  • [SM-Commit] GIT changes to master z-rejected grimoire by Jeremy Blosser (92012c0e74b63ca65a4fef501b71a3951c39b88d), Jeremy Blosser, 04/01/2007

Archive powered by MHonArc 2.6.24.

Top of Page