From a5154a9c92720d5c2a98a3ad761eae10153f2d22 Mon Sep 17 00:00:00 2001 From: jolan Date: Tue, 22 Jul 2003 23:01:16 +0000 Subject: [PATCH] import of mini_sendmail-1.3.2: mini_sendmail reads its standard input up to an end-of-file and sends a copy of the message found there to all of the addresses listed. The message is sent by connecting to a local SMTP server. This means mini_sendmail can be used to send email from inside a chroot(2) area. --- mail/mini_sendmail/Makefile | 39 +++++++++++++++++++ mail/mini_sendmail/distinfo | 3 ++ mail/mini_sendmail/patches/patch-Makefile | 32 +++++++++++++++ .../patches/patch-mini_sendmail_8 | 31 +++++++++++++++ .../patches/patch-mini_sendmail_c | 31 +++++++++++++++ mail/mini_sendmail/pkg/DESCR | 4 ++ mail/mini_sendmail/pkg/DESCR-chroot | 2 + mail/mini_sendmail/pkg/PLIST | 5 +++ mail/mini_sendmail/pkg/PLIST-chroot | 2 + 9 files changed, 149 insertions(+) create mode 100644 mail/mini_sendmail/Makefile create mode 100644 mail/mini_sendmail/distinfo create mode 100644 mail/mini_sendmail/patches/patch-Makefile create mode 100644 mail/mini_sendmail/patches/patch-mini_sendmail_8 create mode 100644 mail/mini_sendmail/patches/patch-mini_sendmail_c create mode 100644 mail/mini_sendmail/pkg/DESCR create mode 100644 mail/mini_sendmail/pkg/DESCR-chroot create mode 100644 mail/mini_sendmail/pkg/PLIST create mode 100644 mail/mini_sendmail/pkg/PLIST-chroot diff --git a/mail/mini_sendmail/Makefile b/mail/mini_sendmail/Makefile new file mode 100644 index 00000000000..43c2254cf72 --- /dev/null +++ b/mail/mini_sendmail/Makefile @@ -0,0 +1,39 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2003/07/22 23:01:16 jolan Exp $ +COMMENT= "accept email on behalf of real sendmail" +COMMENT-chroot= "static mini_sendmail for chrooted apache" +DISTNAME= mini_sendmail-1.3.2 +PKGNAME-chroot= mini_sendmail-chroot-1.3.2 +CATEGORIES= mail www +MASTER_SITES= ${HOMEPAGE} + +HOMEPAGE= http://www.acme.com/software/mini_sendmail/ + +MAINTAINER= Jolan Luff + +# BSD +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes + +NO_REGRESS= Yes + +MAKE_ENV+= LDFLAGS="${LDFLAGS}" + +MULTI_PACKAGES= -chroot +SUBPACKAGE?= + +.if defined(PACKAGING) && !empty(SUBPACKAGE) +PREFIX= /var/www +.endif + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/mini_sendmail ${PREFIX}/bin + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/mini_sendmail + ${INSTALL_MAN} ${WRKSRC}/mini_sendmail.8 ${PREFIX}/man/man8 + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/mini_sendmail + ${INSTALL_PROGRAM_DIR} ${WRKINST}/var/www/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mini_sendmail-static \ + ${WRKINST}/var/www/bin/mini_sendmail + +.include diff --git a/mail/mini_sendmail/distinfo b/mail/mini_sendmail/distinfo new file mode 100644 index 00000000000..9dec5bc780a --- /dev/null +++ b/mail/mini_sendmail/distinfo @@ -0,0 +1,3 @@ +MD5 (mini_sendmail-1.3.2.tar.gz) = f705a89b0b9aeaf28dbffbedee4cb1d3 +RMD160 (mini_sendmail-1.3.2.tar.gz) = 9b172cde3d190c3db82b467faf1ecae5ede0ee2d +SHA1 (mini_sendmail-1.3.2.tar.gz) = 1e297ae27135f0f83f09c7be8a911ebfd9e2f966 diff --git a/mail/mini_sendmail/patches/patch-Makefile b/mail/mini_sendmail/patches/patch-Makefile new file mode 100644 index 00000000000..e3aa2ae8028 --- /dev/null +++ b/mail/mini_sendmail/patches/patch-Makefile @@ -0,0 +1,32 @@ +$OpenBSD: patch-Makefile,v 1.1.1.1 2003/07/22 23:01:16 jolan Exp $ +--- Makefile.orig Fri Jan 4 00:05:25 2002 ++++ Makefile Sat Jul 19 21:17:20 2003 +@@ -6,14 +6,14 @@ + + BINDIR = /usr/local/sbin + MANDIR = /usr/local/man +-CC = gcc +-CFLAGS = -O ++#CC = gcc ++#CFLAGS = -O + #CFLAGS = -g +-LDFLAGS = -s -static ++#LDFLAGS = -s -static + #LDFLAGS = -g -static + LDLIBS = $(SYSV_LIBS) + +-CC := $(DIET) $(CC) ++#CC := $(DIET) $(CC) + + + all: mini_sendmail +@@ -23,7 +23,8 @@ diet: + + + mini_sendmail: mini_sendmail.o +- $(CC) $(CFLAGS) $(LDFLAGS) mini_sendmail.o $(LDLIBS) -o mini_sendmail ++ $(CC) $(LDFLAGS) mini_sendmail.o $(LDLIBS) -o mini_sendmail ++ $(CC) $(LDFLAGS) -static mini_sendmail.o $(LDLIBS) -o mini_sendmail-static + + mini_sendmail.o: mini_sendmail.c version.h + $(CC) $(CFLAGS) -c mini_sendmail.c diff --git a/mail/mini_sendmail/patches/patch-mini_sendmail_8 b/mail/mini_sendmail/patches/patch-mini_sendmail_8 new file mode 100644 index 00000000000..28c4a385318 --- /dev/null +++ b/mail/mini_sendmail/patches/patch-mini_sendmail_8 @@ -0,0 +1,31 @@ +$OpenBSD: patch-mini_sendmail_8,v 1.1.1.1 2003/07/22 23:01:16 jolan Exp $ +--- mini_sendmail.8.orig Fri Jul 13 16:08:43 2001 ++++ mini_sendmail.8 Sat Jul 19 22:48:11 2003 +@@ -1,9 +1,11 @@ +-.TH mini_sendmail 8 "12 July 2001" ++.TH mini_sendmail 8 "7 May 2003" + .SH NAME + mini_sendmail - accept email on behalf of real sendmail + .SH SYNOPSIS + .B mini_sendmail + .RB [ -f ] ++.RB [ -i ] ++.RB [ -oi ] + .RB [ -t ] + .RB [ -s ] + .RB [ -T ] +@@ -24,6 +26,14 @@ can be used to send email from inside a + .TP + .B -f + Set the name of the "from" person (i.e. the sender of the mail). ++.TP ++.B -i ++Don't parse for a dot-line, but read input up to an end-of-file. ++Currently, this is always the case, but this option is needed for ++compatibility with sendmail. ++.TP ++.B -oi ++Same as -i, needed for compatibility with sendmail. + .TP + .B -t + Read message for recipients. diff --git a/mail/mini_sendmail/patches/patch-mini_sendmail_c b/mail/mini_sendmail/patches/patch-mini_sendmail_c new file mode 100644 index 00000000000..c5d4472f961 --- /dev/null +++ b/mail/mini_sendmail/patches/patch-mini_sendmail_c @@ -0,0 +1,31 @@ +$OpenBSD: patch-mini_sendmail_c,v 1.1.1.1 2003/07/22 23:01:16 jolan Exp $ +--- mini_sendmail.c.orig Thu Nov 21 14:27:55 2002 ++++ mini_sendmail.c Sat Jul 19 22:47:43 2003 +@@ -129,6 +129,8 @@ main( int argc, char** argv ) + timeout = atoi( &(argv[argn][2]) ); + else if ( strcmp( argv[argn], "-v" ) == 0 ) + verbose = 1; ++ else if ( strcmp( argv[argn], "-i" ) == 0 || strcmp ( argv[argn], "-oi" ) == 0 ) ++ /* do nothing */ ; + else + usage(); + ++argn; +@@ -575,14 +577,16 @@ open_client_socket( void ) + sock_family = PF_INET6; + + #ifdef DO_MINUS_S +- if ( inet_pton( PF_INET, server, (void*) &sa4.sin_addr ) == 0 ) ++ ++ (void) memset( (void*) &sa4, 0, sizeof(sa4) ); ++ if ( inet_pton( AF_INET, server, (void*) &sa4.sin_addr ) == 1 ) + { + sock_family = PF_INET; + sa4.sin_port = htons( SMTP_PORT ); + sa_len = sizeof(sa4); + (void) memmove( &sa, &sa4, sa_len ); + } +- else if ( inet_pton( PF_INET6, server, (void*) &sa.sin6_addr ) == -1 ) ++ else if ( inet_pton( AF_INET6, server, (void*) &sa.sin6_addr ) != 1 ) + { + #ifdef DO_DNS + (void) memset( &hints, 0, sizeof(hints) ); diff --git a/mail/mini_sendmail/pkg/DESCR b/mail/mini_sendmail/pkg/DESCR new file mode 100644 index 00000000000..f7adad7e456 --- /dev/null +++ b/mail/mini_sendmail/pkg/DESCR @@ -0,0 +1,4 @@ +mini_sendmail reads its standard input up to an end-of-file and sends a +copy of the message found there to all of the addresses listed. The +message is sent by connecting to a local SMTP server. This means +mini_sendmail can be used to send email from inside a chroot(2) area. diff --git a/mail/mini_sendmail/pkg/DESCR-chroot b/mail/mini_sendmail/pkg/DESCR-chroot new file mode 100644 index 00000000000..264da1b3ee3 --- /dev/null +++ b/mail/mini_sendmail/pkg/DESCR-chroot @@ -0,0 +1,2 @@ +statically linked version of mini_sendmail which installs itself into +the default Apache chroot area. diff --git a/mail/mini_sendmail/pkg/PLIST b/mail/mini_sendmail/pkg/PLIST new file mode 100644 index 00000000000..588c267dd6f --- /dev/null +++ b/mail/mini_sendmail/pkg/PLIST @@ -0,0 +1,5 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2003/07/22 23:01:16 jolan Exp $ +bin/mini_sendmail +man/man8/mini_sendmail.8 +share/doc/mini_sendmail/README +@dirrm share/doc/mini_sendmail diff --git a/mail/mini_sendmail/pkg/PLIST-chroot b/mail/mini_sendmail/pkg/PLIST-chroot new file mode 100644 index 00000000000..02bf4d3fd94 --- /dev/null +++ b/mail/mini_sendmail/pkg/PLIST-chroot @@ -0,0 +1,2 @@ +@comment $OpenBSD: PLIST-chroot,v 1.1.1.1 2003/07/22 23:01:16 jolan Exp $ +bin/mini_sendmail