POP/IMAP Server Modifications

DRAC Client Functions

The dracauth() client function is suitable for POP servers that run a separate instance for each mail user. It should be called just after the user has been authenticated successfully.

IMAP servers behave differently from POP servers in that they authenticate the user only once, and maintain the connection after that. Consequently, code to send the relay authorization request to the DRAC server will likely have to be inserted in more than one place to ensure that authorization is renewed periodically. Multi-threaded mail servers will also require a more complex interface. For these servers, use the dracconn() client function to initialize the RPC connection, and the dracdisc() client function to terminate it. Then, use the dracsend() client function at suitable places to do the actual sending of the IP address.

The server hostname can be specified as "localhost" if it's running on the same machine, but it would be better as a run-time configuration parameter.

Qpopper Modifications

Qpopper 3.1 and later versions incorporate DRAC support as a compile-time option. This is controlled by the --with-drac configure flag. See the qpopper documentation for further information.

For earlier versions, here's some good news from Steven Champeon:

I've finally gotten around to making a more-or-less official patch for qpopper 3.0.2 that adds support for DRAC (Dynamic Relay Authorization Control) to the base distrib, including hacks to pop_pass.c and the GNU autoconf configure.in file, config.h.in, etc.

If you have autoconf and can figure out how to run it (in order to generate the 'configure' script) then you can simply grab this patch:

If you don't have autoconf, or don't want to bother running autoconf to create the new configure script, use this patch, which is much longer due to all the line numbers changing from one configure file to the next (a minor complaint, to be sure.)

Both patches may be applied via the usual means:

 tar xvzf qpopper3.0.2.tar.gz
 cat patch-qpopper-3.0.2-drac | patch -p0
or
 tar xvzf qpopper3.0.2.tar.gz
 cat patch-qpopper-3.0.2-drac-no-configure | patch -p0
 cd qpopper3.02
 autoconf
Hopefully, now these will make it into the base distrib so I don't have to keep hacking this stuff into qpopper every time a new dot version or beta is released. The basic hacks haven't changed at all since 2.52/pop_pass.c. This just makes it easier.

Mike McHenry provides two patches, one for use with the UW IMAP 4.7c2 daemon and the other for use with the Qualcomm popper 3.0.1 daemon. Both of these patches make use of a file at /etc/mail/dracd.host which should contain one line with the name of the mail mailserver running the dracd daemon. For example if /etc/mail/dracd.host looks like:

mail.minn.net
All dracd authorizations will be sent to mail.minn.net. If /etc/mail/dracd.host is empty no dracd authorizations will be sent out.

Mike also provides the following RPM packages and the original SRPMS for Redhat 6.0/6.1/6.2 machines at his FTP site.

dracd-1.10	dracd daemon compiled and configured for Redhat 6.x
imap-4.7c2	UW IMAP daemon pre-patched for dracd use
qpopper-3.0.1	Qualcomm popper daemon pre-patched for dracd use

For Qpopper 3.0 beta 36, apply this patch and run configure with the --enable-dracauth option. Then, if libdrac.a is not installed in /usr/lib/drac, edit popper/Makefile in two places to specify the correct path to the library. Finally, run make to compile popper.

Patrik has converted the patch for Qpopper 3 beta 18.

Mike McHenry has created a more comprehensive patch for qpopper v2.53. This patch updates the autoconf scripts, adding a new configure flag named --enable-dracauth. Compiling a DRAC capable version of qpopper now consists of applying the patch, ./configure --enable-dracauth, make. His patch assumes that the libraries are located under /usr/lib/drac.

For the qpopper POP server, this is the original sample patch.

If you are using APOP, you will need this patch as well.

Cucipop Modifications

James Renken created a patch for the Cucipop POP3 server, available at his FTP site. Another patch for CuciPOP was contributed by Michael Kinney. Download this patch.

Cyrus Modifications

