split port into stable and snapshot versions

This commit is contained in:
jakob 2000-09-25 21:02:29 +00:00
parent 3752a44185
commit 7d9995930b
27 changed files with 680 additions and 47 deletions

View File

@ -1,41 +1,6 @@
# $OpenBSD: Makefile,v 1.27 2000/09/18 18:43:35 jakob Exp $
# $OpenBSD: Makefile,v 1.28 2000/09/25 21:02:29 jakob Exp $
DISTNAME= postfix-19991231-pl09
CATEGORIES= mail
NEED_VERSION= 1.310
MASTER_SITES= ftp://ftp.merit.edu/postfix/official/ \
ftp://ftp.sunet.se/pub/unix/mail/postfix/official/ \
ftp://ftp.tau.ac.il/pub/unix/mail/postfix/official/ \
ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/
SUBDIR+= stable
SUBDIR+= snapshot
HOMEPAGE= http://www.postfix.org/
MAINTAINER= jakob@openbsd.org
PERMIT_PACKAGE_CDROM= yes
PERMIT_PACKAGE_FTP= yes
PERMIT_DISTFILES_CDROM= yes
PERMIT_DISTFILES_FTP= yes
MAKE_FLAGS= CC="${CC}" DEBUG="" OPT="${CFLAGS}" \
OPTS="CC=\"${CC}\" DEBUG=\"\" OPT=\"${CFLAGS}\""
ALL_TARGET= default
do-install:
${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/postfix
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/postfix
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/postfix
${INSTALL_PROGRAM} ${WRKSRC}/bin/* ${PREFIX}/sbin
${INSTALL_SCRIPT} ${FILESDIR}/postfix-enable ${PREFIX}/sbin
${INSTALL_SCRIPT} ${FILESDIR}/postfix-disable ${PREFIX}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/libexec/* ${PREFIX}/libexec/postfix
${INSTALL_DATA} ${WRKSRC}/conf/* ${PREFIX}/share/examples/postfix
@(cd ${WRKSRC}/man; \
for mandir in man[0-9]; do \
${INSTALL_MAN} $$mandir/* ${PREFIX}/man/$$mandir; \
done)
${INSTALL_DATA} ${WRKSRC}/html/*.html ${PREFIX}/share/doc/postfix
${INSTALL_DATA} ${WRKSRC}/html/*.gif ${PREFIX}/share/doc/postfix
.include <bsd.port.mk>
.include <bsd.port.subdir.mk>

41
mail/postfix/Makefile.inc Normal file
View File

@ -0,0 +1,41 @@
# $OpenBSD: Makefile.inc,v 1.1 2000/09/25 21:02:29 jakob Exp $
CATEGORIES= mail
NEED_VERSION= 1.310
MASTER_SITES= ftp://ftp.merit.edu/postfix/%SUBDIR%/ \
ftp://ftp.sunet.se/pub/unix/mail/postfix/%SUBDIR%/ \
ftp://ftp.tau.ac.il/pub/unix/mail/postfix/%SUBDIR%/ \
ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/%SUBDIR%/
DIST_SUBDIR= postfix
HOMEPAGE= http://www.postfix.org/
MAINTAINER= Jakob Schlyter <jakob@openbsd.org>
PERMIT_PACKAGE_CDROM= yes
PERMIT_PACKAGE_FTP= yes
PERMIT_DISTFILES_CDROM= yes
PERMIT_DISTFILES_FTP= yes
MAKE_FLAGS= CC="${CC}" DEBUG="" OPT="${CFLAGS}" \
OPTS="CC=\"${CC}\" DEBUG=\"\" OPT=\"${CFLAGS}\""
ALL_TARGET= default
do-install:
${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/postfix
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/postfix
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/postfix
${INSTALL_PROGRAM} ${WRKSRC}/bin/* ${PREFIX}/sbin
${INSTALL_SCRIPT} ${FILESDIR}/postfix-enable ${PREFIX}/sbin
${INSTALL_SCRIPT} ${FILESDIR}/postfix-disable ${PREFIX}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/libexec/* ${PREFIX}/libexec/postfix
${INSTALL_DATA} ${WRKSRC}/conf/* ${PREFIX}/share/examples/postfix
@(cd ${WRKSRC}/man; \
for mandir in man[0-9]; do \
${INSTALL_MAN} $$mandir/* ${PREFIX}/man/$$mandir; \
done)
${INSTALL_DATA} ${WRKSRC}/html/*.html ${PREFIX}/share/doc/postfix
${INSTALL_DATA} ${WRKSRC}/html/*.gif ${PREFIX}/share/doc/postfix

View File

@ -1,3 +0,0 @@
MD5 (postfix-19991231-pl09.tar.gz) = b4216b6950909dd78dd2ef7e6994fd3e
RMD160 (postfix-19991231-pl09.tar.gz) = a39052c80b4a39dbbdf75bda157528ea27e20ed7
SHA1 (postfix-19991231-pl09.tar.gz) = 0c98f794d9acf77fecfafb20d94484649caeae94

View File

@ -0,0 +1,22 @@
# $OpenBSD: Makefile,v 1.1 2000/09/25 21:02:32 jakob Exp $
DISTNAME= snapshot-20000924
PKGNAME= postfix-${DISTNAME}
MASTER_SITE_SUBDIR= experimental
LIB_DEPENDS+= pcre::devel/pcre
FLAVORS= sasl
FLAVOR?=
.if ${FLAVOR:L:Msasl}
MAKE_FLAGS+= CCARGS="-DHAS_PCRE -I${PREFIX}/include -DUSE_SASL_AUTH -I${PREFIX}/include/sasl" \
AUXLIBS="-L${PREFIX}/lib -lpcre -lsasl -lkrb"
LIB_DEPENDS+= sasl::security/cyrus-sasl
.else
MAKE_FLAGS+= CCARGS="-DHAS_PCRE -I${PREFIX}/include" \
AUXLIBS="-L${PREFIX}/lib -lpcre"
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
MD5 (postfix/snapshot-20000924.tar.gz) = 6f91d09a10dfe188a6cce62366bc997d
RMD160 (postfix/snapshot-20000924.tar.gz) = f309865992c8afd92be61a0a9a0ed5f811538ca8
SHA1 (postfix/snapshot-20000924.tar.gz) = 8f38b6ef6b582570ab86eddbc1ec2f3c4375a447

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: postfix-disable,v 1.2 1999/12/05 15:01:28 jakob Exp $
# $OpenBSD: postfix-disable,v 1.1 2000/09/25 21:02:33 jakob Exp $
if [ ! -f /etc/mailer.conf.pre-postfix ]; then
echo "can't find /etc/mailer.conf.pre-postfix, postfix not disabled"

View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# $OpenBSD: postfix-enable,v 1.1 2000/09/25 21:02:33 jakob Exp $
if [ -f /etc/mailer.conf.postfix ]; then
if [ -f /etc/mailer.conf ]; then
mv -f /etc/mailer.conf /etc/mailer.conf.pre-postfix
echo "old /etc/mailer.conf saved as /etc/mailer.conf.pre-postfix"
fi
mv -f /etc/mailer.conf.postfix /etc/mailer.conf
echo "postfix /etc/mailer.conf enabled"
else
echo "can't find /etc/mailer.conf.postfix, postfix not enabled"
fi

View File

@ -0,0 +1,34 @@
--- conf/master.cf.orig Fri May 26 17:34:51 2000
+++ conf/master.cf Thu Jun 1 10:57:23 2000
@@ -59,19 +59,19 @@
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (50)
# ==========================================================================
-smtp inet n - n - - smtpd
-pickup fifo n n n 60 1 pickup
-cleanup unix - - n - 0 cleanup
-qmgr fifo n - n 300 1 qmgr
-#qmgr fifo n - n 300 1 nqmgr
-rewrite unix - - n - - trivial-rewrite
-bounce unix - - n - 0 bounce
-defer unix - - n - 0 bounce
-smtp unix - - n - - smtp
-showq unix n - n - - showq
-error unix - - n - - error
+smtp inet n - - - - smtpd
+pickup fifo n n - 60 1 pickup
+cleanup unix - - - - 0 cleanup
+qmgr fifo n - - 300 1 qmgr
+#qmgr fifo n - - 300 1 nqmgr
+rewrite unix - - - - - trivial-rewrite
+bounce unix - - - - 0 bounce
+defer unix - - - - 0 bounce
+smtp unix - - - - - smtp
+showq unix n - - - - showq
+error unix - - - - - error
local unix - n n - - local
-lmtp unix - - n - - lmtp
+lmtp unix - - - - - lmtp
cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
uucp unix - n n - - pipe

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.6 2000/08/15 17:01:23 jakob Exp $
# $OpenBSD: DEINSTALL,v 1.1 2000/09/25 21:02:33 jakob Exp $
#
# De-installation setup of postfix

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.7 2000/08/15 17:01:23 jakob Exp $
# $OpenBSD: INSTALL,v 1.1 2000/09/25 21:02:33 jakob Exp $
#
# Pre/post-installation setup of postfix

View File

@ -0,0 +1,151 @@
@comment $OpenBSD: PLIST,v 1.1 2000/09/25 21:02:34 jakob Exp $
@pkgcfl postfix-*
sbin/postalias
sbin/postcat
sbin/postconf
sbin/postdrop
sbin/postfix
sbin/postfix-enable
sbin/postfix-disable
sbin/postkick
sbin/postlock
sbin/postlog
sbin/postmap
sbin/postsuper
sbin/sendmail
sbin/smtp-sink
sbin/smtp-source
libexec/postfix/bounce
libexec/postfix/cleanup
libexec/postfix/error
libexec/postfix/local
libexec/postfix/master
libexec/postfix/nqmgr
libexec/postfix/pickup
libexec/postfix/pipe
libexec/postfix/qmgr
libexec/postfix/showq
libexec/postfix/smtp
libexec/postfix/smtpd
libexec/postfix/trivial-rewrite
@dirrm libexec/postfix
share/examples/postfix/LICENSE
share/examples/postfix/access
share/examples/postfix/aliases
share/examples/postfix/canonical
share/examples/postfix/main.cf
share/examples/postfix/main.cf.default
share/examples/postfix/main.cf.orig
share/examples/postfix/master.cf
share/examples/postfix/master.cf.orig
share/examples/postfix/postfix-script
share/examples/postfix/postfix-script-diff
share/examples/postfix/postfix-script-nosgid
share/examples/postfix/postfix-script-sgid
share/examples/postfix/relocated
share/examples/postfix/sample-aliases.cf
share/examples/postfix/sample-auth.cf
share/examples/postfix/sample-canonical.cf
share/examples/postfix/sample-debug.cf
share/examples/postfix/sample-ldap.cf
share/examples/postfix/sample-local.cf
share/examples/postfix/sample-misc.cf
share/examples/postfix/sample-pcre.cf
share/examples/postfix/sample-rate.cf
share/examples/postfix/sample-regexp.cf
share/examples/postfix/sample-relocated.cf
share/examples/postfix/sample-resource.cf
share/examples/postfix/sample-rewrite.cf
share/examples/postfix/sample-smtp.cf
share/examples/postfix/sample-smtpd.cf
share/examples/postfix/sample-transport.cf
share/examples/postfix/sample-virtual.cf
share/examples/postfix/transport
share/examples/postfix/virtual
@dirrm share/examples/postfix
man/man1/mailq.1
man/man1/newaliases.1
man/man1/postalias.1
man/man1/postcat.1
man/man1/postconf.1
man/man1/postdrop.1
man/man1/postfix.1
man/man1/postkick.1
man/man1/postlock.1
man/man1/postlog.1
man/man1/postmap.1
man/man1/postsuper.1
man/man1/sendmail.1
man/man5/access.5
man/man5/aliases.5
man/man5/canonical.5
man/man5/relocated.5
man/man5/transport.5
man/man5/virtual.5
man/man8/bounce.8
man/man8/cleanup.8
man/man8/defer.8
man/man8/error.8
man/man8/local.8
man/man8/master.8
man/man8/pickup.8
man/man8/pipe.8
man/man8/qmgr.8
man/man8/showq.8
man/man8/smtp.8
man/man8/smtpd.8
man/man8/trivial-rewrite.8
share/doc/postfix/access.5.html
share/doc/postfix/aliases.5.html
share/doc/postfix/architecture.html
share/doc/postfix/backstage.html
share/doc/postfix/basic.html
share/doc/postfix/big-picture.gif
share/doc/postfix/big-picture.html
share/doc/postfix/bounce.8.html
share/doc/postfix/canonical.5.html
share/doc/postfix/cleanup.8.html
share/doc/postfix/commands.html
share/doc/postfix/defer.8.html
share/doc/postfix/delivering.html
share/doc/postfix/error.8.html
share/doc/postfix/faq.html
share/doc/postfix/goals.html
share/doc/postfix/inbound.gif
share/doc/postfix/index.html
share/doc/postfix/local.8.html
share/doc/postfix/mailq.1.html
share/doc/postfix/master.8.html
share/doc/postfix/motivation.html
share/doc/postfix/newaliases.1.html
share/doc/postfix/outbound.gif
share/doc/postfix/pickup.8.html
share/doc/postfix/pipe.8.html
share/doc/postfix/postalias.1.html
share/doc/postfix/postcat.1.html
share/doc/postfix/postconf.1.html
share/doc/postfix/postdrop.1.html
share/doc/postfix/postfix.1.html
share/doc/postfix/postkick.1.html
share/doc/postfix/postlock.1.html
share/doc/postfix/postlog.1.html
share/doc/postfix/postmap.1.html
share/doc/postfix/postsuper.1.html
share/doc/postfix/qmgr.8.html
share/doc/postfix/queuing.html
share/doc/postfix/rate.html
share/doc/postfix/receiving.html
share/doc/postfix/relocated.5.html
share/doc/postfix/resource.html
share/doc/postfix/rewrite.html
share/doc/postfix/security.html
share/doc/postfix/sendmail.1.html
share/doc/postfix/showq.8.html
share/doc/postfix/small-picture.gif
share/doc/postfix/smtp.8.html
share/doc/postfix/smtpd.8.html
share/doc/postfix/transport.5.html
share/doc/postfix/trivial-rewrite.8.html
share/doc/postfix/uce.html
share/doc/postfix/virtual.5.html
@dirrm share/doc/postfix

View File

@ -0,0 +1,7 @@
# $OpenBSD: Makefile,v 1.1 2000/09/25 21:02:34 jakob Exp $
DISTNAME= postfix-19991231-pl09
MASTER_SITE_SUBDIR= official
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
MD5 (postfix/postfix-19991231-pl09.tar.gz) = b4216b6950909dd78dd2ef7e6994fd3e
RMD160 (postfix/postfix-19991231-pl09.tar.gz) = a39052c80b4a39dbbdf75bda157528ea27e20ed7
SHA1 (postfix/postfix-19991231-pl09.tar.gz) = 0c98f794d9acf77fecfafb20d94484649caeae94

View File

@ -0,0 +1,16 @@
#!/bin/sh
#
# $OpenBSD: postfix-disable,v 1.1 2000/09/25 21:02:34 jakob Exp $
if [ ! -f /etc/mailer.conf.pre-postfix ]; then
echo "can't find /etc/mailer.conf.pre-postfix, postfix not disabled"
exit 1
fi
if [ -f /etc/mailer.conf ]; then
mv -f /etc/mailer.conf /etc/mailer.conf.postfix
mv -f /etc/mailer.conf.pre-postfix /etc/mailer.conf
echo "postfix mailer.conf disabled, old mailer.conf enabled"
else
echo "can't find /etc/mailer.conf, postfix not disabled"
fi

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: postfix-enable,v 1.3 2000/08/18 05:57:17 jakob Exp $
# $OpenBSD: postfix-enable,v 1.1 2000/09/25 21:02:34 jakob Exp $
if [ -f /etc/mailer.conf.postfix ]; then
if [ -f /etc/mailer.conf ]; then

View File

@ -0,0 +1,46 @@
--- conf/main.cf.orig Mon Dec 27 22:03:38 1999
+++ conf/main.cf Sat Jan 1 20:51:22 2000
@@ -17,14 +17,14 @@
# The command_directory parameter specifies the location of all
# postXXX commands. The default value is $program_directory.
#
-command_directory = /usr/sbin
+command_directory = y0y0y0/sbin
# The daemon_directory parameter specifies the location of all Postfix
# daemon programs (i.e. programs listed in the master.cf file). The
# default value is $program_directory. This directory must be owned
# by root.
#
-daemon_directory = /usr/libexec/postfix
+daemon_directory = y0y0y0/libexec/postfix
# QUEUE AND PROCESS OWNERSHIP
#
@@ -41,7 +41,7 @@
# These rights are used in the absence of a recipient user context.
# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
#
-#default_privs = nobody
+default_privs = nobody
# INTERNET HOST AND DOMAIN NAMES
#
@@ -165,7 +165,7 @@
# "postfix reload" to eliminate the delay.
#
#alias_maps = dbm:/etc/aliases
-#alias_maps = hash:/etc/aliases
+alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases
@@ -176,7 +176,7 @@
#
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
-#alias_database = hash:/etc/aliases
+alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
# ADDRESS EXTENSIONS (e.g., user+foo)

View File

@ -0,0 +1 @@
fast, secure sendmail replacement

View File

@ -0,0 +1,89 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2000/09/25 21:02:35 jakob Exp $
#
# De-installation setup of postfix
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_DIR=/etc/postfix
SPOOL_DIR=/var/spool/postfix
POSTFIXUID=6
POSTFIXGID=6
MAILDROPGID=12
if [ -f /etc/mailer.conf.postfix ]; then
rm -f /etc/mailer.conf.postfix
fi
# Function: set up postfix user/group accounts.
#
do_accts()
{
echo ""
echo "+---------------"
echo "| Delete the 'postfix' user account, and 'postfix' and 'maildrop'"
echo "| group accounts manually for a full de-installation."
echo "| To do this: execute 'user del postfix', 'group del postfix' and"
echo "| 'group del maildrop' as root."
echo "+---------------"
echo ""
}
# Function: set up the postfix spool dir / chroot area
#
do_spooldir()
{
echo ""
echo "+---------------"
echo "| Delete the /var/spool/postfix spool directory manually"
echo "| for a full de-installation."
echo "| To do this: execute 'rm -rf /var/spool/postfix' as root."
echo "+---------------"
echo ""
}
# Function: install the postfix configuration files from the samples
#
do_configs()
{
echo ""
echo "+---------------"
echo "| The existing $1 configuration files in $CONFIG_DIR,"
echo "| have NOT been deleted. To do this: execute"
echo "| 'rm -rf $CONFIG_DIR' as root."
echo "+---------------"
echo ""
}
# Function: disable the installed postfix mailer.conf
#
do_disable()
{
echo -n "-> "
$PREFIX/sbin/postfix-disable
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { DEINSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
DEINSTALL)
do_accts
do_spooldir
do_configs $1
do_disable
;;
*)
echo "Usage: `basename $0` distname DEINSTALL" >&2
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,77 @@
Postfix Overview - Goals and Features
_________________________________________________________________
The goal of the Postfix project is to implement a viable alternative
to the UNIX Sendmail program. Specific goals, and the ways that
Postfix attempts to achieve them are:
* Wide dissemination. Postfix must be adopted by lots of people in
order to make a significant impact on Internet mail performance
and security. Therefore the software is given away for free, with
no strings attached to it.
* Performance. Postfix is up to three times as fast as its nearest
competitor. A desktop PC running Postfix can receive and deliver a
million different messages per day. Postfix uses web server tricks
to reduce process creation overhead and uses other tricks to
reduce file system overhead, without compromising reliability.
* Compatibility. Postfix is designed to be sendmail-compatible to
make migration easy. Postfix supports /var/mail,
/etc/aliases, NIS, and ~/.forward files. However, Postfix also
attempts to be easy to administer, and therefore it does not use
sendmail.cf.
* Safety and robustness. Postfix is designed to behave rationally
under stress. When the local system runs out of disk space or
memory, the Postfix software backs off, instead of making the
problem worse. By design, no Postfix program keeps growing as the
number of messages etc. increases. Postfix is designed to stay in
control.
* Flexibility. Postfix is built from over a dozen little programs
that each perform only one specific task: receive a message via
SMTP, deliver a message via SMTP, deliver a message locally,
rewrite an address, and so on. Sites with specific requirements
can replace one or more little programs by alternative versions.
And it is easy to disable functionality, too: firewalls and client
workstations don't need local delivery at all.
* Security. Postfix uses multiple layers of defense to protect the
local system against intruders. Almost every Postfix daemon can
run in a chroot jail with fixed low privileges. There is no direct
path from the network to the security-sensitive local delivery
programs - an intruder has to break through several other programs
first. Postfix does not even trust the contents of its own queue
files, or the contents of its own IPC messages. Postfix avoids
placing sender-provided information into shell environment
variables. Last but not least, no Postfix program is set-uid.
Other significant features of interest
* Multiple transports. In the past the author has configured
Sendmail systems that could relay between Internet, DECnet, X.400
and UUCP. Postfix is designed to be flexible enough that it can
operate in such environments without requiring virtual domain or
alias kludges. However, the initial release only talks SMTP, and
has only limited support for UUCP.
* Virtual domains. In the most common case, adding support for a
virtual domain requires change to only a single Postfix lookup
table. Other mailers usually need multiple levels of aliasing or
redirection to achieve the same result.
* UCE control. Postfix can restrict what hosts can relay their
mail through a Postfix system, and supports restrictions on what
mail is allowed to come in. Postfix implements the usual suspects:
blacklists, RBL lookups, HELO/sender DNS lookups. Content
filtering hasn't been implemented yet.
* Table lookups. Postfix does not yet implement an address
rewriting language. Instead it makes extensive use of table
lookups. Tables can be local dbm or db files, or networked NIS or
NetInfo maps. Adding support for other lookup mechanisms is
relatively easy.
_________________________________________________________________
WWW: ${HOMEPAGE}

View File

@ -0,0 +1,157 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2000/09/25 21:02:35 jakob Exp $
#
# Pre/post-installation setup of postfix
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_DIR=/etc/postfix
SAMPLE_CONFIG_DIR=$PREFIX/share/examples/postfix
SPOOL_DIR=/var/spool/postfix
# Function: set up postfix user/group accounts.
#
do_accts()
{
groupinfo -e maildrop
if [ $? -eq 0 ]; then
echo "-> Using group 'maildrop' for postdrop"
else
echo "-> Creating maildrop group"
groupadd maildrop
fi
userinfo -e postfix
if [ $? -eq 0 ]; then
echo "-> Using account/group 'postfix' for postfix"
else
echo "-> Creating postfix user & group"
useradd \
-g =uid \
-c "Disgruntled Postal Worker" \
-d /nonexistent \
-s /sbin/nologin \
-p \* \
postfix
fi
}
# Function: set up the postfix spool dir / chroot area
#
do_spooldir()
{
echo "-> Creating Postfix spool directory and chroot area under $SPOOL_DIR"
[ -d $SPOOL_DIR ] || install -d -o root -g wheel -m 755 $SPOOL_DIR
[ -d $SPOOL_DIR/etc ] || install -d -o root -g wheel -m 755 $SPOOL_DIR/etc
for file in localtime services resolv.conf ; do
install -o root -g wheel -m 755 /etc/$file $SPOOL_DIR/etc
done
}
# Function: replace sendmail binaries with postfix
#
do_mailwrapper()
{
echo "-> Creating /etc/mailer.conf.postfix"
cat <<MAILER >/tmp/mailer.conf.$$
sendmail y0y0y0/sbin/sendmail
send-mail y0y0y0/sbin/sendmail
mailq y0y0y0/sbin/sendmail
newaliases y0y0y0/sbin/sendmail
MAILER
sed "s@y0y0y0@$PREFIX@g" /tmp/mailer.conf.$$ >/etc/mailer.conf.postfix
rm -f /tmp/mailer.conf.$$
chown root:wheel /etc/mailer.conf.postfix
chmod 644 /etc/mailer.conf.postfix
}
# Function: install the postfix configuration files from the samples
#
do_configs()
{
if [ -d $CONFIG_DIR ]; then
echo ""
echo "+---------------"
echo "| The existing $1 configuration files in $CONFIG_DIR,"
echo "| have NOT been changed. You may want to compare them to the"
echo "| current sample files, $SAMPLE_CONFIG_DIR,"
echo "| and update your configuration as needed."
echo "|"
echo "| Existing $CONFIG_DIR/postfix-script, however, will be"
echo "| updated to the latest version."
echo "+---------------"
echo ""
else
# Install config files.
install -d -o root -g wheel -m 755 $CONFIG_DIR
install -o root -g wheel -m 644 $SAMPLE_CONFIG_DIR/* $CONFIG_DIR
sed "s@y0y0y0@$PREFIX@g" $CONFIG_DIR/main.cf > $CONFIG_DIR/main.cf.$$
install -o root -g wheel -m 644 $CONFIG_DIR/main.cf.$$ $CONFIG_DIR/main.cf
rm -f $CONFIG_DIR/main.cf.$$
# The correct postfix-script will be installed later.
rm -f $CONFIG_DIR/postfix-script*
echo ""
echo "+---------------"
echo "| The $1 configuration files in $CONFIG_DIR,"
echo "| have been installed. Please view these files and change"
echo "| the configuration to meet your needs."
echo "+---------------"
echo ""
fi
# Configure setgid maildrop
install -o root -g wheel -m 755 $SAMPLE_CONFIG_DIR/postfix-script-sgid $CONFIG_DIR/postfix-script
chgrp maildrop $PREFIX/sbin/postdrop
chmod 2755 $PREFIX/sbin/postdrop
}
# Function: tell the user what s/he needs to do to use the port just installed
#
do_notice()
{
echo ""
echo "+---------------"
echo "| Postfix can be set up to replace sendmail entirely. Please read the"
echo "| documentation at file:$PREFIX/share/doc/postfix/index.html or"
echo "| http://www.postfix.org/ carefully before you decide to do this!"
echo "|"
echo "| To replace sendmail with postfix you have to install a new mailer.conf"
echo "| using the following command:"
echo "|"
echo "| $PREFIX/sbin/postfix-enable"
echo "|"
echo "| If you want to restore sendmail, this is done using the following command:"
echo "|"
echo "| $PREFIX/sbin/postfix-disable"
echo "+---------------"
echo ""
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
do_accts
;;
POST-INSTALL)
do_spooldir
do_configs $1
do_mailwrapper
do_notice
;;
*)
echo "Usage: `basename $0` distname <PRE-INSTALL|POST-INSTALL>" >&2
exit 1
;;
esac
exit 0

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.10 2000/09/21 15:32:23 jakob Exp $
@comment $OpenBSD: PLIST,v 1.1 2000/09/25 21:02:35 jakob Exp $
sbin/postalias
sbin/postcat
sbin/postconf

View File

@ -0,0 +1,10 @@
security precautions taken, as recommended by the postfix INSTALL doc:
installed with maildrop setgid, to eliminate the world-writable
maildrop vulnerability (local users can present a denial of service).
all daemons chrooted in /var/spool/postfix.
separate postfix user and group, and maildrop group.
-d.