[root@s9 root ] #apt-get update
[root@s9 root ] #apt-get build-dep postfix
[root@s9 root ] #su - crab
[crab@s9 crab ] $apt-get source postfix

[crab@s9 crab ] $vi rpm/SPECS/postfix.spec
#
Release: 0vl5.1sasl
%build
make tidy
make makefiles \
CCARGS="-DMAX_DYNAMIC_MAPS \
-DUSE_SASL_AUTH -I/usr/include/sasl \
-DHAS_LDAP \
-DHAS_PCRE -I/usr/include/pcre \
-DHAS_MYSQL -I/usr/include/mysql \
-DHAS_PGSQL -I/usr/include/pgsql" \
AUXLIBS="-L/usr/lib/sasl2 -lsasl2"
#
Esc :wq

[crab@s9 crab ] $cd rpm/SPECS
[crab@s9 SPECS ] $rpmbuild -bb postfix.spec
[crab@s9 SPECS ] $cd /home/crab/rpm/RPMS/i386
[crab@s9 i386 ] $su
[root@s9 i386 ] #rpm -Uvh postfix-2.0.20-0vl5.1sasl.i386.rpm
[root@s9 i386 ] #su -
[root@s9 root ] #/usr/sbin/postfix check
[root@s9 root ] #apt-get install cyrus-sasl cyrus-sasl-devel cyrus-sasl-md5 cyrus-sasl-plain db4-devel
[root@s9 root ] #/etc/init.d/saslauthd start
[root@s9 root ] #/sbin/chkconfig saslauthd on
[root@s9 root ] #/usr/sbin/saslpasswd2 -u s9.fracter.net -c crab
Password:
Again (for verification):

[root@s9 root ] #vi /usr/lib/sasl2/smtpd.conf

pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: cram-md5 digest-md5 plain login

Esc :wq

[root@s9 root ] #chown -R root:postfix /etc/sasldb2
[root@s9 root ] #chmod 640 /etc/sasldb2
[root@s9 root ] #/etc/init.d/saslauthd restart
[root@s9 root ] #vi /etc/postfix/main.cf

#
myhostname = s9.fracter.net

mydomain = fracter.net

myorigin = $mydomain

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain $mydomain,

unknown_local_recipient_reject_code = 550
#unknown_local_recipient_reject_code = 450

mynetworks = 192.168.0.0/24, 127.0.0.0/8

relay_domains = $mydestination

relayhost = [provid.ne.co.jp]:25

home_mailbox = Maildir/

#mail_spool_directory = /var/spool/mail
#mailbox_command = /some/where/procmail -a "$EXTENSION"

smtp_sasl_auth_enable = yes

smtpd_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/isp_auth

smtp_sasl_security_options = noanonymous

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination

smtpd_banner = $myhostname ESMTP unknown

smtpd_sasl_local_domain = $mydomain

allow_percent_hack = yes

broken_sasl_auth_clients = yes

#
Esc :wq

[root@s9 root ] #vi /etc/postfix/isp_auth

[provid.ne.co.jp]:25 isp@provid.ne.co.jp:password

Esc :wq

[root@s9 root ] #chmod 600 /etc/postfix/isp_auth
[root@s9 root ] #vi /etc/postfix/master.cf

smtp inetn-n--smtpd
submission inet n-n--smtpd
-o smtpd_etrn_restrictions=reject
-o smtpd_client_restrictions=permit_sasl_authenticated,reject

#
Esc :wq

[root@s9 root ] #postmap /etc/postfix/isp_auth
[root@s9 root ] #/etc/init.d/postfix restart
[root@s9 root ] #/etc/init.d/courier-imap restart