diff -urN ../../stock/courier-imap-1.4.0/README.DRAC ./README.DRAC --- ../../stock/courier-imap-1.4.0/README.DRAC Wed Dec 31 16:00:00 1969 +++ ./README.DRAC Wed Dec 26 11:13:37 2001 @@ -0,0 +1,16 @@ +Dynamic Relay Authorization Control and Courier-IMAP + +The DRAC-for-Courier patch you got this file from is copyright 2001 by Analemma Leia Burrows. (arcturus@hell-city.org) It is released under the GNU General Public License version 2 or later. The license may be found at: http://www.gnu.org/licenses/gpl.html +The patch is NOT WARRANTED to work, compile, solve issues with your significant other, or ANYTHING ELSE. If you use it, you are on your own. + +To compile and run properly the libdrac.a file from the compiled DRAC package needs to be placed in the top courier-imap directory (where this file is located). + +DRAC does not like ipv6 addresses. Make sure that if your system has ipv6 support that you configure courier with --without-ipv6 or else DRAC will not allow relaying even when it is supposed to. + +This patch only affects the pop3 daemon. + +Modifications: +Added several include lines and the call to drac to imap/pop3dserver.c +Added the client IP address to the +OK logged in notice in imap/pop3dserver.c. +Added libdrac.a to the list of libraries in imap/Makefile.am + diff -urN ../../stock/courier-imap-1.4.0/imap/Makefile.am ./imap/Makefile.am --- ../../stock/courier-imap-1.4.0/imap/Makefile.am Sat Dec 1 12:41:10 2001 +++ ./imap/Makefile.am Wed Dec 26 11:07:37 2001 @@ -3,6 +3,8 @@ # Copyright 1998 - 1999 Double Precision, Inc. See COPYING for # distribution information. +# Modified for DRAC service by Analemma Leia Burrows December 2001 + dbDEPENDENCIES=@dblibrary@ dbLDADD=@dblibrary@ @LIBGDBM@ @LIBDB@ @@ -66,7 +68,7 @@ pop3d_SOURCES=pop3dserver.c pop3dcapa.c pop3d_DEPENDENCIES=../authlib/libauthmod.a ../authlib/libauth.a ../maildir/libmaildir.a ../numlib/libnumlib.a -pop3d_LDADD=../authlib/libauthmod.a ../authlib/libauth.a ../maildir/libmaildir.a ../numlib/libnumlib.a +pop3d_LDADD=../authlib/libauthmod.a ../authlib/libauth.a ../maildir/libmaildir.a ../numlib/libnumlib.a ../libdrac.a README: README.html lynx -dump -nolist README.html >README diff -urN ../../stock/courier-imap-1.4.0/imap/pop3dserver.c ./imap/pop3dserver.c --- ../../stock/courier-imap-1.4.0/imap/pop3dserver.c Fri Nov 23 07:10:29 2001 +++ ./imap/pop3dserver.c Wed Dec 26 11:29:39 2001 @@ -5,6 +5,12 @@ ** $Id: pop3dserver.c,v 1.9 2001/11/23 15:01:22 mrsam Exp $ */ +/* + * * Modified for local DRAC service by Analemma Leia Burrows December 2001 + * * For local DRAC server. To use a remote DRAC server replace localhost with + * * its IP address. + * */ + #if HAVE_CONFIG_H #include "config.h" #endif @@ -53,6 +59,10 @@ #include "maildir/maildirmisc.h" #include "maildir/maildirquota.h" #include "maildir/maildirgetquota.h" +// For DRAC +#include "netinet/in.h" +#include "arpa/inet.h" +#include extern void pop3dcapa(); @@ -648,6 +658,7 @@ int main(int argc, char **argv) { char *p; +char *err; authmodclient(); if ((p=getenv("MAILDIR")) != 0 && *p) @@ -683,7 +694,12 @@ scannew(); scancur(); sortmsgs(); - printf("+OK logged in.\r\n"); + +/* Put call to dracauth here. IP address is remoteip */ + if (dracauth("localhost", inet_addr(remoteip), &err) != 0) + syslog(LOG_ALERT,"dracauth() Error \"%s\" for user %s",err,authaddr); + + printf("+OK logged in from %s.\r\n", remoteip); fflush(stdout); loop(); return (0);