Simple Postfix install

To install Postfix get the source-koden to your own server
$ mkdir /src
$ cd /src

$ wget ftp://ftp.jaquet.dk/mirror/ftp.porcupine.org/official/postfix-2.0.16.tar.gz

unpack it to a directory:

$ tar zxf postfix-2.0.16.tar.gz
$ cd postfix-2.0.16
$ make -f Makefile.init makefiles
$ make tidy
$ make
$ make install (as root)

READ AND UNDERSTAND ALL THE DOCUMENTS IN "README_FILES"-dir !!!!!
Minimal survival guide:
useradd -s /sbin/nologin postfix (som root)
groupadd postdrop (som root)
when you run the "make install"-command, the program will ask you a lot of different questions, which you can say "yes" to, unless you have a good reason.
For the lazy guys here is a rpm: http://postfix.wl0.org/ftp/RPMS-rh9-i386/postfix-2.0.16-1.rh9.i386.rpm
press here to download



in /etc/aliases you must remember to set:
postfix: root


in /etc/postfix/main.cf
myhostname = mail.domain.dk
inet_interfaces = $myhostname
mydestination = $myhostname
run: postfix start
tada .. postfix is now running...

further advices:

do the following with an editor of your own choise:
#!/bin/sh
#
# postfix This shell script takes care of starting and stopping
# postfix.
#
# chkconfig: 2345 80 30
# description: Postfix is a Mail Transport Agent, which is the program \
# that moves mail from one machine to another.
# processname: postfix
# config: /etc/postfix/
# pidfile: /var/run/postfix.pid

# Hacked by jam 25 Feb 99. Mostly s/sendmail/postfix/g :-)

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/postfix ] || exit 0

RETVAL=0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting postfix: "
/usr/sbin/postfix start
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix
;;
stop)
# Stop daemons.
echo -n "Shutting down postfix: "
/usr/sbin/postfix stop
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/postfix
echo
;;
restart)
$0 stop
$0 start
;;
reload)
/usr/sbin/postfix reload
exit $?
;;
abort)
/usr/sbin/postfix abort
exit $?
;;
flush)
/usr/sbin/postfix flush
exit $?
;;
check)
/usr/sbin/postfix check
exit $?
;;
*)
echo "Usage: postfix {start|stop|restart|reload|abort|flush|check}"
exit 1
esac

exit $RETVAL

# cd /etc/rc3.d
# ln -s ../init.d/postfix S80postfix (som root)
# ln -s ../init.d/postfix K20postfix (som root)



Webmin:
you could consider to install webmin (www.webmin.com), as it contains a module to administer Postfix easily.
A longer presentation of all the good things in Postfix:
Catpipe.net



a few good things in /etc/postfix/main.cf - mainly filters spam:
 smtpd_helo_required = yes
 smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, reject_invalid_hostname, reject_non_fqdn_hostname
 smtpd_sender_restrictions = permit_sasl_authenticated,reject_unauth_pipelining,
reject_unknown_sender_domain, reject_non_fqdn_sender,  reject_rhsbl_sender,
dsn.  rfc-ignorant.org, hash:/etc/postfix/access
 smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, reject_unauth_destination, reject_non_fqdn_recipient
 default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}
 disable_vrfy_command = yes
 smtpd_etrn_restriction = reject
 smtpd_recipient_limit = 128
 smtpd_timeout = 180


Compile options (for mysql and SASL on i686 arch):
make makefiles 'CCARGS=-DHAS_MYSQL \
-fexpensive-optimizations -march=i686 -fomit-frame-pointer -O6 \
-DHAS_SSL -I/usr/local/ssl/include \
-I/usr/include/mysql -DUSE_SASL_AUTH \
-I/usr/local/include/sasl' 'AUXLIBS=-L/usr/lib/mysql \
-lmysqlclient -lz -lm -L/usr/local/lib -lsasl2 \
-L/usr/local/ssl/lib -lssl -lcrypto'
Written by Martin Falck-Hansen.