Ken Murchison has developed a better way to integrate DRAC into the cyrus IMAP and POP servers. It will be included in the `contrib' directory of cyrus-2.0.12 and future versions. To use it with with cyrus-2.0.13, download this patch. To use it with with cyrus-2.0.9 or cyrus-2.0.11, download this patch.

For version 2.0.7 of the cyrus IMAP and POP servers, download this patch.

Adam Laurie contributes this patch for cyrus 1.6.24.

Forrest Aldrich contributes this patch for cyrus 1.6.20 and this patch for cyrus 1.6.19. He notes that the Makefile will generally have to be patched by hand because its contents will vary with the configure settings and operating system details, but that basically, three lines need to be modified:

DEFS = ... -DDRAC_AUTH
LIBS = ... -ldrac
LDFLAGS = ... -L/usr/local/src/drac

Forrest Aldrich also contributes this patch for cyrus 1.5.19.

For version 1.5.14 of the cyrus IMAP and POP servers, download this patch

UW IMAP Modifications

Per Larsson contributes this patch file. for UW-IMAP 2007. This patch is Steve Bernacki's, slightly modified to apply cleanly to UW-IMAP 2007.

Steve Bernacki contributes this patch file. for UW-IMAP 2006d. To use this patch, the user should `cd' into the base distribution directory and execute:

$ patch -p1 <uw-imap2006d-drac.txt
Finally, the whole thing should be compiled with:
$ make lfd EXTRACFLAGS=-DDRAC_AUTH=1 \
EXTRALDFLAGS="-L/usr/local/src/dracd -ldrac"
Substituting lfd for the OS, and /usr/local/src/dracd for the location of libdrac.a. Steve reports that this patch compiles cleanly on Linux Fedora Core 5.

Per Larsson contributes this patch file. It's an update to Tomohiko Sugihara's patch to make it work with UW-IMAP 2004a.

John Lane provides a patch for the recently released UW IMAP v2004a. This is the patch file. John added some features:

Tomohiko Sugihara provides a patch for UW IMAP 2002 (released on Nov 18 2002). It's based on Baba Buehler's patch. Here's the patch file.

Baba Buehler provides an improved patch for UW IMAP 2001a. This one catches all the different ways that clients can authenticate to the UW POP3 daemon. Here's the patch file.

Per Larsson provides an updated patch for UW IMAP 2001a. Here's the patch file. Per reminds us: don't forget to compile with "EXTRACFLAGS=-DDRAC_AUTH" and "EXTRALDFLAGS=-ldrac".

Dave Alden provides a patch for UW IMAP 2001. Here's the patch file.

John Merriam has updated Mike McHenry's imapd patch for the UW IMAP 2000a IMAP and POP servers. Here's the patch file.

Pradeep Sanders has applied Mike McHenry's imapd patch to the UW ipop3d server as well to allow dracd to receive authentication information from both types of connections. Here's the patch file.

Mike McHenry provides a patch for use with the UW IMAP 4.7c2 daemon. This patch makes use of a file at /etc/mail/dracd.host which should contain one line with the name of the mail mailserver running the dracd daemon. For example if /etc/mail/dracd.host looks like:

mail.minn.net
All dracd authorizations will be sent to mail.minn.net. If /etc/mail/dracd.host is empty no dracd authorizations will be sent out.

Roberto Ullfig contributed the original patch for the University of Washington IMAP server. To compile it, you'll need to add

EXTRACFLAGS= -DDRAC_AUTH
to the Makefile. The environment variable DRACHOST must be set to the name of the machine running the DRAC daemon when imapd is started. You can also unset it to disable DRAC.

Teapop Modifications

ibrahim khalifa, the main author of the Teapop POP server, reports that, as of v0.28, Teapop has native support for DRAC. To enable DRAC support users specify the --with-drac=DIR flag, where DIR is the path to the DRAC libs, when running the configure program.

Courier-IMAP pop3 Modifications

Chris Cappuccio devised a way to add DRAC support to Courier-IMAP without modifying any Courier source code. Each POP3/IMAP server calls this little program after authentication. This program grabs the client's IP address from environment variables. Then, it connects to each DRAC host and enters it.

Nikolas Hagelstein contributes a a new revision of Erich Schuberts modifications. It adds DRAC support to more recent courier versions (eq 4.0.6).

He also notes that Chris Cappuccio's way of adding DRAC support to courier won't work with recent versions because IMHO courier does not support AUTHMODULES anymore.

Nikolas Hagelstein contributes a revision of the patch below that is modified to work with more recent versions of courier IMAP.

Erich Schubert contributes improved patches for courier-imap and courier-pop, for a recent CVS checkout of courier. The drachost can be set via the external configuration variable DRACHOST, and it does work with IPv6 enabled courier builds.

Ana Burrows contributes the following patch for the Courier-IMAP pop3 daemon. Installation instructions are contained within the patch file.