DRAC for FreeBSD

A Simplified Installation Guide

What is DRAC?

DRAC stands for Dynamic Relay Authorization Control and was written
by Gary Mills as a contender for Pop before SMTP. The premise behind
DRAC is to allow dynamic hosts to temporarily relay through an SMTP
server after they have authenticated via POP3 server.

Scope of this Document

The scope of this document is to explain how to install and configure
DRAC on FreeBSD to work with both Sendmail and Qpopper, two of the most 
robust and common mail related applications.

Installing and Configuring DRAC

1. You will most likely want to install DRAC from the ports collection
which will put the files in all the right places.

    a. cd /usr/ports/mail/drac
    b. make
    c. make install
    d. make clean
    e. Edit /usr/local/etc/dracd.host to say:


    f. Edit /usr/local/etc/dracd.allow to say:

2. Enable portmap

    a. vi /etc/hosts.allow, add entry portmap : localhost : allow
    b. vi /etc/rc.conf, change portmap_enable to ="YES"

3. Enable rpc

    a. vi /etc/rc.conf, add rpcbind_enable="YES"

Installing Qpopper

4. Install qpopper from the ports collection
   a. cd /usr/ports/mail/qpopper
   b. make WITH_DRAC=yes install
   c. Optionally, you can include the WITH_Y_OPTION=yes to allow you to specify
	a different logging facility for popper.

Configuring Sendmail

5. When configuring, this document assumes you are using the sendmail installed
by default.

    a. cd /etc/mail
    b. Edit the .mc file
    c. Add the following at the end of the file and PAY ATTENTION TO THE 3 TABS

# dynamic relay authorization control map
Kdrac btree -o /usr/local/etc/dracd



# allow recent POP/IMAP mail clients to relay
R$*                             $: $&{client_addr}
R$+                             $: $(drac $1 $: ? $)
R?                              $@ ?
R$+                             $@ $#OK

6. Enable DRAC in your /etc/rc.conf file

   drac_flags="-i -e 10"

7. Reboot


8. Run a typical test to make sure you can relay after authing to the pop3 server.

Connected to mail.somehost.com.
Escape character is '^]'.
+OK ready
user user
+OK Password required for user.
+OK user has 156 visible messages (0 hidden) in 19178456 octets.
+OK Pop server at mail.somehost.com signing off.
Connection closed by foreign host.

Connected to mail.somehost.com.
Escape character is '^]'.
helo somehost.com
220 mail.somehost.com ESMTP Sendmail 8.12.8p1/; Thu, 29 Jan 2004 00:09:08 -0600 (CST)

250 mail.somehost.com Hello someone.com [], pleased to meet you
mail from: user@somehost2.com
250 2.1.0 user@somehost2.com... Sender ok
rcpt to: info@someotherhost.com
250 2.1.5 info@someotherhost.com... Recipient ok
354 Enter mail, end with "." on a line by itself
250 2.0.0 i0T698Uo002867 Message accepted for delivery
221 2.0.0 mail.somehost.com closing connection
Connection closed by foreign host.

9. If something has failed, check the log files and repeat steps.


Gary Mills for writing DRAC. More information about DRAC and it's uses
can be found on his website: http://mail.cc.umanitoba.ca/drac/