# Copyright (c) 2007 Antoine Jacoutot # This document helps you to configure sendmail(8) under OpenBSD # so that all mail is sent to a central server. # Using this method, no daemon needs to be started/listening. # Beware though, using sendmail(8) as a client only automatically # deactivate some features (such as aliases(5)...). $ cd /usr/share/sendmail/cf/ $ sudo cp -p submic.mc `hostname`-submit.mc $ sudoedit `hostname`-submit.mc # change "FEATURE(`msp', `[127.0.0.1]')dnl" with "FEATURE(`msp', `[mtahost.domain.tld]')dnl" # alternatively, you can just replace "D{MTAHost}[127.0.0.1]" # in the default /etc/mail/submit.cf file with "D{MTAHost}[mtahost.domain.tld]" $ sudo make `hostname`-submit.cf $ sudo mv `hostname`-submit.cf /etc/mail/submit.cf $ sudoedit /etc/rc.conf.local # add/change the variable "sendmail_flags=NO" # then, to make the server mtahost.domain.tld accept the messages # for `hostname`, you can use one of the followings # (1) # masquerade the sender so that the server responsable for domain.tld # accepts the message (and be its final destination) $ sudoedit /usr/share/sendmail/cf/`hostname`-submit.mc # add/change the following lines "MASQUERADE_AS(`domain.tld')dnl" "FEATURE(`masquerade_envelope')dnl" "FEATURE(`allmasquerade')dnl" $ sudo make `hostname`-submit.cf $ sudo mv `hostname`-submit.cf /etc/mail/submit.cf # (2) # on the server mtahost.domain.tld, we consider that any messages # to *.domain.tld are local $ sudoedit /etc/mail/mailertable # add the following line ".domain.tld local" $ sudo makemap hash /etc/mail/mailertable < /etc/mail/mailertable $ sudo kill `head -1 /var/run/sendmail.pid`