Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  8 Oct 2000 07:02:12 +0000 (GMT)
From:      attila! <attila@hun.org>
To:        freebsd-current@freebsd.org, freebsd-ports@freebsd.org
Subject:   POSTFIX-- Wietse: tweak and go! --pkg & port: both duds
Message-ID:  <20001008070212.04A381C2AB@hun.org>

next in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----

    *****************************************************
    POSTFIX should be included in /usr/src/contrib
    freebsd.org and freefall use it...
    time for an easy choice
    *****************************************************

(1) 28 Sep: tried installing postfix-current 'pkg' --nogo!
    Blew sendmail out of the water --repaired....

(2) 28 Sep: tried installing postfix-current 'port' -nogo!
    Blew sendmail out of the water --repaired...  again.

(3) 01 Oct: go for good ol' manual compile, from Wietse's tar file!

    BINGO!	(see 'by the numbers' following)

    However, being of the suspicious type, before compiling, I
    did grep for possible missing FREEBSD5 definitions --there
    were two in the util/sys_defs.h file.

    Having suffered through close to 20 years of configuring
    sendmail.cf since BSD4.2 first released, I promptly deleted
    sendmail from my systems.... sorry Eric;  m4 has its place,
    but .cf is not one of them; the syntax sucks, and the
    whole thing is an unnecessary, condescending mindfsck(1).


    *************************************************
    Fryin' the egg, or doin' the deal by the numbers:
    *************************************************

    	Poor man's guide to installing 'Postfix'

(a) pick a directory and 'tar -zxf snapshot-20000531.tar.gz'

(b) 'cd snapshot-20000531'

(c) 'grep FREEBSD */[ch]' showed util/sys_defs.h was missing
    two FREEBSD5 declarations --modify accordingly.

    patch for util/sys_defs.h

+++ sys_defs.h	Fri Oct  6 13:13:16 2000
@@ -47,11 +47,13 @@
 #define HAS_ST_GEN	/* struct stat contains inode generation number */
 #endif

- -#if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4)
+#if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \
+    || defined(FREEBSD5)
 #define HAS_DUPLEX_PIPE
 #endif

- -#if defined(OPENBSD2) || defined(FREEBSD3) || defined(FREEBSD4)
+#if defined(OPENBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \
+    || defined(FREEBSD5)
 #define HAS_ISSETUGID
 #endif

(d) make  (do config and create all makefiles)

(e) make  (again, do the big number)

(f) add to /etc/master.passwd (with 'vi_pwd' or execute
    'pwd_mkdb' after editing):

postfix:*:70:70::0:0:Postfix Owner:/nonexistent:/sbin/nologin

    check that uid/gid numbers do not conflict with other
    users

(g) add to /etc/groups:

postfix:*:70:
postdrop:*:72:

    Check that gid numbers do not conflict. postfix gid
    must match postfix gid in master.passwd entry. The
    separate 'postdrop' group is required for the maildrop
    directory which must not be group owned by postfix itself.

 -rwxr-sr-x  1 root  postdrop  223526 Oct  1 00:35 /usr/sbin/postdrop
 drwx-wx--T  2 postfix  postdrop  512 Oct  6 17:31 /var/spool/postfix/maildrop

(h) /usr/tmpdir is required for linking. so as 'root', do

        'mkdir /usr/tmpdir && make install'

    Most questions can be defaulted although I did elect to
    use the SETUGID maildrop file. I chose/accepted
    directories:

    configuration:		/etc/postfix/
    user programs:		/usr/sbin/
    daemons:			/usr/libexec/postfix/
    queue:			/var/spool/postfix/
    mans:			/usr/local/man/

    which keeps the concept of mail uniform. Then, as 'root':

	cd /etc/postfix
	rm -f aliases*
	ln -s /etc/aliases aliases
	ln -s /etc/aliases.db aliases.db

    I had done the same in /etc/mail for the latest version
    of sendmail to leave 'aliases' in its historical location
    as '/etc/aliases'

(i) As 'root', execute

    	postfix start

    which creates the necessary spool directories and behaves
    like a default sendmail system.

    The standard '/etc/postfix/main.cf' will use 'gethostname(3)'
    'and getdomainname(3)'.

    Once it starts, check directory permissions, files, etc.

	postfix check

    Fix whatever is called out (if anything); then, although I
    did not find it necessary, it is recommended to:

	postfix stop
	postfix start

    to make sure everything is cleared and updated.

