this is obsolete doc -- see http://doc.nethence.com/ instead

Setting up Sendmail on NetBSD 

 

Setting up Sendmail on FreeBSD 8: http://pbraun.nethence.com/unix/mail/sendmail.html 

 

Installing sendmail 

cd ~/
echo $PKG_PATH
pkg_add sendmail
mv /etc/mailer.conf /etc/mailer.conf.dist
cp /usr/pkg/share/examples/sendmail/mailer.conf /etc/mailer.conf
cp /usr/pkg/share/examples/rc.d/smmsp /etc/rc.d/smmsp
cp /usr/pkg/share/examples/rc.d/sendmail /etc/rc.d/sendmail

Note. No need to edit '/etc/mtree/special.local' as we copied mailer.conf instead of making a symlink. 

 

Configuring sendmail 

cd /etc/mail/
ln -s /usr/pkg/share/sendmail/cf
cd /etc/mail/cf/
ls -l netbsd-proto.mc
ls -l generic-bsd4.4.mc
vi sendmail.mc
include(`/usr/pkg/share/sendmail/m4/cf.m4')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl
vi Makefile
CFOWN=root
make install-cf CF=sendmail

Note. change 'bsd4.4' accordingly e.g. 'linux' on a linux system 

Note. DOMAIN generic points to /usr/pkg/share/sendmail/domain/generic.m4. 

Note. Please refer to the [global sendmail guide on this site](http://pbraun.nethence.com/unix/mail/sendmail.html) for further sendmail features. 

 

cat > /etc/mail/local-host-names <<EOF9
$HOST
${HOST%%\.}
EOF9

 

Ready to go 

vi /etc/rc.conf
postfix=NO
smmsp=YES
sendmail=YES
/etc/rc.d/postfix onestop
/etc/rc.d/smmsp start
/etc/rc.d/sendmail start

 

Additional notes 

Do not forget to edit aliases and run newaliases. 

vi /etc/mail/aliases
root:           email@example.net
operator:       root
newaliases

Note. the 'newaliases' command is equivalent to 'sendmail -bi' 

 

Troubleshooting 

To manually create the sendmail configuration, 

m4 sendmail.mc > /etc/mail/sendmail.cf

 

References 

Setting up a secure SMTP server with AUTH and TLS enabled in Sendmail 

https://wiki.netbsd.org/tutorials/services/sendmail_auth_tls/