add postfix port

This commit is contained in:
dugsong 1998-12-16 18:30:46 +00:00
parent 646bb8a000
commit bbeea7f858
11 changed files with 596 additions and 0 deletions

56
mail/postfix/Makefile Normal file
View File

@ -0,0 +1,56 @@
# OpenBSD makefile for: postfix
# Version required: beta-19981211
# Date created: 1998-Dec-10
# Whom: dugsong@OpenBSD.ORG
#
# Relevant URLs: http://www.postfix.org/
# http://www.alphaworks.ibm.com/formula/securemailer/
#
# $OpenBSD: Makefile,v 1.1.1.1 1998/12/16 18:30:46 dugsong Exp $
DISTNAME= postfix-beta-19981211
CATEGORIES= mail
MAINTAINER= dugsong@monkey.org
NO_CDROM= "LIC: redistribution not allowed"
MASTER_SITES= see_do-fetch_target
IS_INTERACTIVE= yes
NO_CONFIGURE= yes
ALL_TARGET= default
do-fetch:
@if [ ! -f ${DISTDIR}/${DISTFILES} ]; then \
${ECHO} "" ; \
${ECHO} " The source to this port may not be automatically fetched" ; \
${ECHO} " due to licensing restrictions. You MUST fetch the source" ; \
${ECHO} " manually after reading and agreeing to the license at:" ; \
${ECHO} "" ; \
${ECHO} " http://www.alphaworks.ibm.com/formula/securemailer/" ; \
${ECHO} "" ; \
${ECHO} " Once ${DISTFILES} has been downloaded,"; \
${ECHO} " move it to ${DISTDIR} and then restart this build." ; \
${ECHO} "" ; \
exit 1 ; \
fi
pre-install:
@${SH} ${PKGDIR}/INSTALL with PRE-INSTALL
post-install:
@${SH} ${PKGDIR}/INSTALL with POST-INSTALL
MAN1= mailq.1 newaliases.1 postalias.1 postcat.1 postconf.1 postfix.1 \
postkick.1 postlock.1 postlog.1 postmap.1 sendmail.1
MAN5= access.5 aliases.5 canonical.5 relocated.5 transport.5 virtual.5
MAN8= bounce.8 cleanup.8 defer.8 local.8 master.8 pickup.8 pipe.8 qmgr.8 \
showq.8 smtp.8 smtpd.8 trivial-rewrite.8
.include <bsd.port.mk>

1
mail/postfix/files/md5 Normal file
View File

@ -0,0 +1 @@
MD5 (postfix-beta-19981211.tar.gz) = 629f0f42aaa0cedfffb80ce9a6f40440

View File

@ -0,0 +1,56 @@
*** Makefile.in.orig Wed Dec 9 07:33:50 1998
--- Makefile.in Sat Dec 12 19:27:27 1998
***************
*** 6,11 ****
--- 6,19 ----
showq postalias postcat postconf postkick postlock postlog \
postmap # man html
+ PREFIX?= /usr/local
+ SBINDIR= $(PREFIX)/sbin
+ LIBDIR= $(PREFIX)/lib
+ MANDIR= $(PREFIX)/man
+ HTMLDIR= $(PREFIX)/share/doc
+ ETCDIR= /etc
+ SPOOLDIR= /var/spool
+
default: update
makefiles Makefiles:
***************
*** 38,40 ****
--- 46,79 ----
find . -type s -print | xargs rm -f
find . -type d -print | xargs chmod 755
find . -type f -print | xargs chmod a+r
+
+ install:
+ @echo "-> Creating postfix config directory $(ETCDIR)/postfix"
+ @[ -d $(ETCDIR)/postfix ] || mkdir -p -m 755 $(ETCDIR)/postfix
+ @(cd conf ; for file in * ; do \
+ if [ ! -f $(ETCDIR)/postfix/$$file ] ; then \
+ install -m 644 -c $$file $(ETCDIR)/postfix ; \
+ fi ; \
+ done)
+ @chmod 755 $(ETCDIR)/postfix/postfix-script
+ @echo
+ @echo "-> Installing postfix sample configs in $(LIBDIR)/postfix"
+ @[ -d $(LIBDIR)/postfix ] || mkdir -p -m 755 $(LIBDIR)/postfix
+ @install -m 644 -c conf/* $(LIBDIR)/postfix
+ @echo
+ @echo "-> Creating postfix spool directory $(SPOOLDIR)/postfix"
+ @[ -d $(SPOOLDIR)/postfix/etc ] || mkdir -p -m 755 $(SPOOLDIR)/postfix/etc
+ @(cd /etc ; cp localtime services resolv.conf $(SPOOLDIR)/postfix/etc)
+ @echo
+ @echo "-> Installing postfix binaries in $(SBINDIR)"
+ @[ -d $(SBINDIR) ] || mkdir -p -m 755 $(SBINDIR)
+ @install -m 755 -c -s bin/* $(SBINDIR)
+ @echo
+ @echo "-> Installing postfix manpages in $(MANDIR)"
+ @install -m 644 -c man/man1/* $(MANDIR)/man1
+ @install -m 644 -c man/man5/* $(MANDIR)/man5
+ @install -m 644 -c man/man8/* $(MANDIR)/man8
+ @echo
+ @echo "-> Installing postfix HTML docs in $(HTMLDIR)/postfix"
+ @[ -d $(HTMLDIR)/postfix ] || mkdir -p -m 755 $(HTMLDIR)/postfix
+ @install -m 644 -c html/*.html html/*.gif html/*.fig $(HTMLDIR)/postfix

View File

@ -0,0 +1,19 @@
*** makedefs-orig Fri Dec 11 01:55:19 1998
--- makedefs Fri Dec 11 01:54:25 1998
***************
*** 163,169 ****
*/gcc|gcc) case `$CC -v` in
"gcc version 2.8"*) : ${OPT=};;
esac;;
! *) : ${OPT='-O'};;
esac
: ${CC='gcc $(WARN)'} ${OPT='-O'} ${DEBUG='-g'}
--- 163,169 ----
*/gcc|gcc) case `$CC -v` in
"gcc version 2.8"*) : ${OPT=};;
esac;;
! *) : ${OPT="${CFLAGS:-'-O'}"};;
esac
: ${CC='gcc $(WARN)'} ${OPT='-O'} ${DEBUG='-g'}

View File

@ -0,0 +1,84 @@
*** conf/main.cf.orig Tue Dec 8 20:55:27 1998
--- conf/main.cf Fri Dec 11 14:09:27 1998
***************
*** 17,23 ****
# The program_directory parameter specifies the location of Postfix
# support programs and daemons. This directory must be owned by root.
#
! program_directory = /some/where/postfix/bin
# QUEUE AND PROCESS OWNERSHIP
#
--- 17,23 ----
# The program_directory parameter specifies the location of Postfix
# support programs and daemons. This directory must be owned by root.
#
! program_directory = y0y0y0/sbin
# QUEUE AND PROCESS OWNERSHIP
#
***************
*** 27,40 ****
# OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In particular,
# don't specify nobody or daemon. PLEASE USE A DEDICATED USER.
#
! #mail_owner = postfix
# The default_privs parameter specifies the default rights used by
# the local delivery agent for delivery to external file or command.
# 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
# INTERNET HOST AND DOMAIN NAMES
#
--- 27,40 ----
# OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In particular,
# don't specify nobody or daemon. PLEASE USE A DEDICATED USER.
#
! mail_owner = smtp
# The default_privs parameter specifies the default rights used by
# the local delivery agent for delivery to external file or command.
# 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
# INTERNET HOST AND DOMAIN NAMES
#
***************
*** 166,172 ****
# "postfix reload" to eliminate the delay.
#
#alias_maps = dbm:/etc/aliases
! #alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
# ADDRESS EXTENSIONS (e.g., user+foo)
--- 166,172 ----
# "postfix reload" to eliminate the delay.
#
#alias_maps = dbm:/etc/aliases
! alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
# ADDRESS EXTENSIONS (e.g., user+foo)
***************
*** 205,211 ****
#
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
! #alias_database = hash:/etc/aliases
# JUNK MAIL CONTROLS
#
--- 205,211 ----
#
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
! alias_database = hash:/etc/aliases
# JUNK MAIL CONTROLS
#

View File

@ -0,0 +1,35 @@
*** conf/master.cf-orig Fri Dec 11 01:46:41 1998
--- conf/master.cf Fri Dec 11 03:14:21 1998
***************
*** 45,59 ****
# 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
! rewrite unix - - n - - trivial-rewrite
! bounce unix - - n - 0 bounce
! defer unix - - n - 0 bounce
! smtp unix - - n - - smtp
! showq unix n - n - - showq
local unix - n n - - local
uucp unix - n n - - pipe
flags=F user=uucp argv=uux -n -z -a$sender - $nexthop!rmail ($recipient)
--- 45,59 ----
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (50)
# ==========================================================================
! smtp inet n - - - - smtpd
! pickup fifo n n - 60 1 pickup
! cleanup unix - - - - 0 cleanup
! qmgr fifo n - - 300 1 qmgr
! rewrite unix - - - - - trivial-rewrite
! bounce unix - - - - 0 bounce
! defer unix - - - - 0 bounce
! smtp unix - - - - - smtp
! showq unix n - - - - showq
local unix - n n - - local
uucp unix - n n - - pipe
flags=F user=uucp argv=uux -n -z -a$sender - $nexthop!rmail ($recipient)

1
mail/postfix/pkg/COMMENT Normal file
View File

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

View File

@ -0,0 +1,39 @@
#!/bin/sh
# Post-deinstallation cleanup of postfix.
#
# dugsong@monkey.org
PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [ "$2" != "POST-DEINSTALL" ]; then exit 0 ; fi
echo
for file in /usr/sbin/sendmail /usr/bin/mailq /usr/bin/newaliases ; do
if [ -f ${file}-orig ]; then
echo "-> Restoring original $file"
mv ${file}-orig ${file}
echo
fi
done
perms=`ls -l /usr/sbin/sendmail | cut -f1 -d' '`
if [ "$perms" != "-r-sr-xr-x" ]; then
echo "-> /usr/sbin/sendmail may need to be setuid root to function"
echo " properly now. You may want to change its permissions manually."
echo
fi
if [ -d /etc/postfix ]; then
echo "-> /etc/postfix still exists - you may want to remove it manually."
echo
fi
if [ -d /var/spool/postfix ]; then
echo "-> /var/spool/postfix still exists - you may want to remove it manually."
echo
fi
echo "-> Account 'smtp' and group 'smtp' still exist - you may want to remove these manually."
exit 0

85
mail/postfix/pkg/DESCR Normal file
View File

@ -0,0 +1,85 @@
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.
_________________________________________________________________
For more information, visit http://www.postfix.org/
And remember, it's spelled P-o-s-t-f-i-x, but it's pronounced "VMailer."
-d.
---
http://www.monkey.org/~dugsong/

79
mail/postfix/pkg/INSTALL Normal file
View File

@ -0,0 +1,79 @@
#!/bin/sh
# Pre/post-installation setup of postfix.
#
# dugsong@monkey.org
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PKG_PREFIX=${PKG_PREFIX:-/usr/local}
SMTPUID=6
SMTPGID=6
if [ "$2" = "PRE-INSTALL" ]; then
line=`egrep '^smtp:' /etc/group`
if [ "$line" != "" ]; then
SMTPGID=`echo $line | cut -f3 -d:`
else
echo "-> Creating smtp group, gid $SMTPGID"
echo "smtp:*:${SMTPGID}:" >> /etc/group
echo ""
fi
line=`egrep '^smtp:' /etc/passwd`
if [ "$line" != "" ]; then
SMTPUID=`echo $line | cut -f3 -d:`
else
echo "-> Creating smtp user, uid $SMTPUID"
chpass -a "smtp:*:${SMTPUID}:${SMTPGID}::::Disgruntled Postal Worker:/nonexistent:/sbin/nologin"
echo ""
fi
echo "-> Using account 'smtp' for postfix, uid $SMTPUID, gid $SMTPGID"
echo ""
exit 0
fi
if [ "$2" != "POST-INSTALL" ]; then exit 0; fi
echo ""
if [ ! -d /etc/postfix ]; then
echo "-> Creating postfix config directory /etc/postfix"
mkdir /etc/postfix
install -m 644 -c ${PKG_PREFIX}/lib/postfix/* /etc/postfix
chmod 755 /etc/postfix/postfix-script
echo ""
fi
sed "s@y0y0y0@${PKG_PREFIX}@g" /etc/postfix/main.cf > /etc/postfix/main.cf.$$
mv /etc/postfix/main.cf.$$ /etc/postfix/main.cf
if [ ! -d /var/spool/postfix ]; then
echo "-> Creating postfix spool directory /var/spool/postfix"
mkdir -p -m 755 /var/spool/postfix/etc
(cd /etc ; cp localtime services resolv.conf /var/spool/postfix/etc)
echo ""
fi
echo "Postfix can be set up to replace sendmail entirely."
echo "Please read the documentation at http://www.postfix.org/"
echo "carefully before you decide to do this!"
echo
printf "Do you want to replace sendmail with postfix? [Y/n] "
read ans
case $ans in n*|N*) exit 0 ;; esac
echo
echo "-> Disabling sendmail"
set -x
mv /usr/sbin/sendmail /usr/sbin/sendmail-orig
mv /usr/bin/mailq /usr/bin/mailq-orig
mv /usr/bin/newaliases /usr/bin/newaliases-orig
chmod 555 /usr/sbin/sendmail-orig /usr/bin/mailq-orig /usr/bin/newaliases-orig
set +x
echo
echo "-> Enabling postfix replacements"
set -x
ln -s ${PKG_PREFIX}/sbin/sendmail /usr/sbin/sendmail
ln -s /usr/sbin/sendmail /usr/bin/mailq
ln -s /usr/sbin/sendmail /usr/bin/newaliases
set +x
exit 0

141
mail/postfix/pkg/PLIST Normal file
View File

@ -0,0 +1,141 @@
sbin/master
sbin/postfix
sbin/smtp-source
sbin/smtp-sink
sbin/fsstone
sbin/sendmail
sbin/pickup
sbin/cleanup
sbin/smtpd
sbin/local
sbin/trivial-rewrite
sbin/qmgr
sbin/smtp
sbin/bounce
sbin/pipe
sbin/showq
sbin/postalias
sbin/postcat
sbin/postconf
sbin/postkick
sbin/postlock
sbin/postlog
sbin/postmap
man/man1/mailq.1
man/man1/newaliases.1
man/man1/postalias.1
man/man1/postcat.1
man/man1/postconf.1
man/man1/postfix.1
man/man1/postkick.1
man/man1/postlock.1
man/man1/postlog.1
man/man1/postmap.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/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
lib/postfix/LICENSE
lib/postfix/access
lib/postfix/aliases
lib/postfix/canonical
lib/postfix/main.cf
lib/postfix/main.cf.orig
lib/postfix/master.cf
lib/postfix/master.cf.orig
lib/postfix/postfix-script
lib/postfix/relocated
lib/postfix/sample-aliases.cf
lib/postfix/sample-canonical.cf
lib/postfix/sample-debug.cf
lib/postfix/sample-ldap.cf
lib/postfix/sample-local.cf
lib/postfix/sample-misc.cf
lib/postfix/sample-rate.cf
lib/postfix/sample-resource.cf
lib/postfix/sample-rewrite.cf
lib/postfix/sample-smtp.cf
lib/postfix/sample-smtpd.cf
lib/postfix/sample-transport.cf
lib/postfix/transport
lib/postfix/sample-virtual.cf
lib/postfix/virtual
share/doc/postfix/access.5.html
share/doc/postfix/aliases.5.html
share/doc/postfix/anatomy.html
share/doc/postfix/architecture.html
share/doc/postfix/backstage.html
share/doc/postfix/basic.html
share/doc/postfix/big-picture.fig
share/doc/postfix/big-picture.gif
share/doc/postfix/big-picture.html
share/doc/postfix/bounce.8.html
@exec ln -sf %D/%F %B/defer.8.html
@unexec rm -f %B/defer.8.html
share/doc/postfix/canonical.5.html
share/doc/postfix/cleanup.8.html
share/doc/postfix/commands.html
share/doc/postfix/config.html
share/doc/postfix/delivering.html
share/doc/postfix/faq.html
share/doc/postfix/flow.fig
share/doc/postfix/goals.html
share/doc/postfix/inbound.fig
share/doc/postfix/inbound.gif
share/doc/postfix/index.html
share/doc/postfix/local.8.html
share/doc/postfix/master.8.html
share/doc/postfix/motivation.html
share/doc/postfix/outbound.fig
share/doc/postfix/outbound.gif
share/doc/postfix/overview.html
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/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/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
@exec ln -sf %D/%F %B/mailq.1.html
@exec ln -sf %D/%F %B/newaliases.1.html
@unexec rm -f %B/mailq.1.html %B/newaliases.1.html
share/doc/postfix/showq.8.html
share/doc/postfix/small-picture.fig
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
@dirrm lib/postfix
@comment these pkg utilities suk. eesh.
@unexec /var/db/pkg/postfix-beta-19981211/+DEINSTALL with POST-DEINSTALL