(j) Leave sendmail running to flush its queue, or if
    '/var/spool/mqueue' is empty, kill 'sendmail'. After postfix
    is installed, 'mailq' only looks at the postfix queue; so:

        /usr/libexec/sendmail/sendmail -bp

    will show the old sendmail queue; the original sendmail at
    this point is only monitoring its own queue.

(k) Create or add to file /etc/rc.local


# ---- /etc/rc.local ----
#
# 0a04 1650 attila	create file and add postfix start
#
#

if [ -r /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
	source_rc_confs
elif [ -r /etc/rc.conf ]; then
	. /etc/rc.conf
fi

case ${postfix_enable} in
[Yy][Ee][Ss])
	if [ -f /usr/sbin/postfix ]; then
		echo -n ' postfix'; /usr/sbin/postfix ${postfix_flags}
	fi
	;;
esac
#
# ---- end rc.local ----

(l) disable sendmail in /etc/rc.conf

sendmail_enable="NO"

(m) enable postfix in /etc/rc.conf

postfix_enable="YES"
postfix_flags="start"

    When you reboot, postfix, not sendmail, will be active.

(n) If your machine is the end destination with a single
    name where gethostname(3) == getdomainname(3), the
    installed /etc/postfix/main.cf file is all you need to run
    in basic mode.

    I trimmed /etc/postfix/main.cf to the essentials and added
    local machine destinations handled on the server. If you
    are running the machine as the final destination, the
    defaults basically do it all until you start playing with
    the filters and the rest of the special goodies in the
    collection of /etc/postfix/sample.------.cf files plus
    user contributed code which can be found on:

	www.postfix.org

    I changed the 'undisclosed_recipients_header' since the
    default 'To: undisclosed recipients:;' format is obnoxious
    and is not accepted by some mail transport agents. The
    modification does not create a 'To: ' line, but the
    'X-Listmgr: lists@hun.org' is included in the header.

# ---- /etc/postfix/main.cf ----
#
# Global Postfix configuration file: main.cf
#
# derived from main.cf-original
#
# 0a02 0400 attila	initialize

# variables set by INSTALL.sh --also see, but do not change main.cf.default

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 10
debugger_command =
	 PATH=/usr/bin:/usr/X11R6/bin
	 xxgdb $daemon_directory/$process_name $process_id & sleep 5

# variables set by attila (none required for default operation)
#
# indent continuing lines, do not use '\'
#
# OBVIOUS: DO NOT USE MY mydestination LINES
# IF YOU DO, YOU WILL NOT RECEIVE ANY MAIL (bummer)
# but don't worry, it will not be sent to me either,
# just bounce, messing up your mailing list subscriptions!

debug_peer_level = 1
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
#undisclosed_recipients_header = X-Listmgr: lists@hun.org
#mydestination = hun.org, localhost.hun.org, hun.net, attila.org,
#	mail.hun.org, www.hun.org, ftp.hun.org,	hun10.hun.org,
#	hun11.hun.org, hun12.hun.org, hun13.hun.org, hun14.hun.org

#
# ---- end main.cf ----

(o) CAUTION: 'make world' reinstalls 'sendmail' even when

NO_SENDMAIL=YES		# do not build sendmail and related programs

    is included in '/etc/make.conf'; 'make world' may not
    compile sendmail, but it restores the symbolic link during
    'make installworld':

	/usr/sbin/sendmail -> /usr/sbin/mailcap

    which blows away postfix' 'sendmail' interface.

    My alternative was:

	'cp /usr/sbin/sendmail /usr/sbin/postmail'

    I had written a two step intermediate mail interface some
    time ago to eliminate the wait for sendmail to do its
    thing; so, all that was necessary was to change its
    target and all user mail programs on this network followed
    right along.

    otherwise, modify mail, Mail, Emacs, Pine, whatever to
    call:

	/usr/sbin/postmail

		---- end ----

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
Comment: No safety this side of the grave; never was, never will be

iQBFAwUBOeAbia/ciqw+xvOFAQHCZgGAg2AMA/0WOrzbo8kOx6zERvBIgVtRahN2
YkWr4Q/oOgeQXmhi59hD1dAmEA1/f3iC
=87j0
-----END PGP SIGNATURE-----


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001008070212.04A381C2AB>