This repository moved to the official OpenSMTPD github repository
smtpd also known as OpenSMTPD is a smtp server implementation for OpenBSD. It is still a work in progress which still lacks many features.
Then, on top of that, all OpenSMTPD's features are not ported yet. For instance, authentification still doesn't work.
People interested about portable OpenSMTPD, or about OpenSMTPD in general, are encouraged to join the IRC channel #opensmtpd @ FreeNode.net.
OpenSMTPD relies on:
git clone git://github.com/clongeau/opensmtpd.git
or
wget http://www.opensmtpd.org/archives/opensmtpd-latest.tar.gz
tar xzvf opensmtpd-latest.tar.gz
cd opensmtpd
./bootstrap
./configure
make
sudo make install
Please launch configure with special directive about libevent directory:
./configure --with-libevent-dir=/usr/local
./configure --with-libevent-dir=/usr/pkg
./configure --with-libevent-dir=/opt/local
make CFLAGS="-DBIND_8_COMPAT=1"
sudo make install
Please have a look at the complete format description of smtpd.conf configuration file
mkdir /var/empty
useradd -c "SMTP Daemon" -d /var/empty -s /sbin/nologin _smtpd
pw useradd _smtpd -c "SMTP Daemon" -d /var/empty -s /sbin/nologin
First we need a group with an unused GID below 500, list the current ones used:
/usr/bin/dscl . -list /Groups PrimaryGroupID | sort -n -k2,2
Add a group - here we have picked 444:
/usr/bin/sudo /usr/bin/dscl . -create /Groups/_smtpd PrimaryGroupID 444
Then the user. Again we need an unused UID below 500, list the current ones used:
/usr/bin/dscl . -list /Users UniqueID | sort -n -k2,2
Add a user - here we have picked 444:
/usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd UniqueID 444
/usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd AuthenticationAuthority
/usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd PasswordPolicyOptions
/usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd dsAttrTypeNative:KerberosKeys
/usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd dsAttrTypeNative:ShadowHashData
/usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd RealName "SMTP Daemon"
/usr/bin/sudo /usr/bin/dscl . -create /Users/_stmpd Password "*"
/usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd PrimaryGroupID 444
/usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd NFSHomeDirectory \
/var/empty
/usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd UserShell /usr/bin/false
First, kill any running sendmail/exim/qmail/postfix or other.
Then:
smtpd &
or in debug and verbose mode
smtpd -